first cut for strict project matching mode to ensure live hovers are detected and shown only for relevant projects

This commit is contained in:
Martin Lippert
2018-07-11 16:40:18 +02:00
parent 20ff5f406a
commit d7fc10794c
17 changed files with 188 additions and 38 deletions

View File

@@ -39,6 +39,9 @@ public class BootLanguageServerPreferencesPage extends FieldEditorPreferencePage
BooleanFieldEditor liveChangeDetectionPrefEditor = new BooleanFieldEditor(Constants.PREF_CHANGE_DETECTION, "Live Boot Change Detection", getFieldEditorParent());
addField(liveChangeDetectionPrefEditor);
BooleanFieldEditor strictProjectMatchingPrefEditor = new BooleanFieldEditor(Constants.PREF_STRICT_PROJECT_MATCH, "Use restrictive mechanism to match live running boot apps automatically with projects in your workspace", getFieldEditorParent());
addField(strictProjectMatchingPrefEditor);
}
}

View File

@@ -20,5 +20,6 @@ public class Constants {
public static final String PREF_BOOT_HINTS = "boot-java.boot-hints.on";
public static final String PREF_CHANGE_DETECTION = "boot-java.change-detection.on";
public static final String PREF_STRICT_PROJECT_MATCH = "boot-java.strict-project-matching.on";
}

View File

@@ -125,13 +125,18 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
Map<String, Object> bootJavaObj = new HashMap<>();
Map<String, Object> bootHint = new HashMap<>();
Map<String, Object> bootChangeDetection = new HashMap<>();
Map<String, Object> bootStrictProjectMatching = new HashMap<>();
bootHint.put("on", BootLanguageServerPlugin.getDefault().getPreferenceStore().getBoolean(Constants.PREF_BOOT_HINTS));
bootChangeDetection.put("on", BootLanguageServerPlugin.getDefault().getPreferenceStore().getBoolean(Constants.PREF_CHANGE_DETECTION));
bootStrictProjectMatching.put("on", BootLanguageServerPlugin.getDefault().getPreferenceStore().getBoolean(Constants.PREF_STRICT_PROJECT_MATCH));
bootJavaObj.put("boot-hints", bootHint);
bootJavaObj.put("change-detection", bootChangeDetection);
bootJavaObj.put("strict-project-matching", bootStrictProjectMatching);
settings.put("boot-java", bootJavaObj);
this.languageServer.getWorkspaceService().didChangeConfiguration(new DidChangeConfigurationParams(settings));
}

View File

@@ -27,6 +27,7 @@ public class PrefsInitializer extends AbstractPreferenceInitializer {
public void initializeDefaultPreferences() {
BootLanguageServerPlugin.getDefault().getPreferenceStore().setDefault(Constants.PREF_BOOT_HINTS, true);
BootLanguageServerPlugin.getDefault().getPreferenceStore().setDefault(Constants.PREF_CHANGE_DETECTION, false);
BootLanguageServerPlugin.getDefault().getPreferenceStore().setDefault(Constants.PREF_STRICT_PROJECT_MATCH, false);
}
}