Skip to content

Commit 10ac7d4

Browse files
committed
Add vmargs setting for qute-ls, disable JVM logging
Closes #548 Signed-off-by: David Thompson <[email protected]>
1 parent 4137285 commit 10ac7d4

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

docs/qute/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@
99

1010
## Settings
1111

12+
* `qute.server.vmargs`: Set the arguments to pass to the JVM while launching qute-ls. Default is `-Xmx100M -XX:+UseG1GC -XX:+UseStringDeduplication -Xlog:disable`
1213
* `qute.trace.server`: Trace the communication between VS Code and the Qute language server in the Output view. Default is `off`.
1314
* `qute.native.enabled`: Enable/disable Qute validation/completion for native image mode. Default is `false`.
1415
* `qute.codeLens.enabled`: Enable/disable Qute CodeLens. Default is `true`.
1516
* `qute.inlayHint.enabled`: Enable/disable Inlay Hint. Default is `true`.
1617
* `qute.inlayHint.showSectionParameterType`: Show section parameter type. Default is `true`.
1718
* `qute.inlayHint.showMethodParameterType`: Show method parameter type. Default is `true`.
1819
* `qute.validation.enabled`: Enable/disable all Qute validation. Default is `false`.
19-
* `qute.validation.excluded`: Disable Qute validation for the given file name patterns.\n\nExample:\n```\n[\n \"**/*items.qute.*\"\n]```.
20+
* `qute.validation.excluded`: Disable Qute validation for the given file name patterns.
21+
22+
Example:
23+
24+
```json
25+
[
26+
"**/*items.qute.*"
27+
]
28+
```
2029
* `qute.validation.undefinedObject.severity`: Validation severity for undefined object in Qute template files. Default is `warning`.
2130
* `qute.validation.undefinedNamespace.severity`: Validation severity for undefined namespace in Qute template files. Default is `warning`.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@
225225
"description": "Action performed when detected Quarkus properties have an incorrect language.",
226226
"scope": "window"
227227
},
228+
"qute.server.vmargs": {
229+
"type": "string",
230+
"scope": "application",
231+
"markdownDescription": "The vmargs to use when launching the Qute language server",
232+
"default": "-Xmx100M -XX:+UseG1GC -XX:+UseStringDeduplication -Xlog:disable"
233+
},
228234
"qute.templates.languageMismatch": {
229235
"type": "string",
230236
"enum": [

src/qute/languageServer/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as requirements from './requirements';
33
import { DidChangeConfigurationNotification, LanguageClientOptions } from 'vscode-languageclient';
44
import { LanguageClient } from 'vscode-languageclient/node';
55
import { ExtensionContext, commands, workspace, window, ConfigurationTarget, languages } from 'vscode';
6-
import { prepareExecutable } from './javaServerStarter';
6+
import { prepareExecutable } from './quteServerStarter';
77
import { registerQuteExecuteWorkspaceCommand, registerVSCodeQuteCommands, synchronizeQuteValidationButton } from '../commands/registerCommands';
88
import { QuteClientCommandConstants } from '../commands/commandConstants';
99
import { QuteSettings } from './settings';

src/qute/languageServer/javaServerStarter.ts renamed to src/qute/languageServer/quteServerStarter.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ function prepareParams(): string[] {
3030
}
3131
}
3232

33-
const vmargs = workspace.getConfiguration("quarkus.tools").get("server.vmargs", '');
33+
const vmargs = workspace.getConfiguration("qute").get("server.vmargs", '');
3434
if (os.platform() === 'win32') {
3535
const watchParentProcess = '-DwatchParentProcess=';
3636
if (vmargs.indexOf(watchParentProcess) < 0) {
3737
params.push(watchParentProcess + 'false');
3838
}
3939
}
40+
// Disable logging unless the user specifically sets it to a different value.
41+
// Logging can cause issues, since sometimes it writes to standard out.
42+
// See https://github.com/redhat-developer/vscode-java/issues/2577.
43+
if (vmargs.indexOf("-Xlog:") < 0) {
44+
params.push("-Xlog:disable");
45+
}
4046
parseVMargs(params, vmargs);
4147
const serverHome: string = path.resolve(__dirname, '../server');
4248
const quteServerFound: Array<string> = glob.sync(`**/${QUTE_SERVER_NAME}`, { cwd: serverHome });

0 commit comments

Comments
 (0)