You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The autosuggestion function does not suggest JDK standard classes after the laptop wakes up from sleep #3793
Running "Clean Java Language Server Workspace" temporarily resolves the issue, but it reoccurs eventually.
However, there is a peculiar phenomenon.
When the issue occurs, instead of running "Clean Java Language Server Workspace", if I close and reopen VSCode, the import suggestions for standard libraries work fine while the project is loading, but once the loading is complete, the import suggestions stop working.
I have seen similar behaviour (Linux) but it happened maybe once or twice ever. If it's the same issue, it definitely seems to have started happening more frequently (based on users filing it). I was able to capture the code action before when this happened but nothing really stands out :
The interesting part is that code actions continue to work. It's just the ones relating to the type (that can no longer be detected) that are removed.
For those that are encountering this, a few things to try that might help narrow this down a bit. Immediately after you see this happening :
At the bottom left corner, there should be a Java status icon. Is it in the "Ready" state ?
At the bottom right corner there should be a Java language mode icon. Does it clearly indicate a Java execution environment version ?
Are there any errors in the problems view ? Maybe relating to the import of the project ?
If you go to the command palette and call the command Java: Open Java Language Server Log File, are there any errors/something strange being logged around the time this occurs ?
If you bring up the workspace symbol search (ctrl + t or Go -> Go To Symbol In Workspace), are you able to search for the missing type, or any other types on the classpath ?
If "Import 'SomeType'" doesn't show up, do you see "Add all missing imports" or "Organize Imports" ? Do any of those work ?
Activity
alexandertsukanov commentedon Sep 30, 2024
Seems like the duplicate of #3715
However, I can't be 100% sure since I encounter my issue after my laptop wakes from sleep.
fp024 commentedon Oct 1, 2024
I am experiencing the same issue…
Running "Clean Java Language Server Workspace" temporarily resolves the issue, but it reoccurs eventually.
However, there is a peculiar phenomenon.
When the issue occurs, instead of running "Clean Java Language Server Workspace", if I close and reopen VSCode, the import suggestions for standard libraries work fine while the project is loading, but once the loading is complete, the import suggestions stop working.
alexandertsukanov commentedon Oct 1, 2024
I am wondering if this issue is only related to macOS. Does it affect all operating systems?
rgrunber commentedon Oct 3, 2024
I have seen similar behaviour (Linux) but it happened maybe once or twice ever. If it's the same issue, it definitely seems to have started happening more frequently (based on users filing it). I was able to capture the code action before when this happened but nothing really stands out :
code action difference
The interesting part is that code actions continue to work. It's just the ones relating to the type (that can no longer be detected) that are removed.
For those that are encountering this, a few things to try that might help narrow this down a bit. Immediately after you see this happening :
Java: Open Java Language Server Log File, are there any errors/something strange being logged around the time this occurs ?rgrunber commentedon Oct 16, 2024
I would try the vscode-java pre-release build tomorrow. There's a good chance this has been fixed now.
alexandertsukanov commentedon Oct 17, 2024
@rgrunber cool. Thanks for keeping me updated.