From 88541f6010b945826799601c13dfc9033de0f34d Mon Sep 17 00:00:00 2001 From: aboyko Date: Wed, 7 Dec 2022 18:27:07 -0500 Subject: [PATCH] Enable Classpath listener when Boot LS is started via command --- vscode-extensions/vscode-spring-boot/lib/Main.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vscode-extensions/vscode-spring-boot/lib/Main.ts b/vscode-extensions/vscode-spring-boot/lib/Main.ts index cad5fd0d9..eac6739cf 100644 --- a/vscode-extensions/vscode-spring-boot/lib/Main.ts +++ b/vscode-extensions/vscode-spring-boot/lib/Main.ts @@ -114,7 +114,7 @@ export function activate(context: VSCode.ExtensionContext): Thenable ({ workspaceFolders: workspace.workspaceFolders ? workspace.workspaceFolders.map(f => f.uri.toString()) : null, - enableJdtClasspath: VSCode.extensions.getExtension('redhat.java')?.exports?.serverMode === 'Standard' + enableJdtClasspath: true }) }, highlightCodeLensSettingKey: 'boot-java.highlight-codelens.on' @@ -125,6 +125,12 @@ export function activate(context: VSCode.ExtensionContext): Thenable { VSCode.commands.registerCommand('vscode-spring-boot.ls.start', () => client.start().then(() => { + // Boot LS is fully started + + // Force classpath listener to be enabled. Boot LS can only be launched iff classpath is available and there Spring-Boot on the classpath somewhere. + VSCode.commands.executeCommand('sts.vscode-spring-boot.enableClasspathListening', true); + + // Ask user to enable Boot java source reconciling feature if disabled if (VSCode.workspace.getConfiguration().get(RECONCILING_PROMPT_PREF_KEY) && !VSCode.workspace.getConfiguration().get(RECONCILING_PREF_KEY)) { VSCode.window.showInformationMessage('Do you wish to enable additional Java sources reconciling to get Spring specific validations and suggestions?', YES, NO, NEVER_SHOW_AGAIN).then(answer => { switch (answer) {