Community
Participate
Working Groups
The current syntax coloring scheme only allows to specify a foreground color and bold/normal font attribute for each syntactic element. What is missing is the ability do define a different background color for some of the elements as well as further font attributes like italics or underline. Ultimately, I prefer a syntax coloring scheme where - all comments are in italics and have a slightly different background - Javadoc links are underlined - ... This is currently impossible to set (in build 20011127)
Would be nice to have additional attributes in syntax coloring scheme, but not planed for 2.0
Only background color could be added. Other styles than bold/regular are not supported by the StyledTextWidget.
If other styles than bold/regular are not supported by the StyledTextWidget, then clearly the StyledTextWidget needs either updating or abandoning.
Another good addition to this would be to allow coloring of additional tokens. Instead of having a generic "Other" token, allow coloring by "Identifier", "Operator", "Numeric", etc.
*** Bug 51457 has been marked as a duplicate of this bug. ***
*** Bug 57180 has been marked as a duplicate of this bug. ***
Bold and italic are available since 3.0. Adding background color conflicts with annotations where you can set the background but not the foreground color. If we add support for bg color in syntax coloring then we also have to add fg color option to annotations.
*** Bug 82995 has been marked as a duplicate of this bug. ***
*** Bug 85102 has been marked as a duplicate of this bug. ***
*** Bug 88879 has been marked as a duplicate of this bug. ***
Underline and strikethrough are now also available
(In reply to comment #7) > Bold and italic are available since 3.0. > > Adding background color conflicts with annotations where you can set the > background but not the foreground color. If we add support for bg color in > syntax coloring then we also have to add fg color option to annotations. Why not have the annotation background override the syntax background, like everything else?
(er, I mean every other IDE out there)
The WTP project does do this. I think it would have HUGE benefit! Please, please, pretty please ;)
Just curious whether anyone is working on this bug. Can we have this for 3.4? It would be great to be able to assign different background color to various tokens. This is especially useful in highlighting strings in code.
>Can we have this for 3.4? Different font attributes might come in the future (not for 3.4) but we will never support to set the background.
Out of sheer curiosity, but why would you 'never' want to support background color? Is it too much engineering or something else?
Because highlighting/background is reserved for annotations (e.g. search results, occurrence marks etc.).
*** Bug 230247 has been marked as a duplicate of this bug. ***
From comment #7 > Adding background color conflicts with annotations where you can set the > background but not the foreground color. If we add support for bg color in > syntax coloring then we also have to add fg color option to annotations. I don't really see how that is any special engineering problem. I'm not even sure how annotations affect this, as they'll have whatever background they have and the other elements will have whatever they have. It seems like most of the work is already done and there are not real conflicts. There definitely seems to be enough interest in this feature that it should be implemented. Why is there such resistance to implementing this 1990's IDE feature?
*** Bug 28993 has been marked as a duplicate of this bug. ***
> Because highlighting/background is reserved for annotations (e.g. search > results, occurrence marks etc.). But that doesn't make any sense. Why can't annotations (e.g. errors) simply take precedence? It's really annoying and inconsistent. I can set background colors for items in the XML editor and this is really useful (e.g. shows easily which areas are comments and CDATA and which are just tags). But in the Java editor I can't.
(In reply to comment #22) > But that doesn't make any sense. Why can't annotations (e.g. errors) simply > take precedence? > > It's really annoying and inconsistent. I can set background colors for items in > the XML editor and this is really useful (e.g. shows easily which areas are > comments and CDATA and which are just tags). But in the Java editor I can't. Woah, don't go dragging us into this :), I pulled background colors out of the XML Editor for a milestone during 2.0. I agree with what Dani said in comment 18: having background colors in both places muddles things by having it represent both text annotations and the syntax, making it represent two unrelated concepts. That said, there were complaints so we put it back into the following milestone. You'll notice, though, that none of the provided syntax coloring defaults in WTP include a background color.
> I agree with what Dani said in comment > 18: having background colors in both places muddles things by having it > represent both text annotations and the syntax, making it represent two > unrelated concepts. That said, there were complaints so we put it back into > the following milestone. You'll notice, though, that none of the provided > syntax coloring defaults in WTP include a background color. > Ok - but what you're saying here is a value judgement, and that is that "*I* think it's confusing". 1) Not everybody agrees with this - the fact that this bug exists, the fact that people complained when a similar feature was taken out of the XML editor, and you can find several web pages mentioning the fact (I suspect most people, like me, assumed it was a feature that was yet to be done, rather than one that was being avoided). 2) Other IDEs don't agree with this. For example, IntelliJ supports setting background colors - in fact, it's default Out-of-the-box configuration sets background colors for several things. Not making the defaults change background colors seems a matter of taste; not making the background colors changeable at all seems obstinate.
(In reply to comment #24) I have to agree with Nigel here. I don't see how anyone can ever defeat his arguments. 8 years and running... Several bugs reports marked as duplicate of this... The largest number of votes. What else is needed for this to be considered something worth implementing ? Users are not stupid. We know that background color for syntax coloring will "conflict" (I prefer "be ambiguous") with background color for annotations. If somone decides to set the same color for both, isn't it THEIR problem ? Why would a feature that's been requested so many times not be offered because "it may confuse someone". Better have the option and not use it than rage against not having it.
(In reply to comment #25) > The largest number of votes. It's actually number 13 among the JDT bugs currently: https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&classification=Eclipse&product=JDT&query_format=advanced&votes=10&order=votes Would be nice to have though.
(In reply to comment #26) > (In reply to comment #25) > > The largest number of votes. > > It's actually number 13 among the JDT bugs currently: > https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&classification=Eclipse&product=JDT&query_format=advanced&votes=10&order=votes > > Would be nice to have though. Yes, mea culpa, it was number 1 in my search results (and not in all the bugzilla repository).
Having custom background color for certain syntax elements is really useful, I've grown used to it using jEdit, so I would appreciate if it could be included in Eclipse. I know it poses certain challenges (and that there is no such thing as a "trivial addition" to a program) but have a sneak peek at how jEdit implements it, both from a behavior perspective (e.g how to handle when a custom background color is used for highlighting the current line but at the same time, that specific line contains syntax elements with a different custom color) as well as from a code perspective (jEdit, just as Eclipse, is an open source Java program).
*** Bug 412813 has been marked as a duplicate of this bug. ***
I had background syntax coloring for years in Visual FoxPro. My preference was to highlight strings with a background color of yellow to make it look like I had used a highlighter to highlight all the text in a string.
Wow, I was comment number #14 all the way in 2005 and this is still no closer to being done.
*** Bug 440146 has been marked as a duplicate of this bug. ***
10 years of this bug...