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

Apply autobuilding setting when initializing. #3177

Merged

Conversation

ethan-vanderheijden
Copy link
Contributor

Fixes #3176

@eclipse-ls-bot
Copy link
Contributor

Can one of the admins verify this patch?

@snjeza snjeza self-requested a review June 4, 2024 15:38
ProjectsManager.setAutoBuilding(preferenceManager.getPreferences().isAutobuildEnabled());
} catch (CoreException e) {
JavaLanguageServerPlugin.logException("Failed apply autobuilding setting", e);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We disable auto building on

private static void prepareWorkspace() throws CoreException {

Instead of adding this code, you can remove LanguageServerApplication.prepareWorkspace().
AFAICS, it doesn't affect performance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I only remove LanguageServerApplication.prepareWorkspace(), then it is impossible to disable autobuild through initialization params. I'll still remove it because autobuild should be enabled by default unless configured otherwise.

Copy link
Contributor

@snjeza snjeza Jun 5, 2024

Choose a reason for hiding this comment

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

@rgrunber
Copy link
Contributor

rgrunber commented Jun 4, 2024

Wait, @snjeza is this actually ok ? I remember we intentionally disabled autobuild during import to avoid import/build conflicts, #2252 .

Update: It was introduced in #469 (comment) . Another discussion at #2519 .

@snjeza
Copy link
Contributor

snjeza commented Jun 4, 2024

Update: It was introduced in #469 (comment) . Another discussion at #2519 .

#2252 fixes it by interrupting the build. See


I think that we don't need to turn off auto-build anymore.
I have tried importing/reloading the quarkus-langchain4j and keycloak projects and didn't notice any performance degradation.

@ethan-vanderheijden ethan-vanderheijden force-pushed the set-autobuild-on-initialized branch from 9725dff to 9f2848d Compare June 5, 2024 02:26
@rgrunber
Copy link
Contributor

rgrunber commented Jun 5, 2024

Ok, if that's the case then I think we can consider doing this. CC'ing @testforstephen given that this would impact #2519 .

@rgrunber
Copy link
Contributor

rgrunber commented Jun 11, 2024

Overall, the change looks fine. I just had one thought. @snjeza / @ethan-vanderheijden , would the syntax server now have the autobuild running as part of the steps leading up to the finishing of initialization (after that didChangeConfiguration is triggered which would set the autobuild back to its expected value) ?

Before this change the autobuild was turned off inLanguageServerApplication, which would have included both syntax & standard servers. With this change, the autobuild is only interrupted (turned off) by InitHandler, which is only the standard server's implementation. Is there any harm in this (having it on temporarily for the syntax server) ?

@snjeza
Copy link
Contributor

snjeza commented Jun 11, 2024

Is there any harm in this (having it on temporarily for the syntax server) ?

Java LS sets the autobuilding to off for the syntax server. See

@rgrunber rgrunber merged commit f20d928 into eclipse-jdtls:master Jun 12, 2024
6 checks passed
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.

Autobuilding setting isn't applied until didChangeConfiguration is received.
4 participants