lombok-intellij-plugin
lombok-intellij-plugin copied to clipboard
Java + Lombok + Kotlin - find usages did not work
Short description
Unable to find fields usages of Lombok'ed Java classes in Kotlin files.
Expected behavior
Alt+F7 on field should find each usages on this field in Kotlin (also with Java).
Version information
- IDEA Version: IntelliJ IDEA 2018.3.4 (Ultimate Edition) Build #IU-183.5429.30, built on January 29, 2019 JRE: 1.8.0_152-release-1343-b26 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0
- JDK Version: 1.8.0_201
- OS Type & Version: Windows 10, 64 bit
- Lombok Plugin Version: v0.23-2018.3
- Lombok Dependency Version: 1.18.4
Steps to reproduce
- Create project with modules in Java and Kotlin
- In Java module create class Foo with lombok
@Data
annotation - In Kotlin module create some service that uses Foo class attributes from Java module
- Go to Foo.java and try to find usages for attributes that is used in Kotlin module - nothing will be found
Sample project
https://github.com/alexey-krylov/kotlin-java-lombok-search-issue-project
To reproduce search usages issue go to Foo.java and try to find usages of 'uuid' field. It should find one usage in class FooService.kt, but it doesn't.
Additional information
Stacktrace
As i workaround now i'm using @FieldDefaults(level = AccessLevel.PUBLIC) on all fields, in this case all usages is seen by IDEA
Also i've created issue here: https://youtrack.jetbrains.com/issue/IDEA-207470
same issue
it seem like kotlin use property and lombok generate getter, they are confused in IDEA. I can only add a getter to the field
Dear Big man, is the problem solved? Ask for help me!
No, it's still an issue. The workaround with setting all fields to public does work, but it also means you have publicly accessible fields, obviously.