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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ The following settings are supported:
* `java.home` : **Deprecated, please use 'java.jdt.ls.java.home' instead.** Absolute path to JDK home folder used to launch the Java Language Server. Requires VS Code restart.
* `java.jdt.ls.lombokSupport.enabled`: Whether to enable lombok support. Defaults to `true`.
* `java.jdt.ls.vmargs` : Extra VM arguments used to launch the Java Language Server. Requires VS Code restart.
* `java.jdt.ls.mavenProjectCacheSize`: Specifies the size of the in-memory Maven project cache to use. Increasing the project cache size will help load multi-module projects and monorepos faster, but will result in a significant increase in memory usage.
* `java.errors.incompleteClasspath.severity` : Specifies the severity of the message when the classpath is incomplete for a Java file. Supported values are `ignore`, `info`, `warning`, `error`.
* `java.trace.server` : Traces the communication between VS Code and the Java language server.
* `java.configuration.updateBuildConfiguration` : Specifies how modifications on build files update the Java classpath/configuration. Supported values are `disabled` (nothing happens), `interactive` (asks about updating on every modification), `automatic` (updating is automatically triggered).
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,16 @@
"scope": "machine-overridable",
"order": 20
},
"java.jdt.ls.mavenProjectCacheSize": {
"type": [
"integer"
],
"minimum": 1,
"default": 50,
"description": "Specifies the size of the in-memory Maven project cache to use. Increasing the project cache size will help load multi-module projects and monorepos faster, but will result in a significant increase in memory usage.",
"scope": "machine-overridable",
"order": 20
},
"java.server.launchMode": {
"type": "string",
"enum": [
Expand Down
6 changes: 6 additions & 0 deletions src/javaServerStarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ function prepareParams(requirements: RequirementsData, workspacePath, context: E
} else {
vmargs = '';
}
if (vmargs.indexOf('-Dm2e.project.cache.size') < 0) {
const mavenProjectCacheSize = workspace.getConfiguration().get('java.jdt.ls.mavenProjectCacheSize');
if (mavenProjectCacheSize !== undefined && Number(mavenProjectCacheSize) > 0) {
params.push(`-Dm2e.project.cache.size=${mavenProjectCacheSize}`);
}
}
if (vmargs.indexOf('-DDetectVMInstallationsJob.disabled=') < 0) {
params.push('-DDetectVMInstallationsJob.disabled=true');
}
Expand Down
Loading