Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit 4193945

Browse files
committed
Configurable heap size.
1 parent e5f6b94 commit 4193945

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,6 @@ You should use `sbt publishLocal` which publishes the server under `~/.ivy2/loca
5858

5959
You can open code inside the `scala/` directory and use `F5` to debug the extension. This picks up the changes in the server (make sure you published it locally using `sbt publishLocal`!) and allows quick iteration.
6060

61-
## Settings
62-
63-
If VSCode is running behind a proxy add the following standard VSCode proxy settings (File -> Preferences -> Settings):
64-
65-
{
66-
"http.proxy": "http://host:port/"
67-
}
68-
69-
This setting is translated as Coursier's vm arguments: -Dhttp.proxyHost=host -Dhttps.proxyHost=host -Dhttp.proxyPort=port -Dhttps.proxyPort=port.
70-
71-
Log level settting:
72-
{
73-
"scalaLanguageServer.logLevel" : "DEBUG"
74-
}
75-
76-
This setting is passed to the Language Server affecting the log level on the server, possible values "DEBUG", "ERROR", "INFO", "WARN"
77-
7861

7962
# Publish
8063

scala/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 0.2.2
44

5+
- Configurable heap size for the language server (default 768M instead of 4G)
56
- Bumped Ensime Server to release 2.0.0
67
- Bumped Ensime SBT to release 2.0.1
78
- Fix for parts of #36 and #37 (Hover tooltip on local vals).

scala/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,26 @@ The path to the Java Development Kit is searched in the following order:
2727
- the `JDK_HOME` environment variable
2828
- the `JAVA_HOME` environment variable
2929
- on the current system path
30+
31+
# Configuration
32+
33+
If VSCode is running behind a proxy add the following standard VSCode proxy settings (File -> Preferences -> Settings):
34+
35+
```
36+
{
37+
"http.proxy": "http://host:port/"
38+
}
39+
```
40+
41+
This setting is translated as Coursier's vm arguments: -Dhttp.proxyHost=host -Dhttps.proxyHost=host -Dhttp.proxyPort=port -Dhttps.proxyPort=port.
42+
43+
Language server setttings:
44+
45+
```
46+
{
47+
"scalaLanguageServer.logLevel" : "DEBUG"
48+
"scalaLanguageServer.heapSize" : "768M"
49+
}
50+
```
51+
52+
These settings are passed to the Language Server affecting the log level on the server, with possible values "DEBUG", "ERROR", "INFO", "WARN". The heap size used by the Scala language server, for example `512m` or `4G`, can also be configured. By default it will use 768M, which is probably insufficient for larger projects.

scala/src/extension.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,21 @@ export async function activate(context: ExtensionContext) {
4747
} else proxyArgs = []
4848
let logLevel = workspace.getConfiguration().get('scalaLanguageServer.logLevel')
4949
let logLevelStr = ''
50-
if(logLevel != null) logLevelStr = logLevel.toString()
50+
if (logLevel != null) logLevelStr = logLevel.toString()
51+
52+
let heapSize = workspace.getConfiguration().get('scalaLanguageServer.heapSize')
53+
let heapSizeStr = '-Xmx768M'
54+
if (heapSize != null) heapSizeStr = '-Xmx' + heapSize.toString()
5155

5256
let coursierArgs = ['launch', '-r', 'https://dl.bintray.com/dhpcs/maven', '-r', 'sonatype:releases', '-J', toolsJar, 'com.github.dragos:ensime-lsp_2.12:0.2.1', '-M', 'org.github.dragos.vscode.Main'];
53-
let javaArgs = proxyArgs.concat(['-Dvscode.workspace=' + workspace.rootPath,'-Dvscode.logLevel=' + logLevel, '-jar', coursierPath]).concat(coursierArgs);
57+
58+
let javaArgs = proxyArgs.concat([
59+
heapSizeStr,
60+
'-Dvscode.workspace=' + workspace.rootPath,
61+
'-Dvscode.logLevel=' + logLevel,
62+
'-jar', coursierPath
63+
]).concat(coursierArgs);
64+
5465
// The debug options for the server
5566
let debugOptions = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000,quiet=y'];
5667

0 commit comments

Comments
 (0)