diff --git a/atom-extensions/atom-spring-boot/package.json b/atom-extensions/atom-spring-boot/package.json index 889da885c..5247c479d 100644 --- a/atom-extensions/atom-spring-boot/package.json +++ b/atom-extensions/atom-spring-boot/package.json @@ -25,6 +25,11 @@ "default": true, "description": "Enable/Disable Spring running Boot application live hints decorators in the source code" }, + "support-spring-xml-config.on": { + "type": "boolean", + "default": false, + "description": "Enable/Disable Support for Spring XML Config files" + }, "change-detection.on": { "type": "boolean", "default": false, diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/BootLanguageServerPreferencesPage.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/BootLanguageServerPreferencesPage.java index 8b253d127..aa4f7b1ad 100644 --- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/BootLanguageServerPreferencesPage.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/BootLanguageServerPreferencesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2018 Pivotal, Inc. + * Copyright (c) 2017, 2019 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -93,21 +93,18 @@ public class BootLanguageServerPreferencesPage extends FieldEditorPreferencePage gd.grabExcessHorizontalSpace = false; l.setLayoutData(gd); - BooleanFieldEditor liveHintsPrefEditor = new BooleanFieldEditor(Constants.PREF_BOOT_HINTS, "Live Boot Hint Decorators", parent); - addField(liveHintsPrefEditor); - final IPreferenceStore commonsLsPrefs = LanguageServerCommonsActivator.getInstance().getPreferenceStore(); - addField(new BooleanFieldEditor(PreferenceConstants.HIGHLIGHT_CODELENS_PREFS, "Highlights CodeLens (Experimental)", parent) { + addField(new BooleanFieldEditor(Constants.PREF_BOOT_HINTS, "Live Boot Hint Decorators", parent)); + addField(new BooleanFieldEditor(PreferenceConstants.HIGHLIGHT_CODELENS_PREFS, "Highlights CodeLens (experimental)", parent) { @Override public IPreferenceStore getPreferenceStore() { return commonsLsPrefs; } - }); - BooleanFieldEditor liveChangeDetectionPrefEditor = new BooleanFieldEditor(Constants.PREF_CHANGE_DETECTION, "Live Boot Change Detection", parent); - addField(liveChangeDetectionPrefEditor); + addField(new BooleanFieldEditor(Constants.PREF_SUPPORT_SPRING_XML_CONFIGS, "Support Spring XML Config files (experimental)", parent)); + addField(new BooleanFieldEditor(Constants.PREF_CHANGE_DETECTION, "Live Boot Change Detection", parent)); l = new Label(parent, SWT.NONE); gd = new GridData(GridData.FILL_HORIZONTAL); diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/Constants.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/Constants.java index 8d954f64e..8d7c3d5dc 100644 --- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/Constants.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/Constants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2018 Pivotal, Inc. + * Copyright (c) 2017, 2019 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,6 +19,7 @@ public class Constants { public static final String LANGUAGE_SERVER_VERSION = "1.2.1-SNAPSHOT.jar"; public static final String PREF_BOOT_HINTS = "boot-java.boot-hints.on"; + public static final String PREF_SUPPORT_SPRING_XML_CONFIGS = "boot-java.support-spring-xml-config.on"; public static final String PREF_CHANGE_DETECTION = "boot-java.change-detection.on"; } diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/DelegatingStreamConnectionProvider.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/DelegatingStreamConnectionProvider.java index 460408daf..60e5da12d 100644 --- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/DelegatingStreamConnectionProvider.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/DelegatingStreamConnectionProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2018 Pivotal, Inc. + * Copyright (c) 2017, 2019 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -159,14 +159,17 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi Map settings = new HashMap<>(); Map bootJavaObj = new HashMap<>(); Map bootHint = new HashMap<>(); + Map supportXML = new HashMap<>(); Map bootChangeDetection = new HashMap<>(); bootHint.put("on", BootLanguageServerPlugin.getDefault().getPreferenceStore().getBoolean(Constants.PREF_BOOT_HINTS)); + supportXML.put("on", BootLanguageServerPlugin.getDefault().getPreferenceStore().getBoolean(Constants.PREF_SUPPORT_SPRING_XML_CONFIGS)); bootChangeDetection.put("on", BootLanguageServerPlugin.getDefault().getPreferenceStore().getBoolean(Constants.PREF_CHANGE_DETECTION)); bootJavaObj.put("boot-hints", bootHint); + bootJavaObj.put("support-spring-xml-config", supportXML); bootJavaObj.put("change-detection", bootChangeDetection); - ImmutableSet> remoteApps = BootLanguageServerPlugin.getRemoteBootApps().getValues(); + bootJavaObj.put("remote-apps", BootLanguageServerPlugin.getRemoteBootApps().getValues() .stream() .map(pair -> new RemoteBootAppData(pair.getLeft(), pair.getRight())) diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/PrefsInitializer.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/PrefsInitializer.java index cb8fdaa5e..602dac552 100644 --- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/PrefsInitializer.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/PrefsInitializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2018 Pivotal, Inc. + * Copyright (c) 2017, 2019 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -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_SUPPORT_SPRING_XML_CONFIGS, false); BootLanguageServerPlugin.getDefault().getPreferenceStore().setDefault(Constants.PREF_CHANGE_DETECTION, false); } diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/BootJavaConfig.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/BootJavaConfig.java index cadc1e840..42de38b6b 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/BootJavaConfig.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/BootJavaConfig.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2018 Pivotal, Inc. + * Copyright (c) 2017, 2019 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,6 +27,11 @@ public class BootJavaConfig { return enabled == null || enabled.booleanValue(); } + public boolean isSpringXMLSupportEnabled() { + Boolean enabled = settings.getBoolean("boot-java", "support-spring-xml-config", "on"); + return enabled != null && enabled.booleanValue(); + } + public boolean isChangeDetectionEnabled() { Boolean enabled = settings.getBoolean("boot-java", "change-detection", "on"); return enabled != null && enabled.booleanValue(); diff --git a/theia-extensions/theia-spring-boot/spring-boot/src/browser/boot-preferences.ts b/theia-extensions/theia-spring-boot/spring-boot/src/browser/boot-preferences.ts index 2af4b780f..7c9345618 100644 --- a/theia-extensions/theia-spring-boot/spring-boot/src/browser/boot-preferences.ts +++ b/theia-extensions/theia-spring-boot/spring-boot/src/browser/boot-preferences.ts @@ -4,6 +4,7 @@ import { createPreferenceProxy, PreferenceProxy, PreferenceService, PreferenceCo // tslint:disable:max-line-length export const HIGHLIGHTS_PREF_NAME = 'boot-java.boot-hints.on'; +export const XML_SUPPORT_PREF_NAME = 'boot-java.support-spring-xml-config.on'; export const CODELENS_PREF_NAME = 'boot-java.highlight-codelens.on'; export const BootConfigSchema: PreferenceSchema = { @@ -15,6 +16,11 @@ export const BootConfigSchema: PreferenceSchema = { description: 'Enable/Disable Spring running Boot application live hints decorators in Java source code.', default: true }, + 'boot-java.support-spring-xml-config.on': { + type: 'boolean', + description: 'Enable/Disable Support for Spring XML Config files', + default: false + }, 'boot-java.change-detection.on': { type: 'boolean', description: 'Enable/Disable detecting changes of running Spring Boot applications.', @@ -30,6 +36,7 @@ export const BootConfigSchema: PreferenceSchema = { export interface BootConfiguration { 'boot-java.boot-hints.on': boolean; + 'boot-java.support-spring-xml-config.on': boolean; 'boot-java.change-detection.on': boolean; 'boot-java.highlight-codelens.on': boolean; } diff --git a/vscode-extensions/vscode-spring-boot/package.json b/vscode-extensions/vscode-spring-boot/package.json index c649dffb5..f75e7a6f1 100644 --- a/vscode-extensions/vscode-spring-boot/package.json +++ b/vscode-extensions/vscode-spring-boot/package.json @@ -68,6 +68,11 @@ "default": true, "description": "Enable/Disable Spring running Boot application live hints decorators in Java source code" }, + "boot-java.support-spring-xml-config.on": { + "type": "boolean", + "default": false, + "description": "Enable/Disable Support for Spring XML Config files" + }, "boot-java.highlight-codelens.on": { "type": "boolean", "default": true,