Open
Description
In my project, I have a method of a class that is only invoked by generated source code, and this extension appears to think the method is unused. I have attempted to create a minimum-reproducible example in https://github.com/kalaracey/oracle-vscode-incorrect-unused-hint:
Steps to reproduce:
- Run
gradle build
.- Open the project in VSCode with the
Oracle.oracle-java
extension enabled and other Java extensions disabled.- Open the file
app/src/main/java/org/example/FooController.java
.- Note the squiggle under the
post
method and the warning (on hover) "post is never used":
This is despite the fact that
FooController#post
is used in the generated fileapp/build/generated/sources/annotationProcessor/java/main/org/example/FooController$Route.java
:var result = controller.post();Note that right-clicking on that invocation of
post
inFooController$Route.java
and clicking Go To Definition works - it navigates back toFooController.java
.
VSCode 1.94.2
Oracle.oracle-java
v23.0.0