Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@
"description": "Specifies the JDK on which user's project will be run. Defaults to the value of netbeans.jdkhome",
"scope": "machine-overridable"
},
"netbeans.serverVmOptions": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Additional VM options for the NetBeans Language Server (e.g. [\"-Xmx4g\"])"
},
"netbeans.verbose": {
"type": "boolean",
"default": false,
Expand Down
7 changes: 5 additions & 2 deletions vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1292,12 +1292,15 @@ function doActivateWithJDK(promise: Promise<NbLanguageClient>, specifiedJDK: str
// assume storage is path on disk
}

let info = {
let serverVmOptions = workspace.getConfiguration('netbeans').get('serverVmOptions') as string[] | undefined;

let info: launcher.LaunchInfo = {
clusters : findClusters(context.extensionPath),
extensionPath: context.extensionPath,
storagePath : userdir,
jdkHome : specifiedJDK,
verbose: beVerbose
verbose: beVerbose,
serverVmOptions: serverVmOptions
};
let launchMsg = `Launching Apache NetBeans Language Server with ${specifiedJDK ? specifiedJDK : 'default system JDK'} and userdir ${userdir}`;
handleLog(log, launchMsg);
Expand Down
10 changes: 10 additions & 0 deletions vscode/src/nbcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface LaunchInfo {
storagePath: string;
jdkHome: string | unknown;
verbose? : boolean;
serverVmOptions?: string[];
}

function find(info: LaunchInfo): string {
Expand Down Expand Up @@ -77,6 +78,15 @@ export function launch(
if (env['netbeans_debug'] && extraArgs && extraArgs.find(s => s.includes("--list"))) {
ideArgs.push(...['-J-Dnetbeans.logger.console=true', '-J-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000']);
}
if (info.serverVmOptions && Array.isArray(info.serverVmOptions)) {
for (let opt of info.serverVmOptions) {
if (!opt.startsWith('-J')) {
ideArgs.push('-J' + opt);
} else {
ideArgs.push(opt);
}
}
}

console.log(`Launching NBLS with arguments: ` + ideArgs);

Expand Down