redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 442 forks source link

Lombok agent doesn't need to be configured if javac is enabled #3875

Open snjeza opened 3 days ago

snjeza commented 3 days ago

Related document - https://projectlombok.org/contributing/lombok-execution-path

mamilic commented 3 days ago

Hi @snjeza,

Apologies for going slightly off-topic, but I’m curious about the benefits of using javac in language server. I noticed this feature in the latest vscode-java version. Does javac support method navigation and other quirks that jdt.ls.core provides? Would it potentially replace jdt.core?

rgrunber commented 3 days ago

(TL;DR : faster language feature adoption, behaving closer to what users see when they run a compile via. CLI, and being able to swap ECJ/javac with no noticeable difference in features)

The 2 main motivations for javac support were :

There is (mostly) a separation between the internals generated by ECJ and the API provided by JDT Core that JDT-LS uses. We've been improving this to make it easy to swap out ECJ with javac. The underlying API remains the same. So yes, the goal is to support everything (code actions, completion, search, etc.). In fact the AST model is pretty good as of now, and most code actions/diagnostics do just work. We're working on improving completion support, and indexing as well. The remaining gaps are in performance and just handling reliability in various cases.

snjeza commented 3 days ago

Apologies for going slightly off-topic, but I’m curious about the benefits of using javac in language server.

See https://github.com/redhat-developer/vscode-java/issues/3875#issuecomment-2504098944

Does javac support method navigation and other quirks that jdt.ls.core provides?

No, it doesn't.

Would it potentially replace jdt.core?

This feature is part of jdt.core.

rgrunber commented 3 days ago

Does javac support method navigation and other quirks that jdt.ls.core provides?

No, it doesn't.

If @mamilic meant : "Will the javac feature support method navigation and all the features JDT-LS provides", then yes, that's the goal, but on its own, javac is just a tool for compilation. All those features come from making requests to the JDT Core API.