Make jvm heap size in vscode-concourse language server configurable by user
This commit is contained in:
@@ -33,12 +33,25 @@ export interface ActivatorOptions {
|
||||
clientOptions: LanguageClientOptions;
|
||||
launcher: (context: VSCode.ExtensionContext) => string;
|
||||
jvmHeap?: string;
|
||||
workspaceOptions?: VSCode.WorkspaceConfiguration;
|
||||
classpath?: (context: VSCode.ExtensionContext, javaVersion: number) => string[];
|
||||
}
|
||||
|
||||
type JavaOptions = {
|
||||
heap?: string
|
||||
}
|
||||
|
||||
function getUserDefinedJvmHeap(wsOpts : VSCode.WorkspaceConfiguration, dflt : string) : string {
|
||||
if (!wsOpts) {
|
||||
return dflt;
|
||||
}
|
||||
let javaOptions : JavaOptions = wsOpts.get("java");
|
||||
return javaOptions.heap || dflt;
|
||||
}
|
||||
|
||||
export function activate(options: ActivatorOptions, context: VSCode.ExtensionContext): Promise<LanguageClient> {
|
||||
let DEBUG = options.DEBUG;
|
||||
let jvmHeap = options.jvmHeap;
|
||||
let jvmHeap = getUserDefinedJvmHeap(options.workspaceOptions, options.jvmHeap);
|
||||
if (options.CONNECT_TO_LS) {
|
||||
return connectToLS(context, options);
|
||||
} else {
|
||||
|
||||
@@ -36,6 +36,7 @@ export function activate(context: VSCode.ExtensionContext) {
|
||||
extensionId: 'vscode-concourse',
|
||||
launcher: (context: VSCode.ExtensionContext) => Path.resolve(context.extensionPath, 'jars/language-server.jar'),
|
||||
jvmHeap: "48m",
|
||||
workspaceOptions: VSCode.workspace.getConfiguration("concourse.ls"),
|
||||
clientOptions: {
|
||||
documentSelector: [ PIPELINE_LANGUAGE_ID, TASK_LANGUAGE_ID ]
|
||||
}
|
||||
|
||||
@@ -28,6 +28,16 @@
|
||||
"onLanguage:concourse-task-yaml"
|
||||
],
|
||||
"contributes": {
|
||||
"configuration": {
|
||||
"type" : "object",
|
||||
"title": "Concourse Language Server Options",
|
||||
"properties": {
|
||||
"concourse.ls.java.heap": {
|
||||
"type": ["string", "null"],
|
||||
"description" : "Passed as an `-Xmx` argument to the concourse language server process"
|
||||
}
|
||||
}
|
||||
},
|
||||
"languages": [
|
||||
{
|
||||
"id": "concourse-pipeline-yaml",
|
||||
|
||||
Reference in New Issue
Block a user