Trying to improve the 'cleanup' of classpath listeners
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user