[provide a description of the issue]
Shift + Alt + O fails to organize imports but if I write in the configuration like:
"java.saveActions.organizeImports": true,it works when I use
Command+S, but still not work for theShift+Alt+Ocombination.
[attach a sample project reproducing the error]
[attach logs](https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#enable-logging)
Is it for a simple java file or a complete Java project?
Can you provide a sample project reproducing your issue?
@fbricon
The combination Shift + Alt + O works for a Java project. (Like maven project)
But it doesn't work for a Java file.
While the configuration:
"java.saveActions.organizeImports": true,
works for both.
I can confirm this. Invoking "Organize imports" does not work on a single java file. Setting the option @paperant says does partially works importing some namespaces but not all. In my case it only imported 3 packages:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.Reader;
And I'm having references to other packages like HttpURLConnection and so on...
Version 1.24.1
Commit 24f62626b222e9a8313213fb64b10d741a326288
Date 2018-06-13T17:47:35.732Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
Java extension version: 0.27.0 (June 18th, 2018)
openjdk version "1.8.0_172"
I too can confirm this. Organise imports doesn't work on independent java files.
Hey all... any update on this?
Well, yeah kinda ;-)
If you open a single java file from vscode, it still won't work.
But, last night, we merged Microsoft's new patch to improve standalone java files support. So, with the latest CI build, if you open the folder containing that java file (including all the folders from its packages), then you'll get full java support: organize imports, compilation errors, the whole shebang. No more "incomplete classpath" warning.
This will be part of the next release, around Dec 15th.
Most helpful comment
Well, yeah kinda ;-)
If you open a single java file from vscode, it still won't work.
But, last night, we merged Microsoft's new patch to improve standalone java files support. So, with the latest CI build, if you open the folder containing that java file (including all the folders from its packages), then you'll get full java support: organize imports, compilation errors, the whole shebang. No more "incomplete classpath" warning.
This will be part of the next release, around Dec 15th.