Outline with JDT LS LightWeight mode

This commit is contained in:
BoykoAlex
2021-05-28 15:16:17 -04:00
parent 0885718b31
commit b2ebc43bc0
8 changed files with 75 additions and 1779 deletions

View File

@@ -4,11 +4,17 @@
import * as VSCode from 'vscode';
import { RequestType } from 'vscode-languageclient';
import { LanguageClient } from 'vscode-languageclient/node';
import { workspace } from 'vscode';
export function registerClasspathService(client : LanguageClient) : void {
let addRequest = new RequestType<ClasspathListenerParams, ClasspathListenerResponse, void>("sts/addClasspathListener");
client.onRequest(addRequest, async (params: ClasspathListenerParams) => {
const jdtConfig = workspace.getConfiguration('java')
const launchMode = jdtConfig?.get('server.launchMode');
if (launchMode === 'LightWeight') {
throw new Error('Classpath listener not supported while Java Language Server is in LightWeight mode');
}
return <ClasspathListenerResponse> await VSCode.commands.executeCommand("java.execute.workspaceCommand", "sts.java.addClasspathListener", params.callbackCommandId);
});