Customize Syntax Coloring in ABAP in Eclipse
Syntax coloring is a nice feature every ABAP developer loves since the new ABAP editor was provided a couple of years ago.
But you can only use it to distinguish between keywords, non-keywords, literals and comments. But keywords are all colored the same way in the ABAP editor.
In Eclipse you have much more possibilities to customize the color settings of the keywords in the editor. With the new ADT version 2.58 it is possible to specify the keyword colors via the eclipse preferences page:
In the example above I specify that “Method” and “Endmethod” statements are colored differently in the editor than the other keywords. I can even specify different font settings for these keywords, e.g. I could strikethrough FORM statements. The code then looks like this:
Have fun with your colored code.
Thank you for this post. I am currently on 2.58 and have been able to change my syntax highlighting and love it.
I was looking at the version history at Version history for 2.60 link and noticed that this was mentioned under the change log for version 2.60 and not 2.58. So, the question is, what really did change with version 2.60?
with 2.60 we added the functionality to highlight method/endmethod blocks in the editor.
Oh, nice... thank you, that really helps with screen readability on classes!
does this feature depend by the NW Backend Version?
I'm on NW7.4 SP08 and installed ADT 2.60 on Eclipse Luna:
But unfortunately i can't find this setting possibility within the preferences:
Eugen Soydas - click the second link on the right side which says "Colors and Fonts", it should take you the page with the new settings.
I found the reason for my issue.
As I mentioned, i'm running on Eclipse Luna. But my mistake was, that i downloaded ADT2.60 from the Update-Site for Mars.
A colleague of mine runs Eclipse Mars, we installed the plug-in on his system and he has this settings now at the same area within the preferences as thomas descriped above.
However, thanks for your reply.
nice feature. I found some quirks on my installation.
1) I switched syntax coloring for the data keyword on. It seems that it doesn't work for inline declarations.
2) If i try it for field-symbol(s) it looks like this
3) and if i activate it for select, select-options are also considered.
Is this behaviour intended, maybe you can explain it?
P.S. I use the latest ADT version
thanks for the feedback. I just checked my internal client and it is seams that the bugs are already fixed. So you can expect the correct behavior with the next patch of ADT.
I have the latest ADT plugin (2.68) but the syntax coloring doesn't work, only basic color rules are applied. Does there any priority? Where should I search too fix it?
what about adding regular expressions for styling? Then we could remove the coloring of "METHOD" in CALL METHOD, but keeping it at the beginning of a METHOD block. I know that CALL METHOD is old-fashioned, but much of the written code is it, too.
I think about something like Indesign's GREP-Styles:
is it possible to set different background colors in the abap-editor for writable mode compared to read-only?
no, this is not possible. Maybe a nice extension to the editor. I will talk with my development experts about it.
Not my Idea. Taken over from the ABAP-Workbench Editor.
I am using Eclipse 2021-06 with latest version of ADT installed.
I used * to change the color of all the keywords (to say PEACH color). Most of the keywords got changed to PEACH, but there seems to be bugs.
While DATA shows in PEACH, @DATA still showing in default color. Even explicitly putting DATA keyword as Peach, doesn't have any effect on @DATA.
Similar issue with WITH keyword. It just doesn't change it's color whatever I try.
FIELD-SYMBOL & NO-GAPS also didn't change its color through *, but explicitly putting FIELD-SYMBOL and NO-GAPS as a keyword changed color.
There may be more bugs but that's what I have found till now.
Can you get these issues corrected in next version of ADT or let me know where I can file these as bugs.
My Current Keyword color config