From 6868b6b6383200a9ce1a2c392339527b7cf9afb7 Mon Sep 17 00:00:00 2001 From: Snjezana Peco Date: Thu, 13 Jul 2023 22:25:47 +0200 Subject: [PATCH] Unable to acquire the state change lock for the module 'buildship' Signed-off-by: Snjezana Peco --- .../ls/core/internal/handlers/InitHandler.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/InitHandler.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/InitHandler.java index bf3bcad04b..0d39fe47a5 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/InitHandler.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/InitHandler.java @@ -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 + // load maven plugin https://github.com/redhat-developer/vscode-java/issues/2088 + startBundle(IMavenConstants.PLUGIN_ID); + long start = System.currentTimeMillis(); + JobHelpers.waitForProjectRegistryRefreshJob(); + JavaLanguageServerPlugin.logInfo("ProjectRegistryRefreshJob finished " + (System.currentTimeMillis() - start) + "ms"); + // load gradle plugin https://github.com/redhat-developer/vscode-java/issues/2088 + startBundle(CorePlugin.PLUGIN_ID); Map initializationOptions = super.handleInitializationOptions(param); try { @@ -218,13 +227,6 @@ public void registerCapabilities(InitializeResult initializeResult) { @Override public void triggerInitialization(Collection roots) { - // load maven plugin https://github.com/redhat-developer/vscode-java/issues/2088 - startBundle(IMavenConstants.PLUGIN_ID); - long start = System.currentTimeMillis(); - JobHelpers.waitForProjectRegistryRefreshJob(); - JavaLanguageServerPlugin.logInfo("ProjectRegistryRefreshJob finished " + (System.currentTimeMillis() - start) + "ms"); - // load gradle plugin https://github.com/redhat-developer/vscode-java/issues/2088 - startBundle(CorePlugin.PLUGIN_ID); // https://github.com/redhat-developer/vscode-java/issues/2763 // When starting, Java LS turn off autobuild. See JavaLanguageServerPlugin.start(BundleContext). // In this case Eclipse schedules the AutoBuildJobOff job. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=573595#c11