Skip to content

Commit

Permalink
Merge pull request #63 from Achal1607/javavscode-60
Browse files Browse the repository at this point in the history
[JAVAVSCODE-60] Added a configuration for user-defined vm arguments to start the Java language server
  • Loading branch information
arvindaprameya authored Nov 9, 2023
2 parents 707ef2d + b860d07 commit 2c1e0b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@
"default": "",
"description": "VM options"
},
"jdk.serverVmOptions": {
"type": "array",
"default": [],
"description": "Specifies extra VM arguments used to launch the Java Language Server",
"scope": "machine-overridable"
},
"jdk.runConfig.env": {
"type": "string",
"default": "",
Expand Down
2 changes: 2 additions & 0 deletions vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex
if (isDarkColorTheme()) {
extras.push('--laf', 'com.formdev.flatlaf.FlatDarkLaf');
}
let serverVmOptions: string[] = workspace.getConfiguration('jdk').get("serverVmOptions",[]);
extras.push(...serverVmOptions.map(el => `-J${el}`));
let p = launcher.launch(info, ...extras);
handleLog(log, "LSP server launching: " + p.pid);
handleLog(log, "LSP server user directory: " + userdir);
Expand Down

0 comments on commit 2c1e0b8

Please sign in to comment.