Skip to Content
Technical Articles

ABAP Code Insight Plugin – Inline code information in Eclipse

Beginning with the Eclipse version Photon there is a new feature available to show inline information within the source code. I used this new feature to start developing an Open source plugin as addon for ABAP in Eclipse.

The plugin shows mainly two types of information within  the code:

  • reference count for classes, method, interfaces, reports, programs and CDS views
  • the method definition in the method implementation part

Showing information about ABAP code as inline text 

For each method as first information the number of referencing ABAP objects are shown. Additionally to the overall number of references also the number of references from test classes are shown if this option is activated in the preferences.

The second part shows the method header information in the following form:

  • Accessor (public, protected, private),
  • Returning Parameter between the two []
  • Importing, Exporting or Changing parameters between the squared brackets

 

But maybe its easier to see the plugin in action

 

The plugin is still in development but can already be downloaded over the Eclipse marketplace and the source code is available on GitHub. The only prerequisite is to use the Eclipse version Photon, 2018-09 or 2018-12 and of course ABAP in Eclipse has to be installed as the plugin reuses some ADT features.

Have fun while trying it out and let me know your experiences and impressions.

Greetings, Andreas

 

22 Comments
You must be Logged on to comment or reply to a post.
  • So, I wanted to try it. But when I opened eclipse up there were ADT updates to install. So I did that… and restart failed.

    So, I did a clean install. Added your plug in, and once I’d realised that it’s triggered by save/activate, I had to say:

    I like it.

    It would have helped if your animated screenshot had been a bit bigger.

    • Hi Matthew!

      The installation (and update) of the plugin is currently not very smooth, I am not sure if it is because of the new Eclipse functionality or because I have still an error in the plugin configuration, but I am sure I will find this out.

      The ADT update is triggered because I had only one of the newest ADT version available when developing and testing with Photon and higher – but nevertheless it should not be a drawback to be on the latest version of ADT 🙂

      At the end I am happy that it runs at your environment and you are satisfied.

      • Well, I got it working on one of them.

        On my other installation, it’s installed (and that went smoothly), but nothing happens when I save or activate a class. I’ve configured as your example. I’m on Photon Release (4.8.0), latest ADT and Darkest Dark theme.

        • Hmm. Starting Eclipse one time from the command line I think you did already.

          I haven’t tried the plugin with the darkest dark theme, will check this.

          • I tried the combination Photon 3.8.0, latests ADT and Darkest Theme on my computer and it works.
            One bug I found is that setting the default preferences is not done properly but that should not prevent the plugin from starting up.
            Are your running it on a Windows machine or on another operation  system?

             

          • I’ve got Class headers, Class bodies, Method bodies, Show signature on method bodies and Refresh code insight… boxes checked in my preferences.

            In the Class-relevant Local Types section of my class, I’ve got two DEFINITION DEFERRED classes, and they have above them, respectively:

            1 reference

            2 references (1 test)

            Which is correct. So the plugin is there, I just don’t see any activity on other sections of the class!

          • I think I could reproduce or error. It seems if you first update Photon and then 2018-09 or 2018-12, the second installation interfers into the first installation after the clean install. I have not yet any explanation for that.

            I made an updated version just know (0.2.1.0 – regarding some other issues). if you install this first on 2018-09, start it again with eclipse.exe -clean from the command line and then on your Photon installation followed onces again by a restart with clean everything should work perfectly … if I analized it right.

          • Could you please try again with the version published today. There I fixed some issues with code changes in more than one class or text editor part. Maybe this issue and the issue above is related to this.

            Another possible reason is that I am currently parsing the class file and do not work with the outline yet. Therefore some combinations could possible be skipped. (for example there are still some combinations with (customer) namespaces which I am currently not aware of and do not work.

          • I wondered if it might be a namespace thing. The class I mentioned above, where it worked briefly, was a Z, but I do most of my work in a /…/ namespace.

            Anyway, I’ve tried again, and again with eclipse -clean. No joy so far. 🙁

          • Yes thats a point. Classes of customer development namespaces have not been supported yet.
            Version 0.2.1.3 (just released) processes also these objects.

  • Hi Andreas,

    one of the things I ‘really’ missed in AiE were the interface parameters of a method. That one is now solved. I have one request though: would it be possible to add a carriage return after each parameter?

    Now all parameters are separated by a semi colon. But after a relatively small number of parameters, they ‘run’ of the screen and there’s now way to scroll all the way to the right

    Thanks for the plugin.

    Micky.

  • You are right the one line is not ideal, not enough space and scrolling is not supported.
    But currently I think that only one line is supported – I tried it out at least for one version – maybe the newer one will support more than one line.

    Another thing is that I think about shortening the method signature at least for long methods (for example to omit the parameter definition or at least omit the namespace. That would mean for your above example:

    1 reference | public [] (it_to:IT_ORDIM_D_INT CHA:ct_to_success:CL_ANYCLASS)

    1 reference | public [] (it_to CHA:ct_to_success)

    Not sure know whats the best path to go … I think while using it some time, good ideas will arise. If you have another good idea let me know,

    Andreas

     

  • I have installed the plugin with eclipse 2019-03 version 4.11 and restarted it several times with -clean

    checked the preferences but nothing is shown in the code.

    Also checked above comments with save but also nothing is shown.

    I got no errors during installation. Do I miss something in activating this great plugin ?

    Thanks

    Arthur

     

     

    • Hi!

      Do you have more than one Eclipse installation running on your computer? – There seems to be an issue if there is installed more than one installation.

      Beside that there is nothing special to be done.

      Do you use it for standard ABAP classes, Function modules or other ABAP objects?

      Greetings, Andreas

      • Hi Andreas

        I also try to install the latest eclipse version on a laptop with the code insight but also not working as it supposed to be. On my pc I am also updating to the latest version but still cant get it going

        I check abap classes from sap and own classes programms and functions.

        what else needs to be done or can I check?

         

         

        • Maybe starting eclipse one time with -clean over the command line helps. This has at least to be done for some reason when updating from one to another version of the plugin.

  • Dear Andreas

    No there is only 1 eclipse installed

    I have checked it with Z* classes but also with standard SAP classes.

    With functions I also don’t see anything added.

     

    kind regards

    Arthur