Bug 564635 - Syntax editors ignore configured foreground colors
Summary: Syntax editors ignore configured foreground colors
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.16   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-24 23:55 EDT by Missing name CLA
Modified: 2020-06-24 23:55 EDT (History)
0 users

See Also:


Attachments
Screenshot of fresh workspace w/High Contrast theme and no color changes. (55.66 KB, image/png)
2020-06-24 23:55 EDT, Missing name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2020-06-24 23:55:45 EDT
Created attachment 283402 [details]
Screenshot of fresh workspace w/High Contrast theme and no color changes.

Java editor (and IIRC, CDT editor) ignore(s) configured foreground color.

With a black background color selected, only keywords and comments are visible: methods, variables and punctuation are all black text on black background, making them invisible (unless selected, in which case different colors apply).

This occurs whether "General > Appearance > Enable Theming" is enabled or disabled.

Text in non-Java (and probably non-C/C++) files appears with the correctly chosen foreground color (General > Editors > Text Editors : Foreground Color). Other Text Editors selected colors are displayed correctly - Line Number Foreground, Current Line Highlight, Selection Foreground / Background, Background Color; only Foreground Color is ignored.

Java editor colors are displayed correctly in the Java Preview window, but not in Editor windows.

Colors worked as expected in Eclipse 4.13 (2019-09), but not in 4.15 or 4.16 (2020-06).

The problem appears to be that the foreground color from the theme takes precedence and overrides the color from settings.

No ... just discovered that method names, class names, fields, local variables and packages are all colored the "Others" color in JDT, which gets its default (initial) value from the selected theme.

For instance, on a fresh workspace and ~/.eclipse (eg. rm -rf ~/.eclipse ~/eclipse-workspace), with Enable Theming on and Dark theme selected, almost all Java text is displayed as ice-blue on a charcoal background.

Switching to High Contrast theme, almost all Java text is displayed as black on a carbon background - very low contrast!

Again, only keywords and commends are syntax colored. The rest of the text is black; and Java > Editor > Syntax Coloring : Others is Enabled, Black. By changing this to White, the text is legible, except that parentheses, punctuation and operators are still black. These can be changed individually.

This problem occurs in both Ubuntu 18.04 and 20.04. I have a dark theme (Adwaita -dark) selected in Gnome.

So the problem appears to be twofold: JDT (and probably CDT) ignore(s) various configured Syntax Coloring values (using Other instead); and the Classic and High Contrast themes default to black text on dark background.