java-language-server icon indicating copy to clipboard operation
java-language-server copied to clipboard

lombok support?

Open kejia-liu opened this issue 4 years ago • 10 comments

the vscode extension works great with bazel, which is nice, but getters/setters of lombok classes are not recognized. vscode's lombok extension seemed to only work with the eclipse-based language server

kejia-liu avatar Jun 03 '20 10:06 kejia-liu

+1 lombok support.

mattn avatar Aug 14 '20 06:08 mattn

I'm not really a lombok user so this is going to have to be a PR from someone who uses/loves lombok and wants to make this happen...

georgewfraser avatar Aug 26 '20 05:08 georgewfraser

I'm not sure but AFAIK, it should be possible to add lombok support with:

  • add -javaagent:/path/to/lombok.jar
  • add -Xbootclasspath/a:/path/to/lombok.jar
  • remove -proc:none

mattn avatar Aug 26 '20 07:08 mattn

At least, I could remove compilation errors on my java project using lombok.jar.

mattn avatar Aug 26 '20 07:08 mattn

Here's a repo with an extremely simple repro case if anyone is interested in digging into this issue. With the current java-language-server configured w/ vim:

Screenshot from 2021-08-16 17-30-44

Once this is fixed, this "cannot find symbol" error should not be reported.

dvogel avatar Aug 16 '21 22:08 dvogel

Turning on annotation processing in the compilation stage (by omitting -proc:none from the compiler options) confronts a conflict I'm unsure how to resolve. The JavaCompilerService#compile method accommodates multiple sources files. However, the CompileTask#root method disallows multiple compilation roots. Since annotation processors can produce additional source files, it seems a precursor to unblocking annotation processor support will be to enable compilation of multiple roots. @georgewfraser do you remember why you added this prohibition?

dvogel avatar Aug 30 '21 15:08 dvogel

@mattn Can you please add more details on how you did it? thanks.

ak-seyam avatar Nov 25 '21 15:11 ak-seyam