Hacker News new | ask | show | jobs
by mechanicum 5 days ago
My understanding was the biggest issue has always been that javac is a poor foundation for any kind of live tooling like LSPs?

It’s less “make me a Java LSP” than “rewrite javac around incremental compilation and exposing a semantic DB”. Which sounds like a much harder problem.

1 comments

We have a java compiler API nowadays that solves this.
It looks like that was added in Java SE 6, and doesn’t materially change the underlying problem. Have there been more recent developments?
I was thinking of JEP 484, which I guess technically isn't a compiler API as much as it is a class file API, but that's kind of a big deal for this type of work as probably the primary work the parts of the classpath you currently aren't editing, moreso than parsing a single .java-file, and the kludges we had before this API (e.g. ASM) were incredibly fragile.