New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing "unused imports" warnings when there's a compilation error #621
Comments
|
Unused imports are absolutely reported. Except when a single Java file with no known classpath is opened, what we call a standalone java file. |
|
This is weird. I tried several other projects, unused imports are reported. But only for this one(I put it on github just now), it does not work. I used in vim with YouCompleteMe, please see these two imports: And here is the log from YCM:
|
|
The same project opens fine and report unused imports in vscode. Maybe @puremourning can help here? |
|
Tried with the latest version of jdt.ls (YCM is currently on 0.15.0) and there are still no errors about unused imports. However, the command to organize imports is removing the unused imports so jdt.ls clearly knows that the imports are not used.
Strange, I don't see any diagnostics about unused imports with vscode-java 0.22.0. |
|
I don't think YCM causes this, because I looked into the YCM log(which I had attached above), and here is the formatted received message from jdt.ls by ycmd. |
|
I also tried with latest |
|
I did some more investigation, and found that there might be some issue of eclipse.jdt.core. A severity 1 error (LOGGER cannot be resolved) at line 38 is blocking two severity 2 (The import java.util.ArrayList is never used, The import java.util.List is never used) from being reported. The same problem happens in eclipse. diagnostics before line 38 commented outdiagnostics after line 38 commented out |
|
I reported the bug for eclipse.jdt.core -- https://bugs.eclipse.org/bugs/show_bug.cgi?id=533592 |
|
Closing, according to https://bugs.eclipse.org/bugs/show_bug.cgi?id=533592#c2:
|



textDocument/publishDiagnosticsdoes not return unused imports in java.Any chance to support this?
The text was updated successfully, but these errors were encountered: