eclipse-jdtls / eclipse-jdt-core-incubator

Eclipse Public License 2.0
8 stars 1 forks source link

[javac] Report "unused ..." diagnostics #300

Open fbricon opened 1 month ago

fbricon commented 1 month ago

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

mickaelistria commented 1 month ago

We can probably just copy the code from the java-language-server, it's MIT and it can work almost without change.