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:


01-04-2016 15-12-14.png



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:



01-04-2016 15-16-32.png


Have fun with your colored code.


Regards,

Thomas.




To report this post you need to login first.

10 Comments

You must be Logged on to comment or reply to a post.

  1. Raghu Govindarajan

    Thomas,

    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?

    Thanks,

    Raghu

    (0) 
  2. Eugen Soydas

    Hi Thomas,

    does this feature depend by the NW Backend Version?

    I’m on NW7.4 SP08 and installed ADT 2.60 on Eclipse Luna:

    ADT2.60.PNG

    But unfortunately i can’t find this setting possibility within the preferences:

    ADT Preferences.PNG

    Cheers

    Eugen

    (0) 
      1. Eugen Soydas

        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.

        Cheers

        Eugen

        (0) 
  3. Christian Guenter

    Hi Thomas,

    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.

    2016-06-25 23_16_46-workspace - ABAP_2 - Global Class ZCL_ALV_REPORTING_VIEW [DVE] - active, locked .png

    2) If i try it for field-symbol(s) it looks like this

    2016-06-25 23_19_34-Preferences.png

    2016-06-25 23_23_40-workspace - ABAP_2 - Global Class ZCL_ALV_REPORTING_VIEW [DVE] - active, locked .png

    3) and if i activate it for select, select-options are also considered.

    2016-06-25 23_27_11-workspace - ABAP_2 - Program Z_TEST_TEMPLATE [DVE] - active - DVE_010_guenterc_e.png

    Is this behaviour intended, maybe you can explain it?

    Regards Christian

    P.S. I use the latest ADT version

    2016-06-25 23_28_55-About Eclipse Features.png

    (0) 
    1. Thomas Fiedler Post author

      Hi Christian,

      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.

      Regards,

      Thomas.

      (0) 
  4. Pavel Astashonok

    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?

    (0) 

Leave a Reply