Trying to improve the 'cleanup' of classpath listeners

This commit is contained in:
Kris De Volder
2018-03-20 17:23:35 -07:00
parent f737f06228
commit 7482c26ccb
5 changed files with 26 additions and 10 deletions

View File

@@ -6,10 +6,16 @@ import { LanguageClient, RequestType } from 'vscode-languageclient';
export function registerClasspathService(client : LanguageClient) : void {
let classpathListenerRequest = new RequestType<ClasspathListenerParams, ClasspathListenerResponse, void, void>("sts/addClasspathListener");
client.onRequest(classpathListenerRequest, async (params: ClasspathListenerParams) => {
let addRequest = new RequestType<ClasspathListenerParams, ClasspathListenerResponse, void, void>("sts/addClasspathListener");
client.onRequest(addRequest, async (params: ClasspathListenerParams) => {
return <ClasspathListenerResponse> await VSCode.commands.executeCommand("java.execute.workspaceCommand", "sts.java.addClasspathListener", params.callbackCommandId);
});
let removeRequest = new RequestType<ClasspathListenerParams, ClasspathListenerResponse, void, void>("sts/removeClasspathListener");
client.onRequest(removeRequest, async (params: ClasspathListenerParams) => {
return <ClasspathListenerResponse> await VSCode.commands.executeCommand("java.execute.workspaceCommand", "sts.java.removeClasspathListener", params.callbackCommandId);
});
}
interface ClasspathListenerParams {

View File

@@ -20,7 +20,7 @@ const JAVA_LANGUAGE_ID = "java";
export function activate(context: VSCode.ExtensionContext) {
let options : commons.ActivatorOptions = {
DEBUG: false,
CONNECT_TO_LS: false,
CONNECT_TO_LS: true,
extensionId: 'vscode-spring-boot',
preferJdk: true,
checkjvm: (context: VSCode.ExtensionContext, jvm: commons.JVM) => {