Skip to content
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

Java LS sometimes hangs while loading a gradle project #1874

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Sep 13, 2021

Fixes redhat-developer/vscode-java#2088

The issue happens when BuildSupportManager.obtainBuildSupports starts the m2e and buildship plugins that sometimes freezes the workspace.
A stack trace: redhat-developer/vscode-java#2088 (comment) and https://gist.github.com/snjeza/b02b8461499cf025a9b664442dd51ede

A solution is to start these plugins separately before initializing Java LS.

Signed-off-by: Snjezana Peco snjezana.peco@redhat.com

@snjeza
Copy link
Contributor Author

snjeza commented Sep 13, 2021

test this please

Comment on lines 221 to 228
try {
long start = System.currentTimeMillis();
JavaLanguageServerPlugin.logInfo("Starting " + IMavenConstants.PLUGIN_ID);
Platform.getBundle(IMavenConstants.PLUGIN_ID).start(Bundle.START_TRANSIENT);
JavaLanguageServerPlugin.logInfo("Started " + IMavenConstants.PLUGIN_ID + " " + (System.currentTimeMillis() - start) + "ms");
} catch (BundleException e) {
logException(e.getMessage(), e);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code block can be extracted to a common method for reuse. e.g. void startBundle(String bundleName)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
@snjeza
Copy link
Contributor Author

snjeza commented Sep 14, 2021

test this please

@rgrunber rgrunber added this to the Mid September 2021 milestone Sep 15, 2021
@snjeza snjeza merged commit 0b3651f into eclipse-jdtls:master Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Java LS sometimes hangs while loading a gradle project
3 participants