Closed fbricon closed 1 day ago
We can probably just copy the code from the java-language-server, it's MIT and it can work almost without change.
@testforstephen is this something you could look at?
Sure, I have made some local experiments to support unused local variables, private fields, methods, and classes, and it works. Basically, we need to add this support into two places: the JavacCompiler and the DOM parser, as both will report diagnostics.
Sounds awesome, waiting for your PR ;-)
The javac compiler doesn't report "unused ..." diagnostics, but there's still a way to access that information, see how it's done in https://github.com/georgewfraser/java-language-server:
com.sun.source.tree.CompilationUnitTree
is scanned for unused local variables or fields in https://github.com/georgewfraser/java-language-server/blob/master/src/main/java/org/javacs/markup/WarnUnused.java