Open snjeza opened 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?
(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 :
javac
's immediately simplifies the development of new language features, particularly as the frequency of Java language features per release increases (along with the frequency of releases). This means we'll be able to support new Java versions fasterjavac
, ECJ, and the actual Java language specification all have their quirks. There are cases where they all "say" something different, but ultimately users consider javac
to be the final word. In other words, if javac
can compile it, and ECJ opts to emit a valid error, it's still considered a bug from the user's point of view. Having javac
support can fix many of these issues.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.
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.
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.
Related document - https://projectlombok.org/contributing/lombok-execution-path