added config options for change detection mechanism and changed default to disabled

This commit is contained in:
Martin Lippert
2018-06-19 10:02:52 +02:00
parent 71bebf307a
commit 954f65de4d
6 changed files with 35 additions and 25 deletions

View File

@@ -34,8 +34,11 @@ public class BootLanguageServerPreferencesPage extends FieldEditorPreferencePage
@Override
protected void createFieldEditors() {
BooleanFieldEditor editor = new BooleanFieldEditor(Constants.PREF_BOOT_HINTS, "Live Boot Hint Decorators", getFieldEditorParent());
addField(editor);
BooleanFieldEditor liveHintsPrefEditor = new BooleanFieldEditor(Constants.PREF_BOOT_HINTS, "Live Boot Hint Decorators", getFieldEditorParent());
addField(liveHintsPrefEditor);
BooleanFieldEditor liveChangeDetectionPrefEditor = new BooleanFieldEditor(Constants.PREF_CHANGE_DETECTION, "Live Boot Change Detection", getFieldEditorParent());
addField(liveChangeDetectionPrefEditor);
}
}

View File

@@ -19,5 +19,6 @@ public class Constants {
public static final String LANGUAGE_SERVER_VERSION = "0.3.2-SNAPSHOT.jar";
public static final String PREF_BOOT_HINTS = "boot-java.boot-hints.on";
public static final String PREF_CHANGE_DETECTION = "boot-java.change-detection.on";
}

View File

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

View File

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