Lombok-intellij-plugin: Support for 'Call hierarchy' for Lombok-generated methods

Created on 9 Nov 2018  路  2Comments  路  Source: mplushnikov/lombok-intellij-plugin

Short description

It's often more useful to see the full call hierarchy (Ctrl + Alt + H) of given method (e.g. getter/setter/constructor) rather than showing usages (Alt + F7). I can do it only if I have the code for getter/setter/constructor available in the class. In case it is generated with Lombok I'm no longer able to see the call hierarchy.

Expected behavior

When calling 'Call hierarchy' (Ctrl + Alt + H) on field 'myField' I should get a popup with list of methods generated by Lombok (e.g. setMyField, getMyField, myField from builder) and after clicking on a given method I should get exactly what I would get if the method was in the source code and I called (Ctrl + Alt + H).

When calling 'Call hierarchy' (Ctrl + Alt + H) on a class name I should get a popup with list of all constructors generated by Lombok and after clicking on a given constructor I should get its call hierarchy.

Version information

  • IDEA Version: 2018.2
  • JDK Version: 1.8.0_152
  • OS Type & Version: Ubuntu 16
  • Lombok Plugin Version: 0.22.2018.2
  • Lombok Dependency Version: 1.16.20

Steps to reproduce

  1. Write any Class MyClass with any field myField and @Getter annotation and 'getMyField' method in two different places in any other class/static method.

2.Try to find call hierarchy for getMyField method using Ctrl + Alt + H.

### Sample project
-

### Additional information
-

### Stacktrace
-

STACKTRACE HERE (inside code markup)

enhancement

All 2 comments

As a workaround to display the call hierarchy, you can:

  1. Open the structure panel for your Lombok-ized class
  2. Select the generated method/constructor that you are interested in within that structure panel
  3. Press Ctrl + Alt + H

That should give you the call hierarchy.

Since IntelliJ IDEA 2019.3 CTRL + ALT + H works natively for fields, too (see https://youtrack.jetbrains.com/issue/IDEA-160274), but only shows getters/setters (and their usage) for directly written getters/setters, the Lombok Getters/Setters are ignored (and hence all other usages of them)
It would be great, if the call Hierachy clould also take account of the Lombok getteers/setters.

Was this page helpful?
0 / 5 - 0 ratings