From d9ce3cfc0c9de1a96f65b970826b2c2ad53a7b59 Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Fri, 19 Jan 2024 23:56:52 +0100 Subject: [PATCH] include lsp_utils settings in LSP --- Default.sublime-commands | 8 ++++++++ lsp_utils.sublime-settings | 14 ++++++++++++++ sublime-package.json | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 lsp_utils.sublime-settings diff --git a/Default.sublime-commands b/Default.sublime-commands index c798956b8..610d5cbab 100644 --- a/Default.sublime-commands +++ b/Default.sublime-commands @@ -25,6 +25,14 @@ "default": "// SublimeText base scope -> LSP Language ID overrides\n{\n\t// \"source.mylanguage\": \"mylang\"\n\t$0\n}\n" } }, + { + "caption": "Preferences: LSP Utils Settings", + "command": "edit_settings", + "args": { + "base_file": "${packages}/LSP/lsp_utils.sublime-settings", + "default": "// Settings in here override those in \"LSP/lsp_utils.sublime-settings\"\n{\n\t$0\n}\n" + } + }, { "caption": "LSP Development: Parse VSCode Package JSON From Clipboard", "command": "lsp_parse_vscode_package_json" diff --git a/lsp_utils.sublime-settings b/lsp_utils.sublime-settings new file mode 100644 index 000000000..e5c26c38b --- /dev/null +++ b/lsp_utils.sublime-settings @@ -0,0 +1,14 @@ +{ + // Specifies the type and priority of the Node.js installation that should be used for Node.js-based servers. + // The allowed values are: + // - 'system' - a Node.js runtime found on the PATH + // - 'local' - a Node.js runtime managed by LSP that doesn't affect the system + // The order in which the values are specified determines which one is tried first, + // with the later one being used as a fallback. + // You can also specify just a single value to disable the fallback. + "nodejs_runtime": ["system", "local"], + // 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. + // Only relevant when using `local` variant of `nodejs_runtime`. + "local_use_electron": false, +} diff --git a/sublime-package.json b/sublime-package.json index 17a0f17ee..74689be68 100644 --- a/sublime-package.json +++ b/sublime-package.json @@ -754,6 +754,42 @@ "additionalProperties": false } }, + { + "file_patterns": [ + "/lsp_utils.sublime-settings" + ], + "schema": { + "type": "object", + "properties": { + "nodejs_runtime": { + "type": "array", + "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.", + "default": [ + "system", + "local", + ], + "items": { + "type": "string", + "enum": [ + "system", + "local" + ], + "markdownEnumDescriptions": [ + "Node.js runtime found on the PATH", + "Node.js runtime managed by LSP" + ] + }, + "uniqueItems": true, + }, + "local_use_electron": { + "type": "boolean", + "default": false, + "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`." + } + }, + "additionalProperties": false, + } + }, { "file_patterns": [ "/Preferences.sublime-settings"