Skip to content

Commit 7458bf8

Browse files
authored
include lsp_utils settings in LSP (#2395)
1 parent 2910042 commit 7458bf8

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

Default.sublime-commands

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
"default": "// SublimeText base scope -> LSP Language ID overrides\n{\n\t// \"source.mylanguage\": \"mylang\"\n\t$0\n}\n"
2626
}
2727
},
28+
{
29+
"caption": "Preferences: LSP Utils Settings",
30+
"command": "edit_settings",
31+
"args": {
32+
"base_file": "${packages}/LSP/lsp_utils.sublime-settings",
33+
"default": "// Settings in here override those in \"LSP/lsp_utils.sublime-settings\"\n{\n\t$0\n}\n"
34+
}
35+
},
2836
{
2937
"caption": "LSP Development: Parse VSCode Package JSON From Clipboard",
3038
"command": "lsp_parse_vscode_package_json"

lsp_utils.sublime-settings

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// Specifies the type and priority of the Node.js installation that should be used for Node.js-based servers.
3+
// The allowed values are:
4+
// - 'system' - a Node.js runtime found on the PATH
5+
// - 'local' - a Node.js runtime managed by LSP that doesn't affect the system
6+
// The order in which the values are specified determines which one is tried first,
7+
// with the later one being used as a fallback.
8+
// You can also specify just a single value to disable the fallback.
9+
"nodejs_runtime": ["system", "local"],
10+
// Uses Node.js runtime from the Electron package rather than the official distribution. This has the benefit of
11+
// lower memory usage due to it having the pointer compression (https://v8.dev/blog/pointer-compression) enabled.
12+
// Only relevant when using `local` variant of `nodejs_runtime`.
13+
"local_use_electron": false,
14+
}

sublime-package.json

+36
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,42 @@
754754
"additionalProperties": false
755755
}
756756
},
757+
{
758+
"file_patterns": [
759+
"/lsp_utils.sublime-settings"
760+
],
761+
"schema": {
762+
"type": "object",
763+
"properties": {
764+
"nodejs_runtime": {
765+
"type": "array",
766+
"markdownDescription": "Specifies the type and priority of the Node.js installation that should be used for Node.js-based servers.\n\nThe allowed values are:\n\n- `system` - a Node.js runtime found on the PATH\n- `local` - a Node.js runtime managed by LSP that doesn't affect the system\n\nThe order in which the values are specified determines which one is tried first,\nwith the later one being used as a fallback.\nYou can also specify just a single value to disable the fallback.",
767+
"default": [
768+
"system",
769+
"local",
770+
],
771+
"items": {
772+
"type": "string",
773+
"enum": [
774+
"system",
775+
"local"
776+
],
777+
"markdownEnumDescriptions": [
778+
"Node.js runtime found on the PATH",
779+
"Node.js runtime managed by LSP"
780+
]
781+
},
782+
"uniqueItems": true,
783+
},
784+
"local_use_electron": {
785+
"type": "boolean",
786+
"default": false,
787+
"markdownDescription": "Uses Node.js runtime from the Electron package rather than the official distribution. This has the benefit of lower memory usage due to it having the [pointer compression](https://v8.dev/blog/pointer-compression) enabled.\n\nOnly relevant when using `local` variant of `nodejs_runtime`."
788+
}
789+
},
790+
"additionalProperties": false,
791+
}
792+
},
757793
{
758794
"file_patterns": [
759795
"/Preferences.sublime-settings"

0 commit comments

Comments
 (0)