-
Notifications
You must be signed in to change notification settings - Fork 401
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
Unable to acquire the state change lock for the module 'buildship' #2758
Conversation
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
I tried to reproduce the issue I described in redhat-developer/vscode-java#3032 (comment), with and without this patch. Without the patch, the issue is very easy to reproduce, but with the patch, I did not manage to reproduce the issue even after restarting VSCode 10+ times. So it seems like it works 👍 |
@@ -93,6 +93,15 @@ public InitHandler(ProjectsManager manager, PreferenceManager preferenceManager, | |||
|
|||
@Override | |||
public Map<?, ?> handleInitializationOptions(InitializeParams param) { | |||
// https://github.com/redhat-developer/vscode-java/issues/3184 | |||
// start the m2e and buildship plugin before calling JavaCore.setOptions |
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.
Which JavaCore.setOptions(..)
are you refering to ? There is call to that as soon as plugin activation happens for jdt.ls.core. See https://github.com/eclipse/eclipse.jdt.ls/blob/a1e091430705860a95456a7332a223d594025716/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/PreferenceManager.java#L160 . This change doesn't happen before that..
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.
It is called from
InitHandler.handleInitializationOptions(InitializeParams) > BaseInitHandler.handleInitializationOptions(InitializeParams) > PreferenceManager.update(Preferences)
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.
There is call to that as soon as plugin activation happens for jdt.ls.core.
This is not an issue because no project is imported at that moment.
You may set breakpoints at
- https://github.com/eclipse/buildship/blob/ffd54d4b45c9ac1c35b92def36ed9ff4696a861a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/preferences/DefaultModelPersistence.java#L190
- https://github.com/eclipse-jdt/eclipse.jdt.core/blob/0967ee64aa1d6c7dcec2e541dfd6ff11bda59eb0/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java#L3339
Fixes
Test vsix - VSCode 1.22.0