Skip to Content
Technical Articles
Author's profile photo Andreas Gautsch

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

 

Assigned Tags

      27 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Stefan Schnell
      Stefan Schnell

      Hello Andreas,

      excellent, thank you very much.

      Best regards
      Stefan

       

      Author's profile photo Matthew Billingham
      Matthew Billingham

      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.

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      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.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      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.

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      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.

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      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?

       

      Author's profile photo Matthew Billingham
      Matthew Billingham

      Windows 10.

       

      Author's profile photo Matthew Billingham
      Matthew Billingham

      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!

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      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.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      And now I created a new class. On save, the comments appeared... and on activation, they disappeared!

       

       

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      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.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      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. 🙁

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      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.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      I'll give it a go.

      All else fails, I'll have a look at your code. 😉

      Author's profile photo M. Oestreich
      M. Oestreich

      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.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      Perhaps the separator could be configurable?

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      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

       

      Author's profile photo A. de Smidt
      A. de Smidt

      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

       

       

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      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

      Author's profile photo A. de Smidt
      A. de Smidt

      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?

       

       

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      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.

      Author's profile photo Christian Heimerl
      Christian Heimerl

      Does the Plugin still work at all? Does it work with Eclipse 2021-12 and SAP 1909? I can't get it running. Even with -clean and only a single Eclipse on the PC (as extracted ZIP file)

      Author's profile photo Andreas Gautsch
      Andreas Gautsch
      Blog Post Author

      Hi, I do not know If the plugin works with the latest version. As I am currently not involved in an ABAP project I have not checked it with the newest Eclipse version yet.

       

      Greetings, Andreas

      Author's profile photo A. de Smidt
      A. de Smidt

      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

       

      Author's profile photo Anne Trog
      Anne Trog

      Hi,

       

      I just updated my eclipse to latest version, and it was very hard to keep to do it successfully. During trouble shooting process i had to remove the plugin. when i try to install it now i get the following information:

      problem%20occured%20in%20eclipse

      problem occured in eclipse

       

      Kind regards,

      Anne

      Author's profile photo Andrea Borgia
      Andrea Borgia

      Saw a blog post for this and other plugins I already had, thought of trying this one out, installation was ok but then nothing happens.

      I'm on Windows 11, Eclipse 2022-03, ADT 4.23.0 and the backend I'm running against is the 7.52SP04 demo.  I've already tried restarting with "clean" option but it is still a no-show. Tried with both a local custom object (project $ZABAP2XLSX / class ZCL_EXCEL_WORKSHEET / method BIND_ALV) and a standard one (class CL_ABAP_TYPEDESCR / method DESCRIBE_BY_DATA). There is only one installation of Eclipse, it's a new system.

      Has anyone had any luck recently with this plugin and modern Eclipse / ADT ?

      Author's profile photo Bharath Padmanabhan
      Bharath Padmanabhan

      I love the features mentioned. But the installation doesn't work in my system. I tried with Clean start and still error persists:

      Cannot complete the install because one or more required items could not be found.

      Software currently installed: ABAP Continuous Integration 0.5.5.2 (com.abapci.feature.feature.group 0.5.5.2)

      Missing requirement: com.abapci.plugin 0.5.5.2 requires 'osgi.bundle; org.junit.platform.commons 0.0.0' but it could not be found

      Cannot satisfy dependency:

      From: ABAP Continuous Integration 0.5.5.2 (com.abapci.feature.feature.group 0.5.5.2)

      To: org.eclipse.equinox.p2.iu; com.abapci.plugin [0.5.5.2,0.5.5.2]