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 runtimes should be configured before projects are imported #1474

Closed
fbricon opened this issue Jun 9, 2020 · 0 comments · Fixed by #1475
Closed

Java runtimes should be configured before projects are imported #1474

fbricon opened this issue Jun 9, 2020 · 0 comments · Fixed by #1475

Comments

@fbricon
Copy link
Contributor

fbricon commented Jun 9, 2020

When you import projects, a didChangeConfiguration request triggers Java Runtime changes, that in turn triggers a full rebuild of the workspace.

I think we could improve the situation in BaseInitHandler.initialize, where we could do something like:

if (initializationOptions.get(SETTINGS_KEY) instanceof Map) {
  Object settings = initializationOptions.get(SETTINGS_KEY);
  @SuppressWarnings("unchecked")
  Preferences prefs = Preferences.createFrom((Map<String, Object>) settings);
  prefs.setRootPaths(rootPaths);
  preferenceManager.update(prefs);
  if (firstTimeWorkspaceIsOpened) {
    // We don't care about triggering a full build here, like in onDidChangeConfiguration
    try {
      JVMConfigurator.configureJVMs(prefs);
    } catch (CoreException e) {
      logException("Failed to configure Java Runtimes", e);
    }
  }
  logInfo("Updated preferences from initialization options");
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants