Partial implementation of 'jdt.ls.addClasspatListener' support

This commit is contained in:
Kris De Volder
2018-03-15 08:56:18 -07:00
parent 285e4fe811
commit fcb4473025
6 changed files with 134 additions and 18 deletions

View File

@@ -10,12 +10,25 @@ export function registerClasspathService(client : LanguageClient) : void {
client.onRequest(classpathRequest, async (params: ClasspathParams) => {
return await executeClasspathCommand(params.resourceUri);
});
let classpathListenerRequest = new RequestType<ClasspathListenerParams, ClasspathListenerResponse, void, void>("sts/addClasspathListener");
client.onRequest(classpathListenerRequest, async (params: ClasspathListenerParams) => {
return <ClasspathListenerResponse> await VSCode.commands.executeCommand("java.execute.workspaceCommand", "sts.java.addClasspathListener", params.callbackCommandId);
});
}
async function executeClasspathCommand(resourceUri : string) : Promise<ClasspathResponse> {
return <ClasspathResponse> (await VSCode.commands.executeCommand("java.execute.workspaceCommand", "sts.java.resolveClasspath", resourceUri));
}
interface ClasspathListenerParams {
callbackCommandId: string
}
interface ClasspathListenerResponse {
}
interface ClasspathResponse {
entries: ClasspathEntry[],
defaultOutputFolder : string