-
Notifications
You must be signed in to change notification settings - Fork 446
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
Introduce capability to check if workspace has exited improperly. #3476
Conversation
rgrunber
commented
Jan 24, 2024
- Fixes Exceptions activating vscode-java extension #2405
- .snap files under the workspace metadata location indicate in improper workspace shutdown
This fix is fine for me, but I have one concern. It would result in a fresh import and affect the project import speed. Before we determine to apply this fix, can we create another PR to monitor how often the .snap file appears in telemetry? I want to know how likely this situation is and how many users it affects. If it’s rare, we can clean the workspace automatically. If not, we might consider looking for a better solution. What do you think? |
Sounds fine. I can just modify this PR to also call Update: I've re-used vscode-java/src/standardLanguageClient.ts Line 292 in 9ab7039
|
- .snap files under the workspace metadata location indicate in improper workspace shutdown Signed-off-by: Roland Grunberg <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I don't think we can conclude that the workspace existing with unsaved changes is always harmful. As an example : I took a simple project (can be invisible or even a small Maven one)
On the first import, if you watch the workspace folder that corresponds to the project you should see : watch -n1 -d 'find . -name "*.snap"'
You'll see
but as far as I can tell, the language server starts up and works as normal. So I don't think we can conclude that this error is always harmful :\ There could be a chance that something else happened prior to the workspace exiting with unsaved changes that resulted in an unrecoverable state. |
This aligns with my previous observation. Most of the time the unsaved changes can be restored well upon reopening vscode. One case that cannot be recovered is the error |
Do you have steps to generate the above error consistently ? I might be able to find another way to catch if it's likely to happen through workspace storage files. Another way is to just read the logs of the current session sent from the language server : https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/d8643fce217162487a03cfadfe90e4dbacbe6a5a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/LogHandler.java#L111 and handle at vscode-java/src/standardLanguageClient.ts Lines 277 to 281 in d3bcbaa
|
See #3509 . |