eclipse-jdtls / eclipse-jdt-core-incubator

Eclipse Public License 2.0
8 stars 1 forks source link

"Unused import" diagnostics disappear after opening file in vscode-javac #838

Open datho7561 opened 1 week ago

datho7561 commented 1 week ago

For example, in https://github.com/eclipse/lemminx, org.w3c.dom.Node is imported in DTDEntityDecl but is never used. This is correctly reported when the document is closed, but once it's opened, the warning disappears.

The root cause is probably related to the unused tree scanner. Maybe it's not being registered correctly for working copies, or maybe its diagnostics are written over by something else.

testforstephen commented 1 week ago

Duplicates with https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/issues/763. This is supposed to be fixed by https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/pull/808, but we reverted it by https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/pull/818 due to some regressions. Mickael's recent change https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/pull/822 can also fix it.