Classpath change events now contain classpath info
This commit is contained in:
@@ -5,11 +5,6 @@ import * as VSCode from 'vscode';
|
||||
import { LanguageClient, RequestType } from 'vscode-languageclient';
|
||||
|
||||
export function registerClasspathService(client : LanguageClient) : void {
|
||||
let classpathRequest = new RequestType<ClasspathParams, ClasspathResponse, void, void>("sts/classpath");
|
||||
|
||||
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) => {
|
||||
@@ -17,28 +12,9 @@ export function registerClasspathService(client : LanguageClient) : void {
|
||||
});
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
interface ClasspathParams {
|
||||
resourceUri: string
|
||||
}
|
||||
|
||||
interface ClasspathEntry {
|
||||
kind : string,
|
||||
path : string
|
||||
}
|
||||
Reference in New Issue
Block a user