-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathjdtls.ts
More file actions
51 lines (41 loc) · 2.38 KB
/
Copy pathjdtls.ts
File metadata and controls
51 lines (41 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
import { CancellationToken, commands } from "vscode";
import { Commands, executeJavaLanguageServerCommand } from "../commands";
import { IClasspath } from "../tasks/buildArtifact/IStepMetadata";
import { IMainClassInfo } from "../tasks/buildArtifact/ResolveMainClassExecutor";
import { INodeData } from "./nodeData";
export namespace Jdtls {
export async function getProjects(params: string): Promise<INodeData[]> {
return await commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, Commands.JAVA_PROJECT_LIST, params) || [];
}
export async function getProjectUris(): Promise<string[]> {
return await commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, Commands.GET_ALL_PROJECTS) || [];
}
export async function refreshLibraries(params: string): Promise<boolean | undefined> {
return commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, Commands.JAVA_PROJECT_REFRESH_LIB_SERVER, params);
}
export async function getPackageData(params: { [key: string]: any }): Promise<INodeData[]> {
return await commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, Commands.JAVA_GETPACKAGEDATA, params) || [];
}
export async function resolvePath(params: string): Promise<INodeData[]> {
return await commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, Commands.JAVA_RESOLVEPATH, params) || [];
}
export async function getMainClasses(params: string): Promise<IMainClassInfo[]> {
return await commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, Commands.JAVA_PROJECT_GETMAINCLASSES, params) || [];
}
export async function exportJar(mainClass: string, classpaths: IClasspath[],
destination: string, terminalId: string, token: CancellationToken): Promise<boolean | undefined> {
return commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, Commands.JAVA_PROJECT_GENERATEJAR,
mainClass, classpaths, destination, terminalId, token);
}
export enum CompileWorkspaceStatus {
Failed = 0,
Succeed = 1,
Witherror = 2,
Cancelled = 3,
}
export function resolveBuildFiles(): Promise<string[]> {
return <Promise<string[]>>executeJavaLanguageServerCommand(Commands.JAVA_RESOLVE_BUILD_FILES);
}
}