├── .python-version ├── LSP-lua.sublime-commands ├── Main.sublime-menu ├── LICENSE ├── README.md ├── plugin.py ├── LSP-lua.sublime-settings └── sublime-package.json /.python-version: -------------------------------------------------------------------------------- 1 | 3.8 2 | -------------------------------------------------------------------------------- /LSP-lua.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Preferences: LSP-lua Settings", 4 | "command": "edit_settings", 5 | "args": { 6 | "base_file": "${packages}/LSP-lua/LSP-lua.sublime-settings", 7 | "default": "// Settings in here override those in \"LSP-lua/LSP-lua.sublime-settings\"\n{\n\t$0\n}\n" 8 | } 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "preferences", 4 | "children": [ 5 | { 6 | "caption": "Package Settings", 7 | "mnemonic": "P", 8 | "id": "package-settings", 9 | "children": [ 10 | { 11 | "caption": "LSP", 12 | "id": "lsp-settings", 13 | "children": [ 14 | { 15 | "caption": "Servers", 16 | "id": "lsp-servers", 17 | "children": [ 18 | { 19 | "caption": "LSP-lua", 20 | "command": "edit_settings", 21 | "args": { 22 | "base_file": "${packages}/LSP-lua/LSP-lua.sublime-settings", 23 | "default": "// Settings in here override those in \"LSP-lua/LSP-lua.sublime-settings\"\n\n{\n\t$0\n}\n", 24 | } 25 | } 26 | ] 27 | } 28 | ] 29 | } 30 | ] 31 | } 32 | ] 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Raoul Wols 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LSP-lua 2 | 3 | A language client for Lua. This package will download and unpack the [lua-language-server](https://github.com/LuaLS/lua-language-server) in `$DATA/Package Storage/LSP-lua`. 4 | 5 | To use this package, you must have: 6 | 7 | - The [LSP](https://packagecontrol.io/packages/LSP) package. 8 | 9 | # Applicable Selectors 10 | 11 | This language server operates on files with the `source.lua` base scope. 12 | 13 | # Configuration 14 | 15 | Run `Preferences: LSP-lua Settings` from the Command Palette. 16 | 17 | # Locale 18 | 19 | You can make this language server report documentation in English or Chinese. The default is English. To change it 20 | into Chinese, run the command `Preferences: LSP-lua Settings` and change the `"locale"` key. 21 | 22 | # Popup highlighting 23 | 24 | The code blocks that this language server returns are not valid Lua code. Consequently the built-in syntax highlighter marks most code blocks as invalid. Set 25 | 26 | ```js 27 | "mdpopups.use_sublime_highlighter": false, 28 | ```` 29 | 30 | in Packages/User/Preferences.sublime-settings to use pygments instead, which is a highlighter that is more forgiving. 31 | 32 | # Disabling Diagnostics via Code Actions 33 | 34 | This language server allows you to disable diagnostics by means of a Code Action. You can run the "Code Action" and the client (this package) is supposed to modify the settings to add or remove the unwanted diagnostic. This package implements that by editing your .sublime-project file. So in order for this to work, you need to have your window be backed by a .sublime-project file. [Learn more about projects here](https://www.sublimetext.com/docs/projects.html). 35 | -------------------------------------------------------------------------------- /plugin.py: -------------------------------------------------------------------------------- 1 | from LSP.plugin import AbstractPlugin 2 | from LSP.plugin import register_plugin 3 | from LSP.plugin import unregister_plugin 4 | from LSP.plugin.core.sessions import Session 5 | from LSP.plugin.core.typing import Any, Dict, Optional, Tuple 6 | import functools 7 | import os 8 | import shutil 9 | import sublime 10 | import tempfile 11 | import urllib.request 12 | import weakref 13 | import zipfile 14 | import tarfile 15 | 16 | URL = "https://github.com/LuaLS/lua-language-server/releases/download/{v}/lua-language-server-{v}-{platform_arch}" 17 | 18 | class Lua(AbstractPlugin): 19 | @classmethod 20 | def name(cls) -> str: 21 | return "LSP-{}".format(cls.__name__.lower()) 22 | 23 | @classmethod 24 | def basedir(cls) -> str: 25 | return os.path.join(cls.storage_path(), cls.name()) 26 | 27 | @classmethod 28 | def version_file(cls) -> str: 29 | return os.path.join(cls.basedir(), "VERSION") 30 | 31 | @classmethod 32 | def platform_arch(cls) -> str: 33 | return { 34 | "linux_x64": "linux-x64.tar.gz", 35 | "osx_arm64": "darwin-arm64.tar.gz", 36 | "osx_x64": "darwin-x64.tar.gz", 37 | "windows_x32": "win32-ia32.zip", 38 | "windows_x64": "win32-x64.zip", 39 | }[sublime.platform() + "_" + sublime.arch()] 40 | 41 | @classmethod 42 | def needs_update_or_installation(cls) -> bool: 43 | settings, _ = cls.configuration() 44 | server_version = str(settings.get("server_version")) 45 | try: 46 | with open(cls.version_file(), "r") as fp: 47 | return server_version != fp.read().strip() 48 | except OSError: 49 | return True 50 | 51 | @classmethod 52 | def install_or_update(cls) -> None: 53 | shutil.rmtree(cls.basedir(), ignore_errors=True) 54 | try: 55 | settings, _ = cls.configuration() 56 | server_version = str(settings.get("server_version")) 57 | with tempfile.TemporaryDirectory() as tempdir: 58 | downloaded_file = os.path.join(tempdir, "lua-lang-download") 59 | platform = cls.platform_arch() 60 | urllib.request.urlretrieve(URL.format(v=server_version, platform_arch=cls.platform_arch()), downloaded_file) 61 | if platform == "win32-ia32.zip" or platform == "win32-x64.zip": 62 | with zipfile.ZipFile(downloaded_file, "r") as z: 63 | z.extractall(tempdir) 64 | else: 65 | with tarfile.open(downloaded_file) as z: 66 | z.extractall(tempdir) 67 | os.makedirs(cls.storage_path(), exist_ok=True) 68 | shutil.move(tempdir, cls.basedir()) 69 | with open(cls.version_file(), "w") as fp: 70 | fp.write(server_version) 71 | shutil.rmtree(os.path.join(tempdir), ignore_errors=True) 72 | except Exception: 73 | shutil.rmtree(cls.basedir(), ignore_errors=True) 74 | raise 75 | 76 | @classmethod 77 | def configuration(cls) -> Tuple[sublime.Settings, str]: 78 | base_name = "{}.sublime-settings".format(cls.name()) 79 | file_path = "Packages/{}/{}".format(cls.name(), base_name) 80 | return sublime.load_settings(base_name), file_path 81 | 82 | @classmethod 83 | def additional_variables(cls) -> Optional[Dict[str, str]]: 84 | settings, _ = cls.configuration() 85 | return { 86 | "platform_arch": cls.platform_arch(), 87 | "locale": str(settings.get("locale")), 88 | "language": str(settings.get("locale")), 89 | "version": str(settings.get("settings").get("Lua.runtime.version") or "Lua 5.4"), 90 | "encoding": str(settings.get("settings").get("Lua.runtime.fileEncoding") or "utf8"), 91 | "3rd": os.path.join(cls.basedir(), "meta", "3rd") 92 | } 93 | 94 | def __init__(self, weaksession: 'weakref.ref[Session]') -> None: 95 | super().__init__(weaksession) 96 | self._settings_change_count = 0 97 | self._queued_changes = [] # type: List[Dict[str, Any]] 98 | 99 | def m___command(self, params: Any) -> None: 100 | """Handles the $/command notification.""" 101 | if not isinstance(params, dict): 102 | return print("{}: cannot handle command: expected dict, got {}".format(self.name(), type(params))) 103 | command = params["command"] 104 | if command == "lua.config": 105 | self._queued_changes.extend(params["data"]) 106 | self._settings_change_count += 1 107 | current_count = self._settings_change_count 108 | sublime.set_timeout_async(functools.partial(self._handle_config_commands_async, current_count), 200) 109 | else: 110 | sublime.error_message("LSP-lua: unrecognized command: {}".format(command)) 111 | 112 | def _handle_config_commands_async(self, settings_change_count: int) -> None: 113 | if self._settings_change_count != settings_change_count: 114 | return 115 | commands, self._queued_changes = self._queued_changes, [] 116 | session = self.weaksession() 117 | if not session: 118 | return 119 | base, settings = self._get_server_settings(session.window) 120 | if base is None or settings is None: 121 | return 122 | for command in commands: 123 | action = command["action"] 124 | key = command["key"] 125 | value = command["value"] 126 | if action == "set": 127 | settings[key] = value 128 | elif action == "add": 129 | values = settings.get(key) 130 | if not isinstance(values, list): 131 | values = [] 132 | values.append(value) 133 | settings[key] = values 134 | else: 135 | print("LSP-lua: unrecognized action:", action) 136 | session.window.set_project_data(base) 137 | if not session.window.project_file_name(): 138 | sublime.message_dialog(" ".join(( 139 | "The server settings have been applied in the Window,", 140 | "but this Window is not backed by a .sublime-project.", 141 | "Click on Project > Save Project As... to store the settings." 142 | ))) 143 | 144 | def _get_server_settings(self, window: sublime.Window) -> Tuple[Optional[Dict[str, Any]], Optional[Dict[str, Any]]]: 145 | data = window.project_data() 146 | if not isinstance(data, dict): 147 | return None, None 148 | if "settings" not in data: 149 | data["settings"] = {} 150 | if "LSP" not in data["settings"]: 151 | data["settings"]["LSP"] = {} 152 | if "LSP-lua" not in data["settings"]["LSP"]: 153 | data["settings"]["LSP"]["LSP-lua"] = {} 154 | if "settings" not in data["settings"]["LSP"]["LSP-lua"]: 155 | data["settings"]["LSP"]["LSP-lua"]["settings"] = {} 156 | return data, data["settings"]["LSP"]["LSP-lua"]["settings"] 157 | 158 | 159 | def plugin_loaded() -> None: 160 | register_plugin(Lua) 161 | 162 | 163 | def plugin_unloaded() -> None: 164 | unregister_plugin(Lua) 165 | -------------------------------------------------------------------------------- /LSP-lua.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | // possible values: en-US, zh-CN 3 | "locale": "en-US", 4 | 5 | // The startup command for this language server 6 | "command": [ 7 | "${storage_path}/LSP-lua/bin/lua-language-server", 8 | "-E", 9 | "${storage_path}/LSP-lua/main.lua", 10 | "--locale=${locale}" 11 | ], 12 | 13 | // Initialization options sent to the subprocess during startup. You should 14 | // normally not touch this. 15 | "initializationOptions": { 16 | // We understand how to handle configuration changes from the server. 17 | "changeConfiguration": true 18 | }, 19 | 20 | // The server version to download in $CACHE/Package Storage 21 | "server_version": "3.7.3", 22 | 23 | // Disable the trigger characters, because there's too many of them. The 24 | // default Lua syntax is capable enough to best decide when to trigger 25 | // the auto-complete widget. 26 | "disabled_capabilities": { 27 | "completionProvider": { 28 | "triggerCharacters": true 29 | } 30 | }, 31 | 32 | // We start this server when opening a lua file 33 | "selector": "source.lua", 34 | 35 | // The server-specific settings 36 | "settings": { 37 | // Whether the addon manager is enabled or not. 38 | "Lua.addonManager.enable": true, 39 | // Enable code lens. 40 | "Lua.codeLens.enable": false, 41 | // When the input looks like a file name, automatically `require` this file. 42 | "Lua.completion.autoRequire": true, 43 | // Shows function call snippets. 44 | // possible values: "Disable", "Both", "Replace" 45 | "Lua.completion.callSnippet": "Disable", 46 | // Previewing the relevant code snippet of the suggestion may help you understand the usage 47 | // of the suggestion. The number set indicates the number of intercepted lines in the code 48 | // fragment. If it is set to `0`, this feature can be disabled. 49 | "Lua.completion.displayContext": 0, 50 | // Enable completion. 51 | "Lua.completion.enable": true, 52 | // Shows keyword syntax snippets. 53 | // possible values: "Disable", "Both", "Replace" 54 | "Lua.completion.keywordSnippet": "Replace", 55 | // The symbol used to trigger the postfix suggestion. 56 | "Lua.completion.postfix": "@", 57 | // The separator used when `require`. 58 | "Lua.completion.requireSeparator": ".", 59 | // Display parameters in completion list. When the function has multiple definitions, they 60 | // will be displayed separately. 61 | "Lua.completion.showParams": true, 62 | // Show contextual words in suggestions. 63 | // possible values: "Enable", "Fallback", "Disable" 64 | "Lua.completion.showWord": "Fallback", 65 | // Whether the displayed context word contains the content of other files in the workspace. 66 | "Lua.completion.workspaceWord": true, 67 | // Disabled diagnostic (Use code in hover brackets). 68 | "Lua.diagnostics.disable": [], 69 | // Do not diagnose Lua files that use the following scheme. 70 | "Lua.diagnostics.disableScheme": [ 71 | "git" 72 | ], 73 | // Enable diagnostics. 74 | "Lua.diagnostics.enable": true, 75 | // Defined global variables. 76 | "Lua.diagnostics.globals": [], 77 | // Modify the diagnostic needed file status in a group. 78 | // * Opened: only diagnose opened files 79 | // * Any: diagnose all files 80 | // * None: disable this diagnostic 81 | // `Fallback` means that diagnostics in this group are controlled by 82 | // `diagnostics.neededFileStatus` separately. 83 | // Other settings will override individual settings without end of `!`. 84 | "Lua.diagnostics.groupFileStatus": {}, 85 | // Modify the diagnostic severity in a group. 86 | // `Fallback` means that diagnostics in this group are controlled by `diagnostics.severity` 87 | // separately. 88 | // Other settings will override individual settings without end of `!`. 89 | "Lua.diagnostics.groupSeverity": {}, 90 | // How to diagnose ignored files. 91 | // possible values: "Enable", "Opened", "Disable" 92 | "Lua.diagnostics.ignoredFiles": "Opened", 93 | // How to diagnose files loaded via `Lua.workspace.library`. 94 | // possible values: "Enable", "Opened", "Disable" 95 | "Lua.diagnostics.libraryFiles": "Opened", 96 | // * Opened: only diagnose opened files 97 | // * Any: diagnose all files 98 | // * None: disable this diagnostic 99 | // End with `!` means override the group setting `diagnostics.groupFileStatus`. 100 | "Lua.diagnostics.neededFileStatus": {}, 101 | // Modify the diagnostic severity. 102 | // End with `!` means override the group setting `diagnostics.groupSeverity`. 103 | "Lua.diagnostics.severity": {}, 104 | // Do not diagnose `unused-local` when the variable name matches the following pattern. 105 | "Lua.diagnostics.unusedLocalExclude": [], 106 | // Latency (milliseconds) for workspace diagnostics. 107 | "Lua.diagnostics.workspaceDelay": 3000, 108 | // Set the time to trigger workspace diagnostics. 109 | // possible values: "OnChange", "OnSave", "None" 110 | "Lua.diagnostics.workspaceEvent": "OnSave", 111 | // Workspace diagnostics run rate (%). Decreasing this value reduces CPU usage, but also 112 | // reduces the speed of workspace diagnostics. The diagnosis of the file you are currently 113 | // editing is always done at full speed and is not affected by this setting. 114 | "Lua.diagnostics.workspaceRate": 100, 115 | // Treat specific field names as package, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are 116 | // package, witch can only be accessed in the file where the definition is located. 117 | "Lua.doc.packageName": [], 118 | // Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are 119 | // private, witch can only be accessed in the class where the definition is located. 120 | "Lua.doc.privateName": [], 121 | // Treat specific field names as protected, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are 122 | // protected, witch can only be accessed in the class where the definition is located and 123 | // its subclasses. 124 | "Lua.doc.protectedName": [], 125 | // The default format configuration. Has a lower priority than `.editorconfig` file in the 126 | // workspace. 127 | // Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to 128 | // learn usage. 129 | "Lua.format.defaultConfig": {}, 130 | // Enable code formatter. 131 | "Lua.format.enable": true, 132 | // Show hints of array index when constructing a table. 133 | // possible values: "Enable", "Auto", "Disable" 134 | "Lua.hint.arrayIndex": "Auto", 135 | // If the called function is marked `---@async`, prompt `await` at the call. 136 | "Lua.hint.await": true, 137 | // Enable inlay hint. 138 | "Lua.hint.enable": false, 139 | // Show hints of parameter name at the function call. 140 | // possible values: "All", "Literal", "Disable" 141 | "Lua.hint.paramName": "All", 142 | // Show type hints at the parameter of the function. 143 | "Lua.hint.paramType": true, 144 | // If there is no semicolon at the end of the statement, display a virtual semicolon. 145 | // possible values: "All", "SameLine", "Disable" 146 | "Lua.hint.semicolon": "SameLine", 147 | // Show hints of type at assignment operation. 148 | "Lua.hint.setType": false, 149 | // Enable hover. 150 | "Lua.hover.enable": true, 151 | // When the value corresponds to multiple types, limit the number of types displaying. 152 | "Lua.hover.enumsLimit": 5, 153 | // Whether to expand the alias. For example, expands `---@alias myType boolean|number` 154 | // appears as `boolean|number`, otherwise it appears as `myType'. 155 | "Lua.hover.expandAlias": true, 156 | // When hovering to view a table, limits the maximum number of previews for fields. 157 | "Lua.hover.previewFields": 50, 158 | // Hover to view numeric content (only if literal is not decimal). 159 | "Lua.hover.viewNumber": true, 160 | // Hover to view the contents of a string (only if the literal contains an escape 161 | // character). 162 | "Lua.hover.viewString": true, 163 | // The maximum length of a hover to view the contents of a string. 164 | "Lua.hover.viewStringMax": 1000, 165 | // Specify the executable path in VSCode. 166 | "Lua.misc.executablePath": "", 167 | // [Command line parameters](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) 168 | // when starting the language server in VSCode. 169 | "Lua.misc.parameters": [], 170 | // Set name style config 171 | "Lua.nameStyle.config": {}, 172 | // Adjust the enabled state of the built-in library. You can disable (or redefine) the non- 173 | // existent library according to the actual runtime environment. 174 | // * `default`: Indicates that the library will be enabled or disabled according to the 175 | // runtime version 176 | // * `enable`: always enable 177 | // * `disable`: always disable 178 | "Lua.runtime.builtin": {}, 179 | // File encoding. The `ansi` option is only available under the `Windows` platform. 180 | // possible values: "utf8", "ansi", "utf16le", "utf16be" 181 | "Lua.runtime.fileEncoding": "utf8", 182 | // Format of the directory name of the meta files. 183 | "Lua.runtime.meta": "${version} ${language} ${encoding}", 184 | // Supports non-standard symbols. Make sure that your runtime environment supports these 185 | // symbols. 186 | "Lua.runtime.nonstandardSymbol": [], 187 | // When using `require`, how to find the file based on the input name. 188 | // Setting this config to `?/init.lua` means that when you enter `require 'myfile'`, 189 | // `${workspace}/myfile/init.lua` will be searched from the loaded files. 190 | // if `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also be 191 | // searched. 192 | // If you want to load files outside the workspace, you need to set `Lua.workspace.library` 193 | // first. 194 | "Lua.runtime.path": [ 195 | "?.lua", 196 | "?/init.lua" 197 | ], 198 | // When enabled, `runtime.path` will only search the first level of directories, see the 199 | // description of `runtime.path`. 200 | "Lua.runtime.pathStrict": false, 201 | // Plugin path. Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/Plugins) to learn more. 202 | "Lua.runtime.plugin": "", 203 | // Additional arguments for the plugin. 204 | "Lua.runtime.pluginArgs": [], 205 | // The custom global variables are regarded as some special built-in variables, and the 206 | // language server will provide special support 207 | // The following example shows that 'include' is treated as' require '. 208 | // ```json 209 | // "Lua.runtime.special" : { 210 | // "include" : "require" 211 | // } 212 | // ``` 213 | "Lua.runtime.special": {}, 214 | // Allows Unicode characters in name. 215 | "Lua.runtime.unicodeName": false, 216 | // Lua runtime version. 217 | // possible values: "Lua 5.1", "Lua 5.2", "Lua 5.3", "Lua 5.4", "LuaJIT" 218 | "Lua.runtime.version": "Lua 5.4", 219 | // Semantic coloring of type annotations. 220 | "Lua.semantic.annotation": true, 221 | // Enable semantic color. You may need to set `editor.semanticHighlighting.enabled` to 222 | // `true` to take effect. 223 | "Lua.semantic.enable": true, 224 | // Semantic coloring of keywords/literals/operators. You only need to enable this feature if 225 | // your editor cannot do syntax coloring. 226 | "Lua.semantic.keyword": false, 227 | // Semantic coloring of variables/fields/parameters. 228 | "Lua.semantic.variable": true, 229 | // Enable signature help. 230 | "Lua.signatureHelp.enable": true, 231 | // Custom words for spell checking. 232 | "Lua.spell.dict": [], 233 | // Allowed to assign the `number` type to the `integer` type. 234 | "Lua.type.castNumberToInteger": true, 235 | // When checking the type of union type, ignore the `nil` in it. 236 | // When this setting is `false`, the `number|nil` type cannot be assigned to the `number` 237 | // type. It can be with `true`. 238 | "Lua.type.weakNilCheck": false, 239 | // Once one subtype of a union type meets the condition, the union type also meets the 240 | // condition. 241 | // When this setting is `false`, the `number|boolean` type cannot be assigned to the 242 | // `number` type. It can be with `true`. 243 | "Lua.type.weakUnionCheck": false, 244 | // Configures the formatting behavior while typing Lua code. 245 | "Lua.typeFormat.config": {}, 246 | // Show progress bar in status bar. 247 | "Lua.window.progressBar": true, 248 | // Show extension status in status bar. 249 | "Lua.window.statusBar": true, 250 | // Automatic detection and adaptation of third-party libraries, currently supported 251 | // libraries are: 252 | // * OpenResty 253 | // * Cocos4.0 254 | // * LÖVE 255 | // * LÖVR 256 | // * skynet 257 | // * Jass 258 | // possible values: false, true, "Ask", "Apply", "ApplyInMemory", "Disable" 259 | "Lua.workspace.checkThirdParty": "Ask", 260 | // Ignored files and directories (Use `.gitignore` grammar). 261 | "Lua.workspace.ignoreDir": [ 262 | ".vscode" 263 | ], 264 | // Ignore submodules. 265 | "Lua.workspace.ignoreSubmodules": true, 266 | // In addition to the current workspace, which directories will load files from. The files 267 | // in these directories will be treated as externally provided code libraries, and some 268 | // features (such as renaming fields) will not modify these files. 269 | "Lua.workspace.library": [], 270 | // Max preloaded files. 271 | "Lua.workspace.maxPreload": 5000, 272 | // Skip files larger than this value (KB) when preloading. 273 | "Lua.workspace.preloadFileSize": 500, 274 | // Ignore files list in `.gitignore` . 275 | "Lua.workspace.useGitIgnore": true, 276 | // Add private third-party library configuration file paths here, please refer to the built- 277 | // in [configuration file path](https://github.com/LuaLS/lua-language- 278 | // server/tree/master/meta/3rd) 279 | "Lua.workspace.userThirdParty": [], 280 | } 281 | } 282 | -------------------------------------------------------------------------------- /sublime-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "contributions": { 3 | "settings": [ 4 | { 5 | "file_patterns": [ 6 | "/LSP-lua.sublime-settings" 7 | ], 8 | "schema": { 9 | "$id": "sublime://settings/LSP-lua", 10 | "allOf": [ 11 | { 12 | "$ref": "sublime://settings/LSP-plugin-base" 13 | }, 14 | { 15 | "$ref": "sublime://settings/LSP-lua#/definitions/PluginConfig" 16 | } 17 | ], 18 | "definitions": { 19 | "PluginConfig": { 20 | "properties": { 21 | "locale": { 22 | "enum": [ 23 | "en-US", 24 | "zh-CN", 25 | "zh-TW", 26 | "pt-BR" 27 | ], 28 | "markdownEnumDescriptions": [ 29 | "Use English", 30 | "Use Chinese", 31 | "Use Chinese language as used in Taiwan", 32 | "Use Brazilian Portuguese" 33 | ] 34 | }, 35 | "settings": { 36 | "additionalProperties": false, 37 | "properties": { 38 | "Lua.addonManager.enable": { 39 | "default": true, 40 | "markdownDescription": "Whether the addon manager is enabled or not.", 41 | "type": "boolean" 42 | }, 43 | "Lua.codeLens.enable": { 44 | "default": false, 45 | "markdownDescription": "Enable code lens.", 46 | "type": "boolean" 47 | }, 48 | "Lua.completion.autoRequire": { 49 | "default": true, 50 | "markdownDescription": "When the input looks like a file name, automatically `require` this file.", 51 | "type": "boolean" 52 | }, 53 | "Lua.completion.callSnippet": { 54 | "default": "Disable", 55 | "enum": [ 56 | "Disable", 57 | "Both", 58 | "Replace" 59 | ], 60 | "markdownDescription": "Shows function call snippets.", 61 | "markdownEnumDescriptions": [ 62 | "Only shows `function name`.", 63 | "Shows `function name` and `call snippet`.", 64 | "Only shows `call snippet.`" 65 | ], 66 | "type": "string" 67 | }, 68 | "Lua.completion.displayContext": { 69 | "default": 0, 70 | "markdownDescription": "Previewing the relevant code snippet of the suggestion may help you understand the usage of the suggestion. The number set indicates the number of intercepted lines in the code fragment. If it is set to `0`, this feature can be disabled.", 71 | "type": "integer" 72 | }, 73 | "Lua.completion.enable": { 74 | "default": true, 75 | "markdownDescription": "Enable completion.", 76 | "type": "boolean" 77 | }, 78 | "Lua.completion.keywordSnippet": { 79 | "default": "Replace", 80 | "enum": [ 81 | "Disable", 82 | "Both", 83 | "Replace" 84 | ], 85 | "markdownDescription": "Shows keyword syntax snippets.", 86 | "markdownEnumDescriptions": [ 87 | "Only shows `keyword`.", 88 | "Shows `keyword` and `syntax snippet`.", 89 | "Only shows `syntax snippet`." 90 | ], 91 | "type": "string" 92 | }, 93 | "Lua.completion.postfix": { 94 | "default": "@", 95 | "markdownDescription": "The symbol used to trigger the postfix suggestion.", 96 | "type": "string" 97 | }, 98 | "Lua.completion.requireSeparator": { 99 | "default": ".", 100 | "markdownDescription": "The separator used when `require`.", 101 | "type": "string" 102 | }, 103 | "Lua.completion.showParams": { 104 | "default": true, 105 | "markdownDescription": "Display parameters in completion list. When the function has multiple definitions, they will be displayed separately.", 106 | "type": "boolean" 107 | }, 108 | "Lua.completion.showWord": { 109 | "default": "Fallback", 110 | "enum": [ 111 | "Enable", 112 | "Fallback", 113 | "Disable" 114 | ], 115 | "markdownDescription": "Show contextual words in suggestions.", 116 | "markdownEnumDescriptions": [ 117 | "Always show context words in suggestions.", 118 | "Contextual words are only displayed when suggestions based on semantics cannot be provided.", 119 | "Do not display context words." 120 | ], 121 | "type": "string" 122 | }, 123 | "Lua.completion.workspaceWord": { 124 | "default": true, 125 | "markdownDescription": "Whether the displayed context word contains the content of other files in the workspace.", 126 | "type": "boolean" 127 | }, 128 | "Lua.diagnostics.disable": { 129 | "default": [], 130 | "items": { 131 | "enum": [ 132 | "action-after-return", 133 | "ambiguity-1", 134 | "ambiguous-syntax", 135 | "args-after-dots", 136 | "assign-type-mismatch", 137 | "await-in-sync", 138 | "block-after-else", 139 | "break-outside", 140 | "cast-local-type", 141 | "cast-type-mismatch", 142 | "circle-doc-class", 143 | "close-non-object", 144 | "code-after-break", 145 | "codestyle-check", 146 | "count-down-loop", 147 | "deprecated", 148 | "different-requires", 149 | "discard-returns", 150 | "doc-field-no-class", 151 | "duplicate-doc-alias", 152 | "duplicate-doc-field", 153 | "duplicate-doc-param", 154 | "duplicate-index", 155 | "duplicate-set-field", 156 | "empty-block", 157 | "err-assign-as-eq", 158 | "err-c-long-comment", 159 | "err-comment-prefix", 160 | "err-do-as-then", 161 | "err-eq-as-assign", 162 | "err-esc", 163 | "err-nonstandard-symbol", 164 | "err-then-as-do", 165 | "exp-in-action", 166 | "global-element", 167 | "global-in-nil-env", 168 | "incomplete-signature-doc", 169 | "index-in-func-name", 170 | "inject-field", 171 | "invisible", 172 | "jump-local-scope", 173 | "keyword", 174 | "local-limit", 175 | "lowercase-global", 176 | "lua-doc-miss-sign", 177 | "luadoc-error-diag-mode", 178 | "luadoc-miss-alias-extends", 179 | "luadoc-miss-alias-name", 180 | "luadoc-miss-arg-name", 181 | "luadoc-miss-cate-name", 182 | "luadoc-miss-class-extends-name", 183 | "luadoc-miss-class-name", 184 | "luadoc-miss-diag-mode", 185 | "luadoc-miss-diag-name", 186 | "luadoc-miss-field-extends", 187 | "luadoc-miss-field-name", 188 | "luadoc-miss-fun-after-overload", 189 | "luadoc-miss-generic-name", 190 | "luadoc-miss-local-name", 191 | "luadoc-miss-module-name", 192 | "luadoc-miss-operator-name", 193 | "luadoc-miss-param-extends", 194 | "luadoc-miss-param-name", 195 | "luadoc-miss-see-name", 196 | "luadoc-miss-sign-name", 197 | "luadoc-miss-symbol", 198 | "luadoc-miss-type-name", 199 | "luadoc-miss-vararg-type", 200 | "luadoc-miss-version", 201 | "malformed-number", 202 | "miss-end", 203 | "miss-esc-x", 204 | "miss-exp", 205 | "miss-exponent", 206 | "miss-field", 207 | "miss-loop-max", 208 | "miss-loop-min", 209 | "miss-method", 210 | "miss-name", 211 | "miss-sep-in-table", 212 | "miss-space-between", 213 | "miss-symbol", 214 | "missing-fields", 215 | "missing-global-doc", 216 | "missing-local-export-doc", 217 | "missing-parameter", 218 | "missing-return", 219 | "missing-return-value", 220 | "name-style-check", 221 | "need-check-nil", 222 | "need-paren", 223 | "nesting-long-mark", 224 | "newfield-call", 225 | "newline-call", 226 | "no-unknown", 227 | "no-visible-label", 228 | "not-yieldable", 229 | "param-type-mismatch", 230 | "redefined-label", 231 | "redefined-local", 232 | "redundant-parameter", 233 | "redundant-return", 234 | "redundant-return-value", 235 | "redundant-value", 236 | "return-type-mismatch", 237 | "set-const", 238 | "spell-check", 239 | "trailing-space", 240 | "unbalanced-assignments", 241 | "undefined-doc-class", 242 | "undefined-doc-name", 243 | "undefined-doc-param", 244 | "undefined-env-child", 245 | "undefined-field", 246 | "undefined-global", 247 | "unexpect-dots", 248 | "unexpect-efunc-name", 249 | "unexpect-lfunc-name", 250 | "unexpect-symbol", 251 | "unicode-name", 252 | "unknown-attribute", 253 | "unknown-cast-variable", 254 | "unknown-diag-code", 255 | "unknown-operator", 256 | "unknown-symbol", 257 | "unreachable-code", 258 | "unsupport-symbol", 259 | "unused-function", 260 | "unused-label", 261 | "unused-local", 262 | "unused-vararg" 263 | ], 264 | "type": "string" 265 | }, 266 | "markdownDescription": "Disabled diagnostic (Use code in hover brackets).", 267 | "type": "array" 268 | }, 269 | "Lua.diagnostics.disableScheme": { 270 | "default": [ 271 | "git" 272 | ], 273 | "items": { 274 | "type": "string" 275 | }, 276 | "markdownDescription": "Do not diagnose Lua files that use the following scheme.", 277 | "type": "array" 278 | }, 279 | "Lua.diagnostics.enable": { 280 | "default": true, 281 | "markdownDescription": "Enable diagnostics.", 282 | "type": "boolean" 283 | }, 284 | "Lua.diagnostics.globals": { 285 | "default": [], 286 | "items": { 287 | "type": "string" 288 | }, 289 | "markdownDescription": "Defined global variables.", 290 | "type": "array" 291 | }, 292 | "Lua.diagnostics.groupFileStatus": { 293 | "additionalProperties": false, 294 | "markdownDescription": "Modify the diagnostic needed file status in a group.\n\n* Opened: only diagnose opened files\n* Any: diagnose all files\n* None: disable this diagnostic\n\n`Fallback` means that diagnostics in this group are controlled by `diagnostics.neededFileStatus` separately.\nOther settings will override individual settings without end of `!`.\n", 295 | "properties": { 296 | "ambiguity": { 297 | "default": "Fallback", 298 | "description": "* ambiguity-1\n* count-down-loop\n* different-requires\n* newfield-call\n* newline-call", 299 | "enum": [ 300 | "Any", 301 | "Opened", 302 | "None", 303 | "Fallback" 304 | ], 305 | "type": "string" 306 | }, 307 | "await": { 308 | "default": "Fallback", 309 | "description": "* await-in-sync\n* not-yieldable", 310 | "enum": [ 311 | "Any", 312 | "Opened", 313 | "None", 314 | "Fallback" 315 | ], 316 | "type": "string" 317 | }, 318 | "codestyle": { 319 | "default": "Fallback", 320 | "description": "* codestyle-check\n* name-style-check\n* spell-check", 321 | "enum": [ 322 | "Any", 323 | "Opened", 324 | "None", 325 | "Fallback" 326 | ], 327 | "type": "string" 328 | }, 329 | "conventions": { 330 | "default": "Fallback", 331 | "description": "* global-element", 332 | "enum": [ 333 | "Any", 334 | "Opened", 335 | "None", 336 | "Fallback" 337 | ], 338 | "type": "string" 339 | }, 340 | "duplicate": { 341 | "default": "Fallback", 342 | "description": "* duplicate-index\n* duplicate-set-field", 343 | "enum": [ 344 | "Any", 345 | "Opened", 346 | "None", 347 | "Fallback" 348 | ], 349 | "type": "string" 350 | }, 351 | "global": { 352 | "default": "Fallback", 353 | "description": "* global-in-nil-env\n* lowercase-global\n* undefined-env-child\n* undefined-global", 354 | "enum": [ 355 | "Any", 356 | "Opened", 357 | "None", 358 | "Fallback" 359 | ], 360 | "type": "string" 361 | }, 362 | "luadoc": { 363 | "default": "Fallback", 364 | "description": "* circle-doc-class\n* doc-field-no-class\n* duplicate-doc-alias\n* duplicate-doc-field\n* duplicate-doc-param\n* incomplete-signature-doc\n* missing-global-doc\n* missing-local-export-doc\n* undefined-doc-class\n* undefined-doc-name\n* undefined-doc-param\n* unknown-cast-variable\n* unknown-diag-code\n* unknown-operator", 365 | "enum": [ 366 | "Any", 367 | "Opened", 368 | "None", 369 | "Fallback" 370 | ], 371 | "type": "string" 372 | }, 373 | "redefined": { 374 | "default": "Fallback", 375 | "description": "* redefined-local", 376 | "enum": [ 377 | "Any", 378 | "Opened", 379 | "None", 380 | "Fallback" 381 | ], 382 | "type": "string" 383 | }, 384 | "strict": { 385 | "default": "Fallback", 386 | "description": "* close-non-object\n* deprecated\n* discard-returns\n* invisible", 387 | "enum": [ 388 | "Any", 389 | "Opened", 390 | "None", 391 | "Fallback" 392 | ], 393 | "type": "string" 394 | }, 395 | "strong": { 396 | "default": "Fallback", 397 | "description": "* no-unknown", 398 | "enum": [ 399 | "Any", 400 | "Opened", 401 | "None", 402 | "Fallback" 403 | ], 404 | "type": "string" 405 | }, 406 | "type-check": { 407 | "default": "Fallback", 408 | "description": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* inject-field\n* need-check-nil\n* param-type-mismatch\n* return-type-mismatch\n* undefined-field", 409 | "enum": [ 410 | "Any", 411 | "Opened", 412 | "None", 413 | "Fallback" 414 | ], 415 | "type": "string" 416 | }, 417 | "unbalanced": { 418 | "default": "Fallback", 419 | "description": "* missing-fields\n* missing-parameter\n* missing-return\n* missing-return-value\n* redundant-parameter\n* redundant-return-value\n* redundant-value\n* unbalanced-assignments", 420 | "enum": [ 421 | "Any", 422 | "Opened", 423 | "None", 424 | "Fallback" 425 | ], 426 | "type": "string" 427 | }, 428 | "unused": { 429 | "default": "Fallback", 430 | "description": "* code-after-break\n* empty-block\n* redundant-return\n* trailing-space\n* unreachable-code\n* unused-function\n* unused-label\n* unused-local\n* unused-vararg", 431 | "enum": [ 432 | "Any", 433 | "Opened", 434 | "None", 435 | "Fallback" 436 | ], 437 | "type": "string" 438 | } 439 | }, 440 | "title": "groupFileStatus", 441 | "type": "object" 442 | }, 443 | "Lua.diagnostics.groupSeverity": { 444 | "additionalProperties": false, 445 | "markdownDescription": "Modify the diagnostic severity in a group.\n`Fallback` means that diagnostics in this group are controlled by `diagnostics.severity` separately.\nOther settings will override individual settings without end of `!`.\n", 446 | "properties": { 447 | "ambiguity": { 448 | "default": "Fallback", 449 | "description": "* ambiguity-1\n* count-down-loop\n* different-requires\n* newfield-call\n* newline-call", 450 | "enum": [ 451 | "Error", 452 | "Warning", 453 | "Information", 454 | "Hint", 455 | "Fallback" 456 | ], 457 | "type": "string" 458 | }, 459 | "await": { 460 | "default": "Fallback", 461 | "description": "* await-in-sync\n* not-yieldable", 462 | "enum": [ 463 | "Error", 464 | "Warning", 465 | "Information", 466 | "Hint", 467 | "Fallback" 468 | ], 469 | "type": "string" 470 | }, 471 | "codestyle": { 472 | "default": "Fallback", 473 | "description": "* codestyle-check\n* name-style-check\n* spell-check", 474 | "enum": [ 475 | "Error", 476 | "Warning", 477 | "Information", 478 | "Hint", 479 | "Fallback" 480 | ], 481 | "type": "string" 482 | }, 483 | "conventions": { 484 | "default": "Fallback", 485 | "description": "* global-element", 486 | "enum": [ 487 | "Error", 488 | "Warning", 489 | "Information", 490 | "Hint", 491 | "Fallback" 492 | ], 493 | "type": "string" 494 | }, 495 | "duplicate": { 496 | "default": "Fallback", 497 | "description": "* duplicate-index\n* duplicate-set-field", 498 | "enum": [ 499 | "Error", 500 | "Warning", 501 | "Information", 502 | "Hint", 503 | "Fallback" 504 | ], 505 | "type": "string" 506 | }, 507 | "global": { 508 | "default": "Fallback", 509 | "description": "* global-in-nil-env\n* lowercase-global\n* undefined-env-child\n* undefined-global", 510 | "enum": [ 511 | "Error", 512 | "Warning", 513 | "Information", 514 | "Hint", 515 | "Fallback" 516 | ], 517 | "type": "string" 518 | }, 519 | "luadoc": { 520 | "default": "Fallback", 521 | "description": "* circle-doc-class\n* doc-field-no-class\n* duplicate-doc-alias\n* duplicate-doc-field\n* duplicate-doc-param\n* incomplete-signature-doc\n* missing-global-doc\n* missing-local-export-doc\n* undefined-doc-class\n* undefined-doc-name\n* undefined-doc-param\n* unknown-cast-variable\n* unknown-diag-code\n* unknown-operator", 522 | "enum": [ 523 | "Error", 524 | "Warning", 525 | "Information", 526 | "Hint", 527 | "Fallback" 528 | ], 529 | "type": "string" 530 | }, 531 | "redefined": { 532 | "default": "Fallback", 533 | "description": "* redefined-local", 534 | "enum": [ 535 | "Error", 536 | "Warning", 537 | "Information", 538 | "Hint", 539 | "Fallback" 540 | ], 541 | "type": "string" 542 | }, 543 | "strict": { 544 | "default": "Fallback", 545 | "description": "* close-non-object\n* deprecated\n* discard-returns\n* invisible", 546 | "enum": [ 547 | "Error", 548 | "Warning", 549 | "Information", 550 | "Hint", 551 | "Fallback" 552 | ], 553 | "type": "string" 554 | }, 555 | "strong": { 556 | "default": "Fallback", 557 | "description": "* no-unknown", 558 | "enum": [ 559 | "Error", 560 | "Warning", 561 | "Information", 562 | "Hint", 563 | "Fallback" 564 | ], 565 | "type": "string" 566 | }, 567 | "type-check": { 568 | "default": "Fallback", 569 | "description": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* inject-field\n* need-check-nil\n* param-type-mismatch\n* return-type-mismatch\n* undefined-field", 570 | "enum": [ 571 | "Error", 572 | "Warning", 573 | "Information", 574 | "Hint", 575 | "Fallback" 576 | ], 577 | "type": "string" 578 | }, 579 | "unbalanced": { 580 | "default": "Fallback", 581 | "description": "* missing-fields\n* missing-parameter\n* missing-return\n* missing-return-value\n* redundant-parameter\n* redundant-return-value\n* redundant-value\n* unbalanced-assignments", 582 | "enum": [ 583 | "Error", 584 | "Warning", 585 | "Information", 586 | "Hint", 587 | "Fallback" 588 | ], 589 | "type": "string" 590 | }, 591 | "unused": { 592 | "default": "Fallback", 593 | "description": "* code-after-break\n* empty-block\n* redundant-return\n* trailing-space\n* unreachable-code\n* unused-function\n* unused-label\n* unused-local\n* unused-vararg", 594 | "enum": [ 595 | "Error", 596 | "Warning", 597 | "Information", 598 | "Hint", 599 | "Fallback" 600 | ], 601 | "type": "string" 602 | } 603 | }, 604 | "title": "groupSeverity", 605 | "type": "object" 606 | }, 607 | "Lua.diagnostics.ignoredFiles": { 608 | "default": "Opened", 609 | "enum": [ 610 | "Enable", 611 | "Opened", 612 | "Disable" 613 | ], 614 | "markdownDescription": "How to diagnose ignored files.", 615 | "markdownEnumDescriptions": [ 616 | "Always diagnose these files.", 617 | "Only when these files are opened will it be diagnosed.", 618 | "These files are not diagnosed." 619 | ], 620 | "type": "string" 621 | }, 622 | "Lua.diagnostics.libraryFiles": { 623 | "default": "Opened", 624 | "enum": [ 625 | "Enable", 626 | "Opened", 627 | "Disable" 628 | ], 629 | "markdownDescription": "How to diagnose files loaded via `Lua.workspace.library`.", 630 | "markdownEnumDescriptions": [ 631 | "Always diagnose these files.", 632 | "Only when these files are opened will it be diagnosed.", 633 | "These files are not diagnosed." 634 | ], 635 | "type": "string" 636 | }, 637 | "Lua.diagnostics.neededFileStatus": { 638 | "additionalProperties": false, 639 | "markdownDescription": "* Opened: only diagnose opened files\n* Any: diagnose all files\n* None: disable this diagnostic\n\nEnd with `!` means override the group setting `diagnostics.groupFileStatus`.\n", 640 | "properties": { 641 | "ambiguity-1": { 642 | "default": "Any", 643 | "description": "Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead.", 644 | "enum": [ 645 | "Any", 646 | "Opened", 647 | "None", 648 | "Any!", 649 | "Opened!", 650 | "None!" 651 | ], 652 | "type": "string" 653 | }, 654 | "assign-type-mismatch": { 655 | "default": "Opened", 656 | "description": "Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable.", 657 | "enum": [ 658 | "Any", 659 | "Opened", 660 | "None", 661 | "Any!", 662 | "Opened!", 663 | "None!" 664 | ], 665 | "type": "string" 666 | }, 667 | "await-in-sync": { 668 | "default": "None", 669 | "description": "Enable diagnostics for calls of asynchronous functions within a synchronous function.", 670 | "enum": [ 671 | "Any", 672 | "Opened", 673 | "None", 674 | "Any!", 675 | "Opened!", 676 | "None!" 677 | ], 678 | "type": "string" 679 | }, 680 | "cast-local-type": { 681 | "default": "Opened", 682 | "description": "Enable diagnostics for casts of local variables where the target type does not match the defined type.", 683 | "enum": [ 684 | "Any", 685 | "Opened", 686 | "None", 687 | "Any!", 688 | "Opened!", 689 | "None!" 690 | ], 691 | "type": "string" 692 | }, 693 | "cast-type-mismatch": { 694 | "default": "Opened", 695 | "description": "Enable diagnostics for casts where the target type does not match the initial type.", 696 | "enum": [ 697 | "Any", 698 | "Opened", 699 | "None", 700 | "Any!", 701 | "Opened!", 702 | "None!" 703 | ], 704 | "type": "string" 705 | }, 706 | "circle-doc-class": { 707 | "default": "Any", 708 | "description": "TODO: Needs documentation", 709 | "enum": [ 710 | "Any", 711 | "Opened", 712 | "None", 713 | "Any!", 714 | "Opened!", 715 | "None!" 716 | ], 717 | "type": "string" 718 | }, 719 | "close-non-object": { 720 | "default": "Any", 721 | "description": "Enable diagnostics for attempts to close a variable with a non-object.", 722 | "enum": [ 723 | "Any", 724 | "Opened", 725 | "None", 726 | "Any!", 727 | "Opened!", 728 | "None!" 729 | ], 730 | "type": "string" 731 | }, 732 | "code-after-break": { 733 | "default": "Opened", 734 | "description": "Enable diagnostics for code placed after a break statement in a loop.", 735 | "enum": [ 736 | "Any", 737 | "Opened", 738 | "None", 739 | "Any!", 740 | "Opened!", 741 | "None!" 742 | ], 743 | "type": "string" 744 | }, 745 | "codestyle-check": { 746 | "default": "None", 747 | "description": "Enable diagnostics for incorrectly styled lines.", 748 | "enum": [ 749 | "Any", 750 | "Opened", 751 | "None", 752 | "Any!", 753 | "Opened!", 754 | "None!" 755 | ], 756 | "type": "string" 757 | }, 758 | "count-down-loop": { 759 | "default": "Any", 760 | "description": "Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.", 761 | "enum": [ 762 | "Any", 763 | "Opened", 764 | "None", 765 | "Any!", 766 | "Opened!", 767 | "None!" 768 | ], 769 | "type": "string" 770 | }, 771 | "deprecated": { 772 | "default": "Any", 773 | "description": "Enable diagnostics to highlight deprecated API.", 774 | "enum": [ 775 | "Any", 776 | "Opened", 777 | "None", 778 | "Any!", 779 | "Opened!", 780 | "None!" 781 | ], 782 | "type": "string" 783 | }, 784 | "different-requires": { 785 | "default": "Any", 786 | "description": "Enable diagnostics for files which are required by two different paths.", 787 | "enum": [ 788 | "Any", 789 | "Opened", 790 | "None", 791 | "Any!", 792 | "Opened!", 793 | "None!" 794 | ], 795 | "type": "string" 796 | }, 797 | "discard-returns": { 798 | "default": "Any", 799 | "description": "Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.", 800 | "enum": [ 801 | "Any", 802 | "Opened", 803 | "None", 804 | "Any!", 805 | "Opened!", 806 | "None!" 807 | ], 808 | "type": "string" 809 | }, 810 | "doc-field-no-class": { 811 | "default": "Any", 812 | "description": "Enable diagnostics to highlight a field annotation without a defining class annotation.", 813 | "enum": [ 814 | "Any", 815 | "Opened", 816 | "None", 817 | "Any!", 818 | "Opened!", 819 | "None!" 820 | ], 821 | "type": "string" 822 | }, 823 | "duplicate-doc-alias": { 824 | "default": "Any", 825 | "description": "Enable diagnostics for a duplicated alias annotation name.", 826 | "enum": [ 827 | "Any", 828 | "Opened", 829 | "None", 830 | "Any!", 831 | "Opened!", 832 | "None!" 833 | ], 834 | "type": "string" 835 | }, 836 | "duplicate-doc-field": { 837 | "default": "Any", 838 | "description": "Enable diagnostics for a duplicated field annotation name.", 839 | "enum": [ 840 | "Any", 841 | "Opened", 842 | "None", 843 | "Any!", 844 | "Opened!", 845 | "None!" 846 | ], 847 | "type": "string" 848 | }, 849 | "duplicate-doc-param": { 850 | "default": "Any", 851 | "description": "Enable diagnostics for a duplicated param annotation name.", 852 | "enum": [ 853 | "Any", 854 | "Opened", 855 | "None", 856 | "Any!", 857 | "Opened!", 858 | "None!" 859 | ], 860 | "type": "string" 861 | }, 862 | "duplicate-index": { 863 | "default": "Any", 864 | "description": "Enable duplicate table index diagnostics.", 865 | "enum": [ 866 | "Any", 867 | "Opened", 868 | "None", 869 | "Any!", 870 | "Opened!", 871 | "None!" 872 | ], 873 | "type": "string" 874 | }, 875 | "duplicate-set-field": { 876 | "default": "Opened", 877 | "description": "Enable diagnostics for setting the same field in a class more than once.", 878 | "enum": [ 879 | "Any", 880 | "Opened", 881 | "None", 882 | "Any!", 883 | "Opened!", 884 | "None!" 885 | ], 886 | "type": "string" 887 | }, 888 | "empty-block": { 889 | "default": "Opened", 890 | "description": "Enable empty code block diagnostics.", 891 | "enum": [ 892 | "Any", 893 | "Opened", 894 | "None", 895 | "Any!", 896 | "Opened!", 897 | "None!" 898 | ], 899 | "type": "string" 900 | }, 901 | "global-element": { 902 | "default": "None", 903 | "description": "Enable diagnostics to warn about global elements.", 904 | "enum": [ 905 | "Any", 906 | "Opened", 907 | "None", 908 | "Any!", 909 | "Opened!", 910 | "None!" 911 | ], 912 | "type": "string" 913 | }, 914 | "global-in-nil-env": { 915 | "default": "Any", 916 | "description": "Enable cannot use global variables \uff08 `_ENV` is set to `nil`\uff09 diagnostics.", 917 | "enum": [ 918 | "Any", 919 | "Opened", 920 | "None", 921 | "Any!", 922 | "Opened!", 923 | "None!" 924 | ], 925 | "type": "string" 926 | }, 927 | "incomplete-signature-doc": { 928 | "default": "None", 929 | "description": "Incomplete @param or @return annotations for functions.", 930 | "enum": [ 931 | "Any", 932 | "Opened", 933 | "None", 934 | "Any!", 935 | "Opened!", 936 | "None!" 937 | ], 938 | "type": "string" 939 | }, 940 | "inject-field": { 941 | "default": "Opened", 942 | "description": "TODO: Needs documentation", 943 | "enum": [ 944 | "Any", 945 | "Opened", 946 | "None", 947 | "Any!", 948 | "Opened!", 949 | "None!" 950 | ], 951 | "type": "string" 952 | }, 953 | "invisible": { 954 | "default": "Any", 955 | "description": "Enable diagnostics for accesses to fields which are invisible.", 956 | "enum": [ 957 | "Any", 958 | "Opened", 959 | "None", 960 | "Any!", 961 | "Opened!", 962 | "None!" 963 | ], 964 | "type": "string" 965 | }, 966 | "lowercase-global": { 967 | "default": "Any", 968 | "description": "Enable lowercase global variable definition diagnostics.", 969 | "enum": [ 970 | "Any", 971 | "Opened", 972 | "None", 973 | "Any!", 974 | "Opened!", 975 | "None!" 976 | ], 977 | "type": "string" 978 | }, 979 | "missing-fields": { 980 | "default": "Any", 981 | "description": "TODO: Needs documentation", 982 | "enum": [ 983 | "Any", 984 | "Opened", 985 | "None", 986 | "Any!", 987 | "Opened!", 988 | "None!" 989 | ], 990 | "type": "string" 991 | }, 992 | "missing-global-doc": { 993 | "default": "None", 994 | "description": "Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.", 995 | "enum": [ 996 | "Any", 997 | "Opened", 998 | "None", 999 | "Any!", 1000 | "Opened!", 1001 | "None!" 1002 | ], 1003 | "type": "string" 1004 | }, 1005 | "missing-local-export-doc": { 1006 | "default": "None", 1007 | "description": "Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.", 1008 | "enum": [ 1009 | "Any", 1010 | "Opened", 1011 | "None", 1012 | "Any!", 1013 | "Opened!", 1014 | "None!" 1015 | ], 1016 | "type": "string" 1017 | }, 1018 | "missing-parameter": { 1019 | "default": "Any", 1020 | "description": "Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.", 1021 | "enum": [ 1022 | "Any", 1023 | "Opened", 1024 | "None", 1025 | "Any!", 1026 | "Opened!", 1027 | "None!" 1028 | ], 1029 | "type": "string" 1030 | }, 1031 | "missing-return": { 1032 | "default": "Any", 1033 | "description": "Enable diagnostics for functions with return annotations which have no return statement.", 1034 | "enum": [ 1035 | "Any", 1036 | "Opened", 1037 | "None", 1038 | "Any!", 1039 | "Opened!", 1040 | "None!" 1041 | ], 1042 | "type": "string" 1043 | }, 1044 | "missing-return-value": { 1045 | "default": "Any", 1046 | "description": "Enable diagnostics for return statements without values although the containing function declares returns.", 1047 | "enum": [ 1048 | "Any", 1049 | "Opened", 1050 | "None", 1051 | "Any!", 1052 | "Opened!", 1053 | "None!" 1054 | ], 1055 | "type": "string" 1056 | }, 1057 | "name-style-check": { 1058 | "default": "None", 1059 | "description": "Enable diagnostics for name style.", 1060 | "enum": [ 1061 | "Any", 1062 | "Opened", 1063 | "None", 1064 | "Any!", 1065 | "Opened!", 1066 | "None!" 1067 | ], 1068 | "type": "string" 1069 | }, 1070 | "need-check-nil": { 1071 | "default": "Opened", 1072 | "description": "Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.", 1073 | "enum": [ 1074 | "Any", 1075 | "Opened", 1076 | "None", 1077 | "Any!", 1078 | "Opened!", 1079 | "None!" 1080 | ], 1081 | "type": "string" 1082 | }, 1083 | "newfield-call": { 1084 | "default": "Any", 1085 | "description": "Enable newfield call diagnostics. It is raised when the parenthesis of a function call appear on the following line when defining a field in a table.", 1086 | "enum": [ 1087 | "Any", 1088 | "Opened", 1089 | "None", 1090 | "Any!", 1091 | "Opened!", 1092 | "None!" 1093 | ], 1094 | "type": "string" 1095 | }, 1096 | "newline-call": { 1097 | "default": "Any", 1098 | "description": "Enable newline call diagnostics. Is's raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.", 1099 | "enum": [ 1100 | "Any", 1101 | "Opened", 1102 | "None", 1103 | "Any!", 1104 | "Opened!", 1105 | "None!" 1106 | ], 1107 | "type": "string" 1108 | }, 1109 | "no-unknown": { 1110 | "default": "None", 1111 | "description": "Enable diagnostics for cases in which the type cannot be inferred.", 1112 | "enum": [ 1113 | "Any", 1114 | "Opened", 1115 | "None", 1116 | "Any!", 1117 | "Opened!", 1118 | "None!" 1119 | ], 1120 | "type": "string" 1121 | }, 1122 | "not-yieldable": { 1123 | "default": "None", 1124 | "description": "Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.", 1125 | "enum": [ 1126 | "Any", 1127 | "Opened", 1128 | "None", 1129 | "Any!", 1130 | "Opened!", 1131 | "None!" 1132 | ], 1133 | "type": "string" 1134 | }, 1135 | "param-type-mismatch": { 1136 | "default": "Opened", 1137 | "description": "Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.", 1138 | "enum": [ 1139 | "Any", 1140 | "Opened", 1141 | "None", 1142 | "Any!", 1143 | "Opened!", 1144 | "None!" 1145 | ], 1146 | "type": "string" 1147 | }, 1148 | "redefined-local": { 1149 | "default": "Opened", 1150 | "description": "Enable redefined local variable diagnostics.", 1151 | "enum": [ 1152 | "Any", 1153 | "Opened", 1154 | "None", 1155 | "Any!", 1156 | "Opened!", 1157 | "None!" 1158 | ], 1159 | "type": "string" 1160 | }, 1161 | "redundant-parameter": { 1162 | "default": "Any", 1163 | "description": "Enable redundant function parameter diagnostics.", 1164 | "enum": [ 1165 | "Any", 1166 | "Opened", 1167 | "None", 1168 | "Any!", 1169 | "Opened!", 1170 | "None!" 1171 | ], 1172 | "type": "string" 1173 | }, 1174 | "redundant-return": { 1175 | "default": "Opened", 1176 | "description": "Enable diagnostics for return statements which are not needed because the function would exit on its own.", 1177 | "enum": [ 1178 | "Any", 1179 | "Opened", 1180 | "None", 1181 | "Any!", 1182 | "Opened!", 1183 | "None!" 1184 | ], 1185 | "type": "string" 1186 | }, 1187 | "redundant-return-value": { 1188 | "default": "Any", 1189 | "description": "Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.", 1190 | "enum": [ 1191 | "Any", 1192 | "Opened", 1193 | "None", 1194 | "Any!", 1195 | "Opened!", 1196 | "None!" 1197 | ], 1198 | "type": "string" 1199 | }, 1200 | "redundant-value": { 1201 | "default": "Any", 1202 | "description": "Enable the redundant values assigned diagnostics. It's raised during assignment operation, when the number of values is higher than the number of objects being assigned.", 1203 | "enum": [ 1204 | "Any", 1205 | "Opened", 1206 | "None", 1207 | "Any!", 1208 | "Opened!", 1209 | "None!" 1210 | ], 1211 | "type": "string" 1212 | }, 1213 | "return-type-mismatch": { 1214 | "default": "Opened", 1215 | "description": "Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.", 1216 | "enum": [ 1217 | "Any", 1218 | "Opened", 1219 | "None", 1220 | "Any!", 1221 | "Opened!", 1222 | "None!" 1223 | ], 1224 | "type": "string" 1225 | }, 1226 | "spell-check": { 1227 | "default": "None", 1228 | "description": "Enable diagnostics for typos in strings.", 1229 | "enum": [ 1230 | "Any", 1231 | "Opened", 1232 | "None", 1233 | "Any!", 1234 | "Opened!", 1235 | "None!" 1236 | ], 1237 | "type": "string" 1238 | }, 1239 | "trailing-space": { 1240 | "default": "Opened", 1241 | "description": "Enable trailing space diagnostics.", 1242 | "enum": [ 1243 | "Any", 1244 | "Opened", 1245 | "None", 1246 | "Any!", 1247 | "Opened!", 1248 | "None!" 1249 | ], 1250 | "type": "string" 1251 | }, 1252 | "unbalanced-assignments": { 1253 | "default": "Any", 1254 | "description": "Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).", 1255 | "enum": [ 1256 | "Any", 1257 | "Opened", 1258 | "None", 1259 | "Any!", 1260 | "Opened!", 1261 | "None!" 1262 | ], 1263 | "type": "string" 1264 | }, 1265 | "undefined-doc-class": { 1266 | "default": "Any", 1267 | "description": "Enable diagnostics for class annotations in which an undefined class is referenced.", 1268 | "enum": [ 1269 | "Any", 1270 | "Opened", 1271 | "None", 1272 | "Any!", 1273 | "Opened!", 1274 | "None!" 1275 | ], 1276 | "type": "string" 1277 | }, 1278 | "undefined-doc-name": { 1279 | "default": "Any", 1280 | "description": "Enable diagnostics for type annotations referencing an undefined type or alias.", 1281 | "enum": [ 1282 | "Any", 1283 | "Opened", 1284 | "None", 1285 | "Any!", 1286 | "Opened!", 1287 | "None!" 1288 | ], 1289 | "type": "string" 1290 | }, 1291 | "undefined-doc-param": { 1292 | "default": "Any", 1293 | "description": "Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.", 1294 | "enum": [ 1295 | "Any", 1296 | "Opened", 1297 | "None", 1298 | "Any!", 1299 | "Opened!", 1300 | "None!" 1301 | ], 1302 | "type": "string" 1303 | }, 1304 | "undefined-env-child": { 1305 | "default": "Any", 1306 | "description": "Enable undefined environment variable diagnostics. It's raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment.", 1307 | "enum": [ 1308 | "Any", 1309 | "Opened", 1310 | "None", 1311 | "Any!", 1312 | "Opened!", 1313 | "None!" 1314 | ], 1315 | "type": "string" 1316 | }, 1317 | "undefined-field": { 1318 | "default": "Opened", 1319 | "description": "Enable diagnostics for cases in which an undefined field of a variable is read.", 1320 | "enum": [ 1321 | "Any", 1322 | "Opened", 1323 | "None", 1324 | "Any!", 1325 | "Opened!", 1326 | "None!" 1327 | ], 1328 | "type": "string" 1329 | }, 1330 | "undefined-global": { 1331 | "default": "Any", 1332 | "description": "Enable undefined global variable diagnostics.", 1333 | "enum": [ 1334 | "Any", 1335 | "Opened", 1336 | "None", 1337 | "Any!", 1338 | "Opened!", 1339 | "None!" 1340 | ], 1341 | "type": "string" 1342 | }, 1343 | "unknown-cast-variable": { 1344 | "default": "Any", 1345 | "description": "Enable diagnostics for casts of undefined variables.", 1346 | "enum": [ 1347 | "Any", 1348 | "Opened", 1349 | "None", 1350 | "Any!", 1351 | "Opened!", 1352 | "None!" 1353 | ], 1354 | "type": "string" 1355 | }, 1356 | "unknown-diag-code": { 1357 | "default": "Any", 1358 | "description": "Enable diagnostics in cases in which an unknown diagnostics code is entered.", 1359 | "enum": [ 1360 | "Any", 1361 | "Opened", 1362 | "None", 1363 | "Any!", 1364 | "Opened!", 1365 | "None!" 1366 | ], 1367 | "type": "string" 1368 | }, 1369 | "unknown-operator": { 1370 | "default": "Any", 1371 | "description": "Enable diagnostics for unknown operators.", 1372 | "enum": [ 1373 | "Any", 1374 | "Opened", 1375 | "None", 1376 | "Any!", 1377 | "Opened!", 1378 | "None!" 1379 | ], 1380 | "type": "string" 1381 | }, 1382 | "unreachable-code": { 1383 | "default": "Opened", 1384 | "description": "Enable diagnostics for unreachable code.", 1385 | "enum": [ 1386 | "Any", 1387 | "Opened", 1388 | "None", 1389 | "Any!", 1390 | "Opened!", 1391 | "None!" 1392 | ], 1393 | "type": "string" 1394 | }, 1395 | "unused-function": { 1396 | "default": "Opened", 1397 | "description": "Enable unused function diagnostics.", 1398 | "enum": [ 1399 | "Any", 1400 | "Opened", 1401 | "None", 1402 | "Any!", 1403 | "Opened!", 1404 | "None!" 1405 | ], 1406 | "type": "string" 1407 | }, 1408 | "unused-label": { 1409 | "default": "Opened", 1410 | "description": "Enable unused label diagnostics.", 1411 | "enum": [ 1412 | "Any", 1413 | "Opened", 1414 | "None", 1415 | "Any!", 1416 | "Opened!", 1417 | "None!" 1418 | ], 1419 | "type": "string" 1420 | }, 1421 | "unused-local": { 1422 | "default": "Opened", 1423 | "description": "Enable unused local variable diagnostics.", 1424 | "enum": [ 1425 | "Any", 1426 | "Opened", 1427 | "None", 1428 | "Any!", 1429 | "Opened!", 1430 | "None!" 1431 | ], 1432 | "type": "string" 1433 | }, 1434 | "unused-vararg": { 1435 | "default": "Opened", 1436 | "description": "Enable unused vararg diagnostics.", 1437 | "enum": [ 1438 | "Any", 1439 | "Opened", 1440 | "None", 1441 | "Any!", 1442 | "Opened!", 1443 | "None!" 1444 | ], 1445 | "type": "string" 1446 | } 1447 | }, 1448 | "title": "neededFileStatus", 1449 | "type": "object" 1450 | }, 1451 | "Lua.diagnostics.severity": { 1452 | "additionalProperties": false, 1453 | "markdownDescription": "Modify the diagnostic severity.\n\nEnd with `!` means override the group setting `diagnostics.groupSeverity`.\n", 1454 | "properties": { 1455 | "ambiguity-1": { 1456 | "default": "Warning", 1457 | "description": "Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead.", 1458 | "enum": [ 1459 | "Error", 1460 | "Warning", 1461 | "Information", 1462 | "Hint", 1463 | "Error!", 1464 | "Warning!", 1465 | "Information!", 1466 | "Hint!" 1467 | ], 1468 | "type": "string" 1469 | }, 1470 | "assign-type-mismatch": { 1471 | "default": "Warning", 1472 | "description": "Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable.", 1473 | "enum": [ 1474 | "Error", 1475 | "Warning", 1476 | "Information", 1477 | "Hint", 1478 | "Error!", 1479 | "Warning!", 1480 | "Information!", 1481 | "Hint!" 1482 | ], 1483 | "type": "string" 1484 | }, 1485 | "await-in-sync": { 1486 | "default": "Warning", 1487 | "description": "Enable diagnostics for calls of asynchronous functions within a synchronous function.", 1488 | "enum": [ 1489 | "Error", 1490 | "Warning", 1491 | "Information", 1492 | "Hint", 1493 | "Error!", 1494 | "Warning!", 1495 | "Information!", 1496 | "Hint!" 1497 | ], 1498 | "type": "string" 1499 | }, 1500 | "cast-local-type": { 1501 | "default": "Warning", 1502 | "description": "Enable diagnostics for casts of local variables where the target type does not match the defined type.", 1503 | "enum": [ 1504 | "Error", 1505 | "Warning", 1506 | "Information", 1507 | "Hint", 1508 | "Error!", 1509 | "Warning!", 1510 | "Information!", 1511 | "Hint!" 1512 | ], 1513 | "type": "string" 1514 | }, 1515 | "cast-type-mismatch": { 1516 | "default": "Warning", 1517 | "description": "Enable diagnostics for casts where the target type does not match the initial type.", 1518 | "enum": [ 1519 | "Error", 1520 | "Warning", 1521 | "Information", 1522 | "Hint", 1523 | "Error!", 1524 | "Warning!", 1525 | "Information!", 1526 | "Hint!" 1527 | ], 1528 | "type": "string" 1529 | }, 1530 | "circle-doc-class": { 1531 | "default": "Warning", 1532 | "description": "TODO: Needs documentation", 1533 | "enum": [ 1534 | "Error", 1535 | "Warning", 1536 | "Information", 1537 | "Hint", 1538 | "Error!", 1539 | "Warning!", 1540 | "Information!", 1541 | "Hint!" 1542 | ], 1543 | "type": "string" 1544 | }, 1545 | "close-non-object": { 1546 | "default": "Warning", 1547 | "description": "Enable diagnostics for attempts to close a variable with a non-object.", 1548 | "enum": [ 1549 | "Error", 1550 | "Warning", 1551 | "Information", 1552 | "Hint", 1553 | "Error!", 1554 | "Warning!", 1555 | "Information!", 1556 | "Hint!" 1557 | ], 1558 | "type": "string" 1559 | }, 1560 | "code-after-break": { 1561 | "default": "Hint", 1562 | "description": "Enable diagnostics for code placed after a break statement in a loop.", 1563 | "enum": [ 1564 | "Error", 1565 | "Warning", 1566 | "Information", 1567 | "Hint", 1568 | "Error!", 1569 | "Warning!", 1570 | "Information!", 1571 | "Hint!" 1572 | ], 1573 | "type": "string" 1574 | }, 1575 | "codestyle-check": { 1576 | "default": "Warning", 1577 | "description": "Enable diagnostics for incorrectly styled lines.", 1578 | "enum": [ 1579 | "Error", 1580 | "Warning", 1581 | "Information", 1582 | "Hint", 1583 | "Error!", 1584 | "Warning!", 1585 | "Information!", 1586 | "Hint!" 1587 | ], 1588 | "type": "string" 1589 | }, 1590 | "count-down-loop": { 1591 | "default": "Warning", 1592 | "description": "Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.", 1593 | "enum": [ 1594 | "Error", 1595 | "Warning", 1596 | "Information", 1597 | "Hint", 1598 | "Error!", 1599 | "Warning!", 1600 | "Information!", 1601 | "Hint!" 1602 | ], 1603 | "type": "string" 1604 | }, 1605 | "deprecated": { 1606 | "default": "Warning", 1607 | "description": "Enable diagnostics to highlight deprecated API.", 1608 | "enum": [ 1609 | "Error", 1610 | "Warning", 1611 | "Information", 1612 | "Hint", 1613 | "Error!", 1614 | "Warning!", 1615 | "Information!", 1616 | "Hint!" 1617 | ], 1618 | "type": "string" 1619 | }, 1620 | "different-requires": { 1621 | "default": "Warning", 1622 | "description": "Enable diagnostics for files which are required by two different paths.", 1623 | "enum": [ 1624 | "Error", 1625 | "Warning", 1626 | "Information", 1627 | "Hint", 1628 | "Error!", 1629 | "Warning!", 1630 | "Information!", 1631 | "Hint!" 1632 | ], 1633 | "type": "string" 1634 | }, 1635 | "discard-returns": { 1636 | "default": "Warning", 1637 | "description": "Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.", 1638 | "enum": [ 1639 | "Error", 1640 | "Warning", 1641 | "Information", 1642 | "Hint", 1643 | "Error!", 1644 | "Warning!", 1645 | "Information!", 1646 | "Hint!" 1647 | ], 1648 | "type": "string" 1649 | }, 1650 | "doc-field-no-class": { 1651 | "default": "Warning", 1652 | "description": "Enable diagnostics to highlight a field annotation without a defining class annotation.", 1653 | "enum": [ 1654 | "Error", 1655 | "Warning", 1656 | "Information", 1657 | "Hint", 1658 | "Error!", 1659 | "Warning!", 1660 | "Information!", 1661 | "Hint!" 1662 | ], 1663 | "type": "string" 1664 | }, 1665 | "duplicate-doc-alias": { 1666 | "default": "Warning", 1667 | "description": "Enable diagnostics for a duplicated alias annotation name.", 1668 | "enum": [ 1669 | "Error", 1670 | "Warning", 1671 | "Information", 1672 | "Hint", 1673 | "Error!", 1674 | "Warning!", 1675 | "Information!", 1676 | "Hint!" 1677 | ], 1678 | "type": "string" 1679 | }, 1680 | "duplicate-doc-field": { 1681 | "default": "Warning", 1682 | "description": "Enable diagnostics for a duplicated field annotation name.", 1683 | "enum": [ 1684 | "Error", 1685 | "Warning", 1686 | "Information", 1687 | "Hint", 1688 | "Error!", 1689 | "Warning!", 1690 | "Information!", 1691 | "Hint!" 1692 | ], 1693 | "type": "string" 1694 | }, 1695 | "duplicate-doc-param": { 1696 | "default": "Warning", 1697 | "description": "Enable diagnostics for a duplicated param annotation name.", 1698 | "enum": [ 1699 | "Error", 1700 | "Warning", 1701 | "Information", 1702 | "Hint", 1703 | "Error!", 1704 | "Warning!", 1705 | "Information!", 1706 | "Hint!" 1707 | ], 1708 | "type": "string" 1709 | }, 1710 | "duplicate-index": { 1711 | "default": "Warning", 1712 | "description": "Enable duplicate table index diagnostics.", 1713 | "enum": [ 1714 | "Error", 1715 | "Warning", 1716 | "Information", 1717 | "Hint", 1718 | "Error!", 1719 | "Warning!", 1720 | "Information!", 1721 | "Hint!" 1722 | ], 1723 | "type": "string" 1724 | }, 1725 | "duplicate-set-field": { 1726 | "default": "Warning", 1727 | "description": "Enable diagnostics for setting the same field in a class more than once.", 1728 | "enum": [ 1729 | "Error", 1730 | "Warning", 1731 | "Information", 1732 | "Hint", 1733 | "Error!", 1734 | "Warning!", 1735 | "Information!", 1736 | "Hint!" 1737 | ], 1738 | "type": "string" 1739 | }, 1740 | "empty-block": { 1741 | "default": "Hint", 1742 | "description": "Enable empty code block diagnostics.", 1743 | "enum": [ 1744 | "Error", 1745 | "Warning", 1746 | "Information", 1747 | "Hint", 1748 | "Error!", 1749 | "Warning!", 1750 | "Information!", 1751 | "Hint!" 1752 | ], 1753 | "type": "string" 1754 | }, 1755 | "global-element": { 1756 | "default": "Warning", 1757 | "description": "Enable diagnostics to warn about global elements.", 1758 | "enum": [ 1759 | "Error", 1760 | "Warning", 1761 | "Information", 1762 | "Hint", 1763 | "Error!", 1764 | "Warning!", 1765 | "Information!", 1766 | "Hint!" 1767 | ], 1768 | "type": "string" 1769 | }, 1770 | "global-in-nil-env": { 1771 | "default": "Warning", 1772 | "description": "Enable cannot use global variables \uff08 `_ENV` is set to `nil`\uff09 diagnostics.", 1773 | "enum": [ 1774 | "Error", 1775 | "Warning", 1776 | "Information", 1777 | "Hint", 1778 | "Error!", 1779 | "Warning!", 1780 | "Information!", 1781 | "Hint!" 1782 | ], 1783 | "type": "string" 1784 | }, 1785 | "incomplete-signature-doc": { 1786 | "default": "Warning", 1787 | "description": "Incomplete @param or @return annotations for functions.", 1788 | "enum": [ 1789 | "Error", 1790 | "Warning", 1791 | "Information", 1792 | "Hint", 1793 | "Error!", 1794 | "Warning!", 1795 | "Information!", 1796 | "Hint!" 1797 | ], 1798 | "type": "string" 1799 | }, 1800 | "inject-field": { 1801 | "default": "Warning", 1802 | "description": "TODO: Needs documentation", 1803 | "enum": [ 1804 | "Error", 1805 | "Warning", 1806 | "Information", 1807 | "Hint", 1808 | "Error!", 1809 | "Warning!", 1810 | "Information!", 1811 | "Hint!" 1812 | ], 1813 | "type": "string" 1814 | }, 1815 | "invisible": { 1816 | "default": "Warning", 1817 | "description": "Enable diagnostics for accesses to fields which are invisible.", 1818 | "enum": [ 1819 | "Error", 1820 | "Warning", 1821 | "Information", 1822 | "Hint", 1823 | "Error!", 1824 | "Warning!", 1825 | "Information!", 1826 | "Hint!" 1827 | ], 1828 | "type": "string" 1829 | }, 1830 | "lowercase-global": { 1831 | "default": "Information", 1832 | "description": "Enable lowercase global variable definition diagnostics.", 1833 | "enum": [ 1834 | "Error", 1835 | "Warning", 1836 | "Information", 1837 | "Hint", 1838 | "Error!", 1839 | "Warning!", 1840 | "Information!", 1841 | "Hint!" 1842 | ], 1843 | "type": "string" 1844 | }, 1845 | "missing-fields": { 1846 | "default": "Warning", 1847 | "description": "TODO: Needs documentation", 1848 | "enum": [ 1849 | "Error", 1850 | "Warning", 1851 | "Information", 1852 | "Hint", 1853 | "Error!", 1854 | "Warning!", 1855 | "Information!", 1856 | "Hint!" 1857 | ], 1858 | "type": "string" 1859 | }, 1860 | "missing-global-doc": { 1861 | "default": "Warning", 1862 | "description": "Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.", 1863 | "enum": [ 1864 | "Error", 1865 | "Warning", 1866 | "Information", 1867 | "Hint", 1868 | "Error!", 1869 | "Warning!", 1870 | "Information!", 1871 | "Hint!" 1872 | ], 1873 | "type": "string" 1874 | }, 1875 | "missing-local-export-doc": { 1876 | "default": "Warning", 1877 | "description": "Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.", 1878 | "enum": [ 1879 | "Error", 1880 | "Warning", 1881 | "Information", 1882 | "Hint", 1883 | "Error!", 1884 | "Warning!", 1885 | "Information!", 1886 | "Hint!" 1887 | ], 1888 | "type": "string" 1889 | }, 1890 | "missing-parameter": { 1891 | "default": "Warning", 1892 | "description": "Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.", 1893 | "enum": [ 1894 | "Error", 1895 | "Warning", 1896 | "Information", 1897 | "Hint", 1898 | "Error!", 1899 | "Warning!", 1900 | "Information!", 1901 | "Hint!" 1902 | ], 1903 | "type": "string" 1904 | }, 1905 | "missing-return": { 1906 | "default": "Warning", 1907 | "description": "Enable diagnostics for functions with return annotations which have no return statement.", 1908 | "enum": [ 1909 | "Error", 1910 | "Warning", 1911 | "Information", 1912 | "Hint", 1913 | "Error!", 1914 | "Warning!", 1915 | "Information!", 1916 | "Hint!" 1917 | ], 1918 | "type": "string" 1919 | }, 1920 | "missing-return-value": { 1921 | "default": "Warning", 1922 | "description": "Enable diagnostics for return statements without values although the containing function declares returns.", 1923 | "enum": [ 1924 | "Error", 1925 | "Warning", 1926 | "Information", 1927 | "Hint", 1928 | "Error!", 1929 | "Warning!", 1930 | "Information!", 1931 | "Hint!" 1932 | ], 1933 | "type": "string" 1934 | }, 1935 | "name-style-check": { 1936 | "default": "Warning", 1937 | "description": "Enable diagnostics for name style.", 1938 | "enum": [ 1939 | "Error", 1940 | "Warning", 1941 | "Information", 1942 | "Hint", 1943 | "Error!", 1944 | "Warning!", 1945 | "Information!", 1946 | "Hint!" 1947 | ], 1948 | "type": "string" 1949 | }, 1950 | "need-check-nil": { 1951 | "default": "Warning", 1952 | "description": "Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.", 1953 | "enum": [ 1954 | "Error", 1955 | "Warning", 1956 | "Information", 1957 | "Hint", 1958 | "Error!", 1959 | "Warning!", 1960 | "Information!", 1961 | "Hint!" 1962 | ], 1963 | "type": "string" 1964 | }, 1965 | "newfield-call": { 1966 | "default": "Warning", 1967 | "description": "Enable newfield call diagnostics. It is raised when the parenthesis of a function call appear on the following line when defining a field in a table.", 1968 | "enum": [ 1969 | "Error", 1970 | "Warning", 1971 | "Information", 1972 | "Hint", 1973 | "Error!", 1974 | "Warning!", 1975 | "Information!", 1976 | "Hint!" 1977 | ], 1978 | "type": "string" 1979 | }, 1980 | "newline-call": { 1981 | "default": "Warning", 1982 | "description": "Enable newline call diagnostics. Is's raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.", 1983 | "enum": [ 1984 | "Error", 1985 | "Warning", 1986 | "Information", 1987 | "Hint", 1988 | "Error!", 1989 | "Warning!", 1990 | "Information!", 1991 | "Hint!" 1992 | ], 1993 | "type": "string" 1994 | }, 1995 | "no-unknown": { 1996 | "default": "Warning", 1997 | "description": "Enable diagnostics for cases in which the type cannot be inferred.", 1998 | "enum": [ 1999 | "Error", 2000 | "Warning", 2001 | "Information", 2002 | "Hint", 2003 | "Error!", 2004 | "Warning!", 2005 | "Information!", 2006 | "Hint!" 2007 | ], 2008 | "type": "string" 2009 | }, 2010 | "not-yieldable": { 2011 | "default": "Warning", 2012 | "description": "Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.", 2013 | "enum": [ 2014 | "Error", 2015 | "Warning", 2016 | "Information", 2017 | "Hint", 2018 | "Error!", 2019 | "Warning!", 2020 | "Information!", 2021 | "Hint!" 2022 | ], 2023 | "type": "string" 2024 | }, 2025 | "param-type-mismatch": { 2026 | "default": "Warning", 2027 | "description": "Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.", 2028 | "enum": [ 2029 | "Error", 2030 | "Warning", 2031 | "Information", 2032 | "Hint", 2033 | "Error!", 2034 | "Warning!", 2035 | "Information!", 2036 | "Hint!" 2037 | ], 2038 | "type": "string" 2039 | }, 2040 | "redefined-local": { 2041 | "default": "Hint", 2042 | "description": "Enable redefined local variable diagnostics.", 2043 | "enum": [ 2044 | "Error", 2045 | "Warning", 2046 | "Information", 2047 | "Hint", 2048 | "Error!", 2049 | "Warning!", 2050 | "Information!", 2051 | "Hint!" 2052 | ], 2053 | "type": "string" 2054 | }, 2055 | "redundant-parameter": { 2056 | "default": "Warning", 2057 | "description": "Enable redundant function parameter diagnostics.", 2058 | "enum": [ 2059 | "Error", 2060 | "Warning", 2061 | "Information", 2062 | "Hint", 2063 | "Error!", 2064 | "Warning!", 2065 | "Information!", 2066 | "Hint!" 2067 | ], 2068 | "type": "string" 2069 | }, 2070 | "redundant-return": { 2071 | "default": "Hint", 2072 | "description": "Enable diagnostics for return statements which are not needed because the function would exit on its own.", 2073 | "enum": [ 2074 | "Error", 2075 | "Warning", 2076 | "Information", 2077 | "Hint", 2078 | "Error!", 2079 | "Warning!", 2080 | "Information!", 2081 | "Hint!" 2082 | ], 2083 | "type": "string" 2084 | }, 2085 | "redundant-return-value": { 2086 | "default": "Warning", 2087 | "description": "Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.", 2088 | "enum": [ 2089 | "Error", 2090 | "Warning", 2091 | "Information", 2092 | "Hint", 2093 | "Error!", 2094 | "Warning!", 2095 | "Information!", 2096 | "Hint!" 2097 | ], 2098 | "type": "string" 2099 | }, 2100 | "redundant-value": { 2101 | "default": "Warning", 2102 | "description": "Enable the redundant values assigned diagnostics. It's raised during assignment operation, when the number of values is higher than the number of objects being assigned.", 2103 | "enum": [ 2104 | "Error", 2105 | "Warning", 2106 | "Information", 2107 | "Hint", 2108 | "Error!", 2109 | "Warning!", 2110 | "Information!", 2111 | "Hint!" 2112 | ], 2113 | "type": "string" 2114 | }, 2115 | "return-type-mismatch": { 2116 | "default": "Warning", 2117 | "description": "Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.", 2118 | "enum": [ 2119 | "Error", 2120 | "Warning", 2121 | "Information", 2122 | "Hint", 2123 | "Error!", 2124 | "Warning!", 2125 | "Information!", 2126 | "Hint!" 2127 | ], 2128 | "type": "string" 2129 | }, 2130 | "spell-check": { 2131 | "default": "Information", 2132 | "description": "Enable diagnostics for typos in strings.", 2133 | "enum": [ 2134 | "Error", 2135 | "Warning", 2136 | "Information", 2137 | "Hint", 2138 | "Error!", 2139 | "Warning!", 2140 | "Information!", 2141 | "Hint!" 2142 | ], 2143 | "type": "string" 2144 | }, 2145 | "trailing-space": { 2146 | "default": "Hint", 2147 | "description": "Enable trailing space diagnostics.", 2148 | "enum": [ 2149 | "Error", 2150 | "Warning", 2151 | "Information", 2152 | "Hint", 2153 | "Error!", 2154 | "Warning!", 2155 | "Information!", 2156 | "Hint!" 2157 | ], 2158 | "type": "string" 2159 | }, 2160 | "unbalanced-assignments": { 2161 | "default": "Warning", 2162 | "description": "Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).", 2163 | "enum": [ 2164 | "Error", 2165 | "Warning", 2166 | "Information", 2167 | "Hint", 2168 | "Error!", 2169 | "Warning!", 2170 | "Information!", 2171 | "Hint!" 2172 | ], 2173 | "type": "string" 2174 | }, 2175 | "undefined-doc-class": { 2176 | "default": "Warning", 2177 | "description": "Enable diagnostics for class annotations in which an undefined class is referenced.", 2178 | "enum": [ 2179 | "Error", 2180 | "Warning", 2181 | "Information", 2182 | "Hint", 2183 | "Error!", 2184 | "Warning!", 2185 | "Information!", 2186 | "Hint!" 2187 | ], 2188 | "type": "string" 2189 | }, 2190 | "undefined-doc-name": { 2191 | "default": "Warning", 2192 | "description": "Enable diagnostics for type annotations referencing an undefined type or alias.", 2193 | "enum": [ 2194 | "Error", 2195 | "Warning", 2196 | "Information", 2197 | "Hint", 2198 | "Error!", 2199 | "Warning!", 2200 | "Information!", 2201 | "Hint!" 2202 | ], 2203 | "type": "string" 2204 | }, 2205 | "undefined-doc-param": { 2206 | "default": "Warning", 2207 | "description": "Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.", 2208 | "enum": [ 2209 | "Error", 2210 | "Warning", 2211 | "Information", 2212 | "Hint", 2213 | "Error!", 2214 | "Warning!", 2215 | "Information!", 2216 | "Hint!" 2217 | ], 2218 | "type": "string" 2219 | }, 2220 | "undefined-env-child": { 2221 | "default": "Information", 2222 | "description": "Enable undefined environment variable diagnostics. It's raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment.", 2223 | "enum": [ 2224 | "Error", 2225 | "Warning", 2226 | "Information", 2227 | "Hint", 2228 | "Error!", 2229 | "Warning!", 2230 | "Information!", 2231 | "Hint!" 2232 | ], 2233 | "type": "string" 2234 | }, 2235 | "undefined-field": { 2236 | "default": "Warning", 2237 | "description": "Enable diagnostics for cases in which an undefined field of a variable is read.", 2238 | "enum": [ 2239 | "Error", 2240 | "Warning", 2241 | "Information", 2242 | "Hint", 2243 | "Error!", 2244 | "Warning!", 2245 | "Information!", 2246 | "Hint!" 2247 | ], 2248 | "type": "string" 2249 | }, 2250 | "undefined-global": { 2251 | "default": "Warning", 2252 | "description": "Enable undefined global variable diagnostics.", 2253 | "enum": [ 2254 | "Error", 2255 | "Warning", 2256 | "Information", 2257 | "Hint", 2258 | "Error!", 2259 | "Warning!", 2260 | "Information!", 2261 | "Hint!" 2262 | ], 2263 | "type": "string" 2264 | }, 2265 | "unknown-cast-variable": { 2266 | "default": "Warning", 2267 | "description": "Enable diagnostics for casts of undefined variables.", 2268 | "enum": [ 2269 | "Error", 2270 | "Warning", 2271 | "Information", 2272 | "Hint", 2273 | "Error!", 2274 | "Warning!", 2275 | "Information!", 2276 | "Hint!" 2277 | ], 2278 | "type": "string" 2279 | }, 2280 | "unknown-diag-code": { 2281 | "default": "Warning", 2282 | "description": "Enable diagnostics in cases in which an unknown diagnostics code is entered.", 2283 | "enum": [ 2284 | "Error", 2285 | "Warning", 2286 | "Information", 2287 | "Hint", 2288 | "Error!", 2289 | "Warning!", 2290 | "Information!", 2291 | "Hint!" 2292 | ], 2293 | "type": "string" 2294 | }, 2295 | "unknown-operator": { 2296 | "default": "Warning", 2297 | "description": "Enable diagnostics for unknown operators.", 2298 | "enum": [ 2299 | "Error", 2300 | "Warning", 2301 | "Information", 2302 | "Hint", 2303 | "Error!", 2304 | "Warning!", 2305 | "Information!", 2306 | "Hint!" 2307 | ], 2308 | "type": "string" 2309 | }, 2310 | "unreachable-code": { 2311 | "default": "Hint", 2312 | "description": "Enable diagnostics for unreachable code.", 2313 | "enum": [ 2314 | "Error", 2315 | "Warning", 2316 | "Information", 2317 | "Hint", 2318 | "Error!", 2319 | "Warning!", 2320 | "Information!", 2321 | "Hint!" 2322 | ], 2323 | "type": "string" 2324 | }, 2325 | "unused-function": { 2326 | "default": "Hint", 2327 | "description": "Enable unused function diagnostics.", 2328 | "enum": [ 2329 | "Error", 2330 | "Warning", 2331 | "Information", 2332 | "Hint", 2333 | "Error!", 2334 | "Warning!", 2335 | "Information!", 2336 | "Hint!" 2337 | ], 2338 | "type": "string" 2339 | }, 2340 | "unused-label": { 2341 | "default": "Hint", 2342 | "description": "Enable unused label diagnostics.", 2343 | "enum": [ 2344 | "Error", 2345 | "Warning", 2346 | "Information", 2347 | "Hint", 2348 | "Error!", 2349 | "Warning!", 2350 | "Information!", 2351 | "Hint!" 2352 | ], 2353 | "type": "string" 2354 | }, 2355 | "unused-local": { 2356 | "default": "Hint", 2357 | "description": "Enable unused local variable diagnostics.", 2358 | "enum": [ 2359 | "Error", 2360 | "Warning", 2361 | "Information", 2362 | "Hint", 2363 | "Error!", 2364 | "Warning!", 2365 | "Information!", 2366 | "Hint!" 2367 | ], 2368 | "type": "string" 2369 | }, 2370 | "unused-vararg": { 2371 | "default": "Hint", 2372 | "description": "Enable unused vararg diagnostics.", 2373 | "enum": [ 2374 | "Error", 2375 | "Warning", 2376 | "Information", 2377 | "Hint", 2378 | "Error!", 2379 | "Warning!", 2380 | "Information!", 2381 | "Hint!" 2382 | ], 2383 | "type": "string" 2384 | } 2385 | }, 2386 | "title": "severity", 2387 | "type": "object" 2388 | }, 2389 | "Lua.diagnostics.unusedLocalExclude": { 2390 | "default": [], 2391 | "items": { 2392 | "type": "string" 2393 | }, 2394 | "markdownDescription": "Do not diagnose `unused-local` when the variable name matches the following pattern.", 2395 | "type": "array" 2396 | }, 2397 | "Lua.diagnostics.workspaceDelay": { 2398 | "default": 3000, 2399 | "markdownDescription": "Latency (milliseconds) for workspace diagnostics.", 2400 | "type": "integer" 2401 | }, 2402 | "Lua.diagnostics.workspaceEvent": { 2403 | "default": "OnSave", 2404 | "enum": [ 2405 | "OnChange", 2406 | "OnSave", 2407 | "None" 2408 | ], 2409 | "markdownDescription": "Set the time to trigger workspace diagnostics.", 2410 | "markdownEnumDescriptions": [ 2411 | "Trigger workspace diagnostics when the file is changed.", 2412 | "Trigger workspace diagnostics when the file is saved.", 2413 | "Disable workspace diagnostics." 2414 | ], 2415 | "type": "string" 2416 | }, 2417 | "Lua.diagnostics.workspaceRate": { 2418 | "default": 100, 2419 | "markdownDescription": "Workspace diagnostics run rate (%). Decreasing this value reduces CPU usage, but also reduces the speed of workspace diagnostics. The diagnosis of the file you are currently editing is always done at full speed and is not affected by this setting.", 2420 | "type": "integer" 2421 | }, 2422 | "Lua.doc.packageName": { 2423 | "default": [], 2424 | "items": { 2425 | "type": "string" 2426 | }, 2427 | "markdownDescription": "Treat specific field names as package, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are package, witch can only be accessed in the file where the definition is located.", 2428 | "type": "array" 2429 | }, 2430 | "Lua.doc.privateName": { 2431 | "default": [], 2432 | "items": { 2433 | "type": "string" 2434 | }, 2435 | "markdownDescription": "Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.", 2436 | "type": "array" 2437 | }, 2438 | "Lua.doc.protectedName": { 2439 | "default": [], 2440 | "items": { 2441 | "type": "string" 2442 | }, 2443 | "markdownDescription": "Treat specific field names as protected, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are protected, witch can only be accessed in the class where the definition is located and its subclasses.", 2444 | "type": "array" 2445 | }, 2446 | "Lua.format.defaultConfig": { 2447 | "additionalProperties": false, 2448 | "default": {}, 2449 | "markdownDescription": "The default format configuration. Has a lower priority than `.editorconfig` file in the workspace.\nRead [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.\n", 2450 | "patternProperties": { 2451 | ".*": { 2452 | "default": "", 2453 | "type": "string" 2454 | } 2455 | }, 2456 | "title": "defaultConfig", 2457 | "type": "object" 2458 | }, 2459 | "Lua.format.enable": { 2460 | "default": true, 2461 | "markdownDescription": "Enable code formatter.", 2462 | "type": "boolean" 2463 | }, 2464 | "Lua.hint.arrayIndex": { 2465 | "default": "Auto", 2466 | "enum": [ 2467 | "Enable", 2468 | "Auto", 2469 | "Disable" 2470 | ], 2471 | "markdownDescription": "Show hints of array index when constructing a table.", 2472 | "markdownEnumDescriptions": [ 2473 | "Show hints in all tables.", 2474 | "Show hints only when the table is greater than 3 items, or the table is a mixed table.", 2475 | "Disable hints of array index." 2476 | ], 2477 | "type": "string" 2478 | }, 2479 | "Lua.hint.await": { 2480 | "default": true, 2481 | "markdownDescription": "If the called function is marked `---@async`, prompt `await` at the call.", 2482 | "type": "boolean" 2483 | }, 2484 | "Lua.hint.enable": { 2485 | "default": false, 2486 | "markdownDescription": "Enable inlay hint.", 2487 | "type": "boolean" 2488 | }, 2489 | "Lua.hint.paramName": { 2490 | "default": "All", 2491 | "enum": [ 2492 | "All", 2493 | "Literal", 2494 | "Disable" 2495 | ], 2496 | "markdownDescription": "Show hints of parameter name at the function call.", 2497 | "markdownEnumDescriptions": [ 2498 | "All types of parameters are shown.", 2499 | "Only literal type parameters are shown.", 2500 | "Disable parameter hints." 2501 | ], 2502 | "type": "string" 2503 | }, 2504 | "Lua.hint.paramType": { 2505 | "default": true, 2506 | "markdownDescription": "Show type hints at the parameter of the function.", 2507 | "type": "boolean" 2508 | }, 2509 | "Lua.hint.semicolon": { 2510 | "default": "SameLine", 2511 | "enum": [ 2512 | "All", 2513 | "SameLine", 2514 | "Disable" 2515 | ], 2516 | "markdownDescription": "If there is no semicolon at the end of the statement, display a virtual semicolon.", 2517 | "markdownEnumDescriptions": [ 2518 | "All statements display virtual semicolons.", 2519 | "When two statements are on the same line, display a semicolon between them.", 2520 | "Disable virtual semicolons." 2521 | ], 2522 | "type": "string" 2523 | }, 2524 | "Lua.hint.setType": { 2525 | "default": false, 2526 | "markdownDescription": "Show hints of type at assignment operation.", 2527 | "type": "boolean" 2528 | }, 2529 | "Lua.hover.enable": { 2530 | "default": true, 2531 | "markdownDescription": "Enable hover.", 2532 | "type": "boolean" 2533 | }, 2534 | "Lua.hover.enumsLimit": { 2535 | "default": 5, 2536 | "markdownDescription": "When the value corresponds to multiple types, limit the number of types displaying.", 2537 | "type": "integer" 2538 | }, 2539 | "Lua.hover.expandAlias": { 2540 | "default": true, 2541 | "markdownDescription": "Whether to expand the alias. For example, expands `---@alias myType boolean|number` appears as `boolean|number`, otherwise it appears as `myType'.\n", 2542 | "type": "boolean" 2543 | }, 2544 | "Lua.hover.previewFields": { 2545 | "default": 50, 2546 | "markdownDescription": "When hovering to view a table, limits the maximum number of previews for fields.", 2547 | "type": "integer" 2548 | }, 2549 | "Lua.hover.viewNumber": { 2550 | "default": true, 2551 | "markdownDescription": "Hover to view numeric content (only if literal is not decimal).", 2552 | "type": "boolean" 2553 | }, 2554 | "Lua.hover.viewString": { 2555 | "default": true, 2556 | "markdownDescription": "Hover to view the contents of a string (only if the literal contains an escape character).", 2557 | "type": "boolean" 2558 | }, 2559 | "Lua.hover.viewStringMax": { 2560 | "default": 1000, 2561 | "markdownDescription": "The maximum length of a hover to view the contents of a string.", 2562 | "type": "integer" 2563 | }, 2564 | "Lua.misc.executablePath": { 2565 | "default": "", 2566 | "markdownDescription": "Specify the executable path in VSCode.", 2567 | "type": "string" 2568 | }, 2569 | "Lua.misc.parameters": { 2570 | "default": [], 2571 | "items": { 2572 | "type": "string" 2573 | }, 2574 | "markdownDescription": "[Command line parameters](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) when starting the language server in VSCode.", 2575 | "type": "array" 2576 | }, 2577 | "Lua.nameStyle.config": { 2578 | "additionalProperties": false, 2579 | "default": {}, 2580 | "markdownDescription": "Set name style config", 2581 | "patternProperties": { 2582 | ".*": { 2583 | "type": [ 2584 | "string", 2585 | "array" 2586 | ] 2587 | } 2588 | }, 2589 | "title": "config", 2590 | "type": "object" 2591 | }, 2592 | "Lua.runtime.builtin": { 2593 | "additionalProperties": false, 2594 | "markdownDescription": "Adjust the enabled state of the built-in library. You can disable (or redefine) the non-existent library according to the actual runtime environment.\n\n* `default`: Indicates that the library will be enabled or disabled according to the runtime version\n* `enable`: always enable\n* `disable`: always disable\n", 2595 | "properties": { 2596 | "basic": { 2597 | "default": "default", 2598 | "description": "TODO: Needs documentation", 2599 | "enum": [ 2600 | "default", 2601 | "enable", 2602 | "disable" 2603 | ], 2604 | "type": "string" 2605 | }, 2606 | "bit": { 2607 | "default": "default", 2608 | "description": "TODO: Needs documentation", 2609 | "enum": [ 2610 | "default", 2611 | "enable", 2612 | "disable" 2613 | ], 2614 | "type": "string" 2615 | }, 2616 | "bit32": { 2617 | "default": "default", 2618 | "description": "TODO: Needs documentation", 2619 | "enum": [ 2620 | "default", 2621 | "enable", 2622 | "disable" 2623 | ], 2624 | "type": "string" 2625 | }, 2626 | "builtin": { 2627 | "default": "default", 2628 | "description": "TODO: Needs documentation", 2629 | "enum": [ 2630 | "default", 2631 | "enable", 2632 | "disable" 2633 | ], 2634 | "type": "string" 2635 | }, 2636 | "coroutine": { 2637 | "default": "default", 2638 | "description": "TODO: Needs documentation", 2639 | "enum": [ 2640 | "default", 2641 | "enable", 2642 | "disable" 2643 | ], 2644 | "type": "string" 2645 | }, 2646 | "debug": { 2647 | "default": "default", 2648 | "description": "TODO: Needs documentation", 2649 | "enum": [ 2650 | "default", 2651 | "enable", 2652 | "disable" 2653 | ], 2654 | "type": "string" 2655 | }, 2656 | "ffi": { 2657 | "default": "default", 2658 | "description": "TODO: Needs documentation", 2659 | "enum": [ 2660 | "default", 2661 | "enable", 2662 | "disable" 2663 | ], 2664 | "type": "string" 2665 | }, 2666 | "io": { 2667 | "default": "default", 2668 | "description": "TODO: Needs documentation", 2669 | "enum": [ 2670 | "default", 2671 | "enable", 2672 | "disable" 2673 | ], 2674 | "type": "string" 2675 | }, 2676 | "jit": { 2677 | "default": "default", 2678 | "description": "TODO: Needs documentation", 2679 | "enum": [ 2680 | "default", 2681 | "enable", 2682 | "disable" 2683 | ], 2684 | "type": "string" 2685 | }, 2686 | "jit.profile": { 2687 | "default": "default", 2688 | "description": "TODO: Needs documentation", 2689 | "enum": [ 2690 | "default", 2691 | "enable", 2692 | "disable" 2693 | ], 2694 | "type": "string" 2695 | }, 2696 | "jit.util": { 2697 | "default": "default", 2698 | "description": "TODO: Needs documentation", 2699 | "enum": [ 2700 | "default", 2701 | "enable", 2702 | "disable" 2703 | ], 2704 | "type": "string" 2705 | }, 2706 | "math": { 2707 | "default": "default", 2708 | "description": "TODO: Needs documentation", 2709 | "enum": [ 2710 | "default", 2711 | "enable", 2712 | "disable" 2713 | ], 2714 | "type": "string" 2715 | }, 2716 | "os": { 2717 | "default": "default", 2718 | "description": "TODO: Needs documentation", 2719 | "enum": [ 2720 | "default", 2721 | "enable", 2722 | "disable" 2723 | ], 2724 | "type": "string" 2725 | }, 2726 | "package": { 2727 | "default": "default", 2728 | "description": "TODO: Needs documentation", 2729 | "enum": [ 2730 | "default", 2731 | "enable", 2732 | "disable" 2733 | ], 2734 | "type": "string" 2735 | }, 2736 | "string": { 2737 | "default": "default", 2738 | "description": "TODO: Needs documentation", 2739 | "enum": [ 2740 | "default", 2741 | "enable", 2742 | "disable" 2743 | ], 2744 | "type": "string" 2745 | }, 2746 | "string.buffer": { 2747 | "default": "default", 2748 | "description": "TODO: Needs documentation", 2749 | "enum": [ 2750 | "default", 2751 | "enable", 2752 | "disable" 2753 | ], 2754 | "type": "string" 2755 | }, 2756 | "table": { 2757 | "default": "default", 2758 | "description": "TODO: Needs documentation", 2759 | "enum": [ 2760 | "default", 2761 | "enable", 2762 | "disable" 2763 | ], 2764 | "type": "string" 2765 | }, 2766 | "table.clear": { 2767 | "default": "default", 2768 | "description": "TODO: Needs documentation", 2769 | "enum": [ 2770 | "default", 2771 | "enable", 2772 | "disable" 2773 | ], 2774 | "type": "string" 2775 | }, 2776 | "table.new": { 2777 | "default": "default", 2778 | "description": "TODO: Needs documentation", 2779 | "enum": [ 2780 | "default", 2781 | "enable", 2782 | "disable" 2783 | ], 2784 | "type": "string" 2785 | }, 2786 | "utf8": { 2787 | "default": "default", 2788 | "description": "TODO: Needs documentation", 2789 | "enum": [ 2790 | "default", 2791 | "enable", 2792 | "disable" 2793 | ], 2794 | "type": "string" 2795 | } 2796 | }, 2797 | "title": "builtin", 2798 | "type": "object" 2799 | }, 2800 | "Lua.runtime.fileEncoding": { 2801 | "default": "utf8", 2802 | "enum": [ 2803 | "utf8", 2804 | "ansi", 2805 | "utf16le", 2806 | "utf16be" 2807 | ], 2808 | "markdownDescription": "File encoding. The `ansi` option is only available under the `Windows` platform.", 2809 | "markdownEnumDescriptions": [ 2810 | "TODO: Needs documentation", 2811 | "TODO: Needs documentation", 2812 | "TODO: Needs documentation", 2813 | "TODO: Needs documentation" 2814 | ], 2815 | "type": "string" 2816 | }, 2817 | "Lua.runtime.meta": { 2818 | "default": "${version} ${language} ${encoding}", 2819 | "markdownDescription": "Format of the directory name of the meta files.", 2820 | "type": "string" 2821 | }, 2822 | "Lua.runtime.nonstandardSymbol": { 2823 | "default": [], 2824 | "items": { 2825 | "enum": [ 2826 | "//", 2827 | "/**/", 2828 | "`", 2829 | "+=", 2830 | "-=", 2831 | "*=", 2832 | "/=", 2833 | "%=", 2834 | "^=", 2835 | "//=", 2836 | "|=", 2837 | "&=", 2838 | "<<=", 2839 | ">>=", 2840 | "||", 2841 | "&&", 2842 | "!", 2843 | "!=", 2844 | "continue" 2845 | ], 2846 | "type": "string" 2847 | }, 2848 | "markdownDescription": "Supports non-standard symbols. Make sure that your runtime environment supports these symbols.", 2849 | "type": "array" 2850 | }, 2851 | "Lua.runtime.path": { 2852 | "default": [ 2853 | "?.lua", 2854 | "?/init.lua" 2855 | ], 2856 | "items": { 2857 | "type": "string" 2858 | }, 2859 | "markdownDescription": "When using `require`, how to find the file based on the input name.\nSetting this config to `?/init.lua` means that when you enter `require 'myfile'`, `${workspace}/myfile/init.lua` will be searched from the loaded files.\nif `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also be searched.\nIf you want to load files outside the workspace, you need to set `Lua.workspace.library` first.\n", 2860 | "type": "array" 2861 | }, 2862 | "Lua.runtime.pathStrict": { 2863 | "default": false, 2864 | "markdownDescription": "When enabled, `runtime.path` will only search the first level of directories, see the description of `runtime.path`.", 2865 | "type": "boolean" 2866 | }, 2867 | "Lua.runtime.plugin": { 2868 | "default": "", 2869 | "markdownDescription": "Plugin path. Please read [wiki](https://luals.github.io/wiki/plugins) to learn more.", 2870 | "type": "string" 2871 | }, 2872 | "Lua.runtime.pluginArgs": { 2873 | "default": [], 2874 | "items": { 2875 | "type": "string" 2876 | }, 2877 | "markdownDescription": "Additional arguments for the plugin.", 2878 | "type": "array" 2879 | }, 2880 | "Lua.runtime.special": { 2881 | "additionalProperties": false, 2882 | "default": {}, 2883 | "markdownDescription": "The custom global variables are regarded as some special built-in variables, and the language server will provide special support\nThe following example shows that 'include' is treated as' require '.\n```json\n\"Lua.runtime.special\" : {\n \"include\" : \"require\"\n}\n```\n", 2884 | "patternProperties": { 2885 | ".*": { 2886 | "default": "require", 2887 | "enum": [ 2888 | "_G", 2889 | "rawset", 2890 | "rawget", 2891 | "setmetatable", 2892 | "require", 2893 | "dofile", 2894 | "loadfile", 2895 | "pcall", 2896 | "xpcall", 2897 | "assert", 2898 | "error", 2899 | "type", 2900 | "os.exit" 2901 | ], 2902 | "type": "string" 2903 | } 2904 | }, 2905 | "title": "special", 2906 | "type": "object" 2907 | }, 2908 | "Lua.runtime.unicodeName": { 2909 | "default": false, 2910 | "markdownDescription": "Allows Unicode characters in name.", 2911 | "type": "boolean" 2912 | }, 2913 | "Lua.runtime.version": { 2914 | "default": "Lua 5.4", 2915 | "enum": [ 2916 | "Lua 5.1", 2917 | "Lua 5.2", 2918 | "Lua 5.3", 2919 | "Lua 5.4", 2920 | "LuaJIT" 2921 | ], 2922 | "markdownDescription": "Lua runtime version.", 2923 | "markdownEnumDescriptions": [ 2924 | "TODO: Needs documentation", 2925 | "TODO: Needs documentation", 2926 | "TODO: Needs documentation", 2927 | "TODO: Needs documentation", 2928 | "TODO: Needs documentation" 2929 | ], 2930 | "type": "string" 2931 | }, 2932 | "Lua.semantic.annotation": { 2933 | "default": true, 2934 | "markdownDescription": "Semantic coloring of type annotations.", 2935 | "type": "boolean" 2936 | }, 2937 | "Lua.semantic.enable": { 2938 | "default": true, 2939 | "markdownDescription": "Enable semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect.", 2940 | "type": "boolean" 2941 | }, 2942 | "Lua.semantic.keyword": { 2943 | "default": false, 2944 | "markdownDescription": "Semantic coloring of keywords/literals/operators. You only need to enable this feature if your editor cannot do syntax coloring.", 2945 | "type": "boolean" 2946 | }, 2947 | "Lua.semantic.variable": { 2948 | "default": true, 2949 | "markdownDescription": "Semantic coloring of variables/fields/parameters.", 2950 | "type": "boolean" 2951 | }, 2952 | "Lua.signatureHelp.enable": { 2953 | "default": true, 2954 | "markdownDescription": "Enable signature help.", 2955 | "type": "boolean" 2956 | }, 2957 | "Lua.spell.dict": { 2958 | "default": [], 2959 | "items": { 2960 | "type": "string" 2961 | }, 2962 | "markdownDescription": "Custom words for spell checking.", 2963 | "type": "array" 2964 | }, 2965 | "Lua.type.castNumberToInteger": { 2966 | "default": true, 2967 | "markdownDescription": "Allowed to assign the `number` type to the `integer` type.", 2968 | "type": "boolean" 2969 | }, 2970 | "Lua.type.weakNilCheck": { 2971 | "default": false, 2972 | "markdownDescription": "When checking the type of union type, ignore the `nil` in it.\n\nWhen this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.\n", 2973 | "type": "boolean" 2974 | }, 2975 | "Lua.type.weakUnionCheck": { 2976 | "default": false, 2977 | "markdownDescription": "Once one subtype of a union type meets the condition, the union type also meets the condition.\n\nWhen this setting is `false`, the `number|boolean` type cannot be assigned to the `number` type. It can be with `true`.\n", 2978 | "type": "boolean" 2979 | }, 2980 | "Lua.typeFormat.config": { 2981 | "additionalProperties": false, 2982 | "markdownDescription": "Configures the formatting behavior while typing Lua code.", 2983 | "properties": { 2984 | "auto_complete_end": { 2985 | "default": "true", 2986 | "description": "Controls if `end` is automatically completed at suitable positions.", 2987 | "type": "string" 2988 | }, 2989 | "auto_complete_table_sep": { 2990 | "default": "true", 2991 | "description": "Controls if a separator is automatically appended at the end of a table declaration.", 2992 | "type": "string" 2993 | }, 2994 | "format_line": { 2995 | "default": "true", 2996 | "description": "Controls if a line is formatted at all.", 2997 | "type": "string" 2998 | } 2999 | }, 3000 | "title": "config", 3001 | "type": "object" 3002 | }, 3003 | "Lua.window.progressBar": { 3004 | "default": true, 3005 | "markdownDescription": "Show progress bar in status bar.", 3006 | "type": "boolean" 3007 | }, 3008 | "Lua.window.statusBar": { 3009 | "default": true, 3010 | "markdownDescription": "Show extension status in status bar.", 3011 | "type": "boolean" 3012 | }, 3013 | "Lua.workspace.checkThirdParty": { 3014 | "default": "Ask", 3015 | "enum": [ 3016 | false, 3017 | true, 3018 | "Ask", 3019 | "Apply", 3020 | "ApplyInMemory", 3021 | "Disable" 3022 | ], 3023 | "markdownDescription": "Automatic detection and adaptation of third-party libraries, currently supported libraries are:\n\n* OpenResty\n* Cocos4.0\n* L\u00d6VE\n* L\u00d6VR\n* skynet\n* Jass\n", 3024 | "markdownEnumDescriptions": [ 3025 | "TODO: Needs documentation", 3026 | "TODO: Needs documentation", 3027 | "TODO: Needs documentation", 3028 | "TODO: Needs documentation", 3029 | "TODO: Needs documentation", 3030 | "TODO: Needs documentation" 3031 | ], 3032 | "type": [ 3033 | "boolean", 3034 | "string" 3035 | ] 3036 | }, 3037 | "Lua.workspace.ignoreDir": { 3038 | "default": [ 3039 | ".vscode" 3040 | ], 3041 | "items": { 3042 | "type": "string" 3043 | }, 3044 | "markdownDescription": "Ignored files and directories (Use `.gitignore` grammar).", 3045 | "type": "array" 3046 | }, 3047 | "Lua.workspace.ignoreSubmodules": { 3048 | "default": true, 3049 | "markdownDescription": "Ignore submodules.", 3050 | "type": "boolean" 3051 | }, 3052 | "Lua.workspace.library": { 3053 | "default": [], 3054 | "items": { 3055 | "type": "string" 3056 | }, 3057 | "markdownDescription": "In addition to the current workspace, which directories will load files from. The files in these directories will be treated as externally provided code libraries, and some features (such as renaming fields) will not modify these files.", 3058 | "type": "array" 3059 | }, 3060 | "Lua.workspace.maxPreload": { 3061 | "default": 5000, 3062 | "markdownDescription": "Max preloaded files.", 3063 | "type": "integer" 3064 | }, 3065 | "Lua.workspace.preloadFileSize": { 3066 | "default": 500, 3067 | "markdownDescription": "Skip files larger than this value (KB) when preloading.", 3068 | "type": "integer" 3069 | }, 3070 | "Lua.workspace.useGitIgnore": { 3071 | "default": true, 3072 | "markdownDescription": "Ignore files list in `.gitignore` .", 3073 | "type": "boolean" 3074 | }, 3075 | "Lua.workspace.userThirdParty": { 3076 | "default": [], 3077 | "items": { 3078 | "type": "string" 3079 | }, 3080 | "markdownDescription": "Add private third-party library configuration file paths here, please refer to the built-in [configuration file path](https://github.com/LuaLS/lua-language-server/tree/master/meta/3rd)", 3081 | "type": "array" 3082 | } 3083 | } 3084 | } 3085 | } 3086 | } 3087 | } 3088 | } 3089 | }, 3090 | { 3091 | "file_patterns": [ 3092 | "/*.sublime-project" 3093 | ], 3094 | "schema": { 3095 | "properties": { 3096 | "settings": { 3097 | "properties": { 3098 | "LSP": { 3099 | "properties": { 3100 | "LSP-lua": { 3101 | "$ref": "sublime://settings/LSP-lua#/definitions/PluginConfig" 3102 | } 3103 | } 3104 | } 3105 | } 3106 | } 3107 | } 3108 | } 3109 | } 3110 | ] 3111 | } 3112 | } 3113 | --------------------------------------------------------------------------------