diff options
-rw-r--r-- | doc/en-us/config/config.md | 285 | ||||
-rw-r--r-- | doc/pt-br/config/config.md | 285 | ||||
-rw-r--r-- | doc/zh-cn/config/config.md | 285 | ||||
-rw-r--r-- | doc/zh-tw/config/config.md | 285 | ||||
-rw-r--r-- | script/provider/markdown.lua | 18 | ||||
-rw-r--r-- | tools/build-doc.lua | 30 |
6 files changed, 1138 insertions, 50 deletions
diff --git a/doc/en-us/config/config.md b/doc/en-us/config/config.md index c863d62f..5dc27eca 100644 --- a/doc/en-us/config/config.md +++ b/doc/en-us/config/config.md @@ -2,16 +2,26 @@ When the input looks like a file name, automatically `require` this file. +## type +`boolean` + ## default + `true` # completion.callSnippet Shows function call snippets. +## type +`string` + ## default + `"Disable"` + ## enum + * `"Disable"`: Only shows `function name`. * `"Both"`: Shows `function name` and `call snippet`. * `"Replace"`: Only shows `call snippet.` @@ -20,23 +30,37 @@ Shows function call snippets. 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. +## type +`integer` + ## default + `0` # completion.enable Enable completion. +## type +`boolean` + ## default + `true` # completion.keywordSnippet Shows keyword syntax snippets. +## type +`string` + ## default + `"Replace"` + ## enum + * `"Disable"`: Only shows `keyword`. * `"Both"`: Shows `keyword` and `syntax snippet`. * `"Replace"`: Only shows `syntax snippet`. @@ -45,30 +69,48 @@ Shows keyword syntax snippets. The symbol used to trigger the postfix suggestion. +## type +`string` + ## default + `"@"` # completion.requireSeparator The separator used when `require`. +## type +`string` + ## default + `"."` # completion.showParams Display parameters in completion list. When the function has multiple definitions, they will be displayed separately. +## type +`boolean` + ## default + `true` # completion.showWord Show contextual words in suggestions. +## type +`string` + ## default + `"Fallback"` + ## enum + * `"Enable"`: Always show context words in suggestions. * `"Fallback"`: Contextual words are only displayed when suggestions based on semantics cannot be provided. * `"Disable"`: Do not display context words. @@ -77,44 +119,70 @@ Show contextual words in suggestions. Whether the displayed context word contains the content of other files in the workspace. +## type +`boolean` + ## default + `true` # diagnostics.disable Disabled diagnostic (Use code in hover brackets). +## type +`array<string>` + ## default -`{}` + +`[]` # diagnostics.disableScheme Do not diagnose Lua files that use the following scheme. +## type +`array<string>` + ## default -`{ "git" }` + +`[ "git" ]` # diagnostics.enable Enable diagnostics. +## type +`boolean` + ## default + `true` # diagnostics.globals Defined global variables. +## type +`array<string>` + ## default -`{}` + +`[]` # diagnostics.ignoredFiles How to diagnose ignored files. +## type +`string` + ## default + `"Opened"` + ## enum + * `"Enable"`: Always diagnose these files. * `"Opened"`: Only when these files are opened will it be diagnosed. * `"Disable"`: These files are not diagnosed. @@ -123,9 +191,15 @@ How to diagnose ignored files. How to diagnose files loaded via `Lua.workspace.library`. +## type +`string` + ## default + `"Opened"` + ## enum + * `"Enable"`: Always diagnose these files. * `"Opened"`: Only when these files are opened will it be diagnosed. * `"Disable"`: These files are not diagnosed. @@ -137,46 +211,73 @@ How to diagnose files loaded via `Lua.workspace.library`. * Disable: disable this diagnostic +## type +`object` # diagnostics.severity Modified diagnostic severity. +## type +`object` # diagnostics.workspaceDelay Latency (milliseconds) for workspace diagnostics. When you start the workspace, or edit any file, the entire workspace will be re-diagnosed in the background. Set to negative to disable workspace diagnostics. +## type +`integer` + ## default + `3000` # diagnostics.workspaceRate 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. +## type +`integer` + ## default + `100` # format.defaultConfig **Missing description!!** + +## type +`object` + ## default + `{}` # format.enable Enable code formatter. +## type +`boolean` + ## default + `true` # hint.arrayIndex Show hints of array index when constructing a table. +## type +`string` + ## default + `"Auto"` + ## enum + * `"Enable"`: Show hints in all tables. * `"Auto"`: Show hints only when the table is greater than 3 items, or the table is a mixed table. * `"Disable"`: Disable hints of array index. @@ -184,21 +285,34 @@ Show hints of array index when constructing a table. # hint.await **Missing description!!** + +## type +`boolean` + ## default + `true` # hint.enable Enable inlay hint. +## type +`boolean` # hint.paramName Show hints of parameter name at the function call. +## type +`string` + ## default + `"All"` + ## enum + * `"All"`: All types of parameters are shown. * `"Literal"`: Only literal type parameters are shown. * `"Disable"`: Disable parameter hints. @@ -207,68 +321,107 @@ Show hints of parameter name at the function call. Show type hints at the parameter of the function. +## type +`boolean` + ## default + `true` # hint.setType Show hints of type at assignment operation. +## type +`boolean` # hover.enable Enable hover. +## type +`boolean` + ## default + `true` # hover.enumsLimit When the value corresponds to multiple types, limit the number of types displaying. +## type +`integer` + ## default + `5` # hover.expandAlias **Missing description!!** + +## type +`boolean` + ## default + `true` # hover.previewFields When hovering to view a table, limits the maximum number of previews for fields. +## type +`integer` + ## default + `20` # hover.viewNumber Hover to view numeric content (only if literal is not decimal). +## type +`boolean` + ## default + `true` # hover.viewString Hover to view the contents of a string (only if the literal contains an escape character). +## type +`boolean` + ## default + `true` # hover.viewStringMax The maximum length of a hover to view the contents of a string. +## type +`integer` + ## default + `1000` # misc.parameters [Command line parameters](https://github.com/sumneko/lua-telemetry-server/tree/master/method) when starting the language service in VSCode. +## type +`array<string>` + ## default -`{}` + +`[]` # runtime.builtin @@ -279,14 +432,22 @@ Adjust the enabled state of the built-in library. You can disable (or redefine) * `disable`: always disable +## type +`object` # runtime.fileEncoding File encoding. The `ansi` option is only available under the `Windows` platform. +## type +`string` + ## default + `"utf8"` + ## enum + * `"utf8"` * `"ansi"` * `"utf16le"` @@ -295,15 +456,24 @@ File encoding. The `ansi` option is only available under the `Windows` platform. # runtime.meta **Missing description!!** + +## type +`string` + ## default + `"${version} ${language} ${encoding}"` # runtime.nonstandardSymbol Supports non-standard symbols. Make sure that your runtime environment supports these symbols. +## type +`array<string>` + ## default -`{}` + +`[]` # runtime.path @@ -313,19 +483,29 @@ if `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also If you want to load files outside the workspace, you need to set `Lua.workspace.library` first. +## type +`array<string>` + ## default -`{ "?.lua", "?/init.lua" }` + +`[ "?.lua", "?/init.lua" ]` # runtime.pathStrict When enabled, `runtime.path` will only search the first level of directories, see the description of `runtime.path`. +## type +`boolean` # runtime.plugin Plugin path. Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/Plugin) to learn more. +## type +`string` + ## default + `""` # runtime.special @@ -339,21 +519,33 @@ The following example shows that 'include' is treated as' require '. ``` +## type +`object` + ## default + `{}` # runtime.unicodeName Allows Unicode characters in name. +## type +`boolean` # runtime.version Lua runtime version. +## type +`string` + ## default + `"Lua 5.4"` + ## enum + * `"Lua 5.1"` * `"Lua 5.2"` * `"Lua 5.3"` @@ -364,61 +556,96 @@ Lua runtime version. Semantic coloring of type annotations. +## type +`boolean` + ## default + `true` # semantic.enable Enable semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect. +## type +`boolean` + ## default + `true` # semantic.keyword Semantic coloring of keywords/literals/operators. You only need to enable this feature if your editor cannot do syntax coloring. +## type +`boolean` # semantic.variable Semantic coloring of variables/fields/parameters. +## type +`boolean` + ## default + `true` # signatureHelp.enable Enable signature help. +## type +`boolean` + ## default + `true` # spell.dict **Missing description!!** + +## type +`array<string>` + ## default -`{}` + +`[]` # telemetry.enable Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/sumneko/lua-language-server/wiki/Privacy-Policy). +## type +`boolean | null` + ## default + `nil` # window.progressBar Show progress bar in status bar. +## type +`boolean` + ## default + `true` # window.statusBar Show extension status in status bar. +## type +`boolean` + ## default + `true` # workspace.checkThirdParty @@ -433,61 +660,97 @@ Automatic detection and adaptation of third-party libraries, currently supported * Jass +## type +`boolean` + ## default + `true` # workspace.ignoreDir Ignored files and directories (Use `.gitignore` grammar). +## type +`array<string>` + ## default -`{ ".vscode" }` + +`[ ".vscode" ]` # workspace.ignoreSubmodules Ignore submodules. +## type +`boolean` + ## default + `true` # workspace.library 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. +## type +`array<string>` + ## default -`{}` + +`[]` # workspace.maxPreload Max preloaded files. +## type +`integer` + ## default + `5000` # workspace.preloadFileSize Skip files larger than this value (KB) when preloading. +## type +`integer` + ## default + `500` # workspace.supportScheme Provide language server for the Lua files of the following scheme. +## type +`array<string>` + ## default -`{ "file", "untitled", "git" }` + +`[ "file", "untitled", "git" ]` # workspace.useGitIgnore Ignore files list in `.gitignore` . +## type +`boolean` + ## default + `true` # workspace.userThirdParty Add private third-party library configuration file paths here, please refer to the built-in [configuration file path](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd) +## type +`array<string>` + ## default -`{}`
\ No newline at end of file + +`[]`
\ No newline at end of file diff --git a/doc/pt-br/config/config.md b/doc/pt-br/config/config.md index c863d62f..5dc27eca 100644 --- a/doc/pt-br/config/config.md +++ b/doc/pt-br/config/config.md @@ -2,16 +2,26 @@ When the input looks like a file name, automatically `require` this file. +## type +`boolean` + ## default + `true` # completion.callSnippet Shows function call snippets. +## type +`string` + ## default + `"Disable"` + ## enum + * `"Disable"`: Only shows `function name`. * `"Both"`: Shows `function name` and `call snippet`. * `"Replace"`: Only shows `call snippet.` @@ -20,23 +30,37 @@ Shows function call snippets. 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. +## type +`integer` + ## default + `0` # completion.enable Enable completion. +## type +`boolean` + ## default + `true` # completion.keywordSnippet Shows keyword syntax snippets. +## type +`string` + ## default + `"Replace"` + ## enum + * `"Disable"`: Only shows `keyword`. * `"Both"`: Shows `keyword` and `syntax snippet`. * `"Replace"`: Only shows `syntax snippet`. @@ -45,30 +69,48 @@ Shows keyword syntax snippets. The symbol used to trigger the postfix suggestion. +## type +`string` + ## default + `"@"` # completion.requireSeparator The separator used when `require`. +## type +`string` + ## default + `"."` # completion.showParams Display parameters in completion list. When the function has multiple definitions, they will be displayed separately. +## type +`boolean` + ## default + `true` # completion.showWord Show contextual words in suggestions. +## type +`string` + ## default + `"Fallback"` + ## enum + * `"Enable"`: Always show context words in suggestions. * `"Fallback"`: Contextual words are only displayed when suggestions based on semantics cannot be provided. * `"Disable"`: Do not display context words. @@ -77,44 +119,70 @@ Show contextual words in suggestions. Whether the displayed context word contains the content of other files in the workspace. +## type +`boolean` + ## default + `true` # diagnostics.disable Disabled diagnostic (Use code in hover brackets). +## type +`array<string>` + ## default -`{}` + +`[]` # diagnostics.disableScheme Do not diagnose Lua files that use the following scheme. +## type +`array<string>` + ## default -`{ "git" }` + +`[ "git" ]` # diagnostics.enable Enable diagnostics. +## type +`boolean` + ## default + `true` # diagnostics.globals Defined global variables. +## type +`array<string>` + ## default -`{}` + +`[]` # diagnostics.ignoredFiles How to diagnose ignored files. +## type +`string` + ## default + `"Opened"` + ## enum + * `"Enable"`: Always diagnose these files. * `"Opened"`: Only when these files are opened will it be diagnosed. * `"Disable"`: These files are not diagnosed. @@ -123,9 +191,15 @@ How to diagnose ignored files. How to diagnose files loaded via `Lua.workspace.library`. +## type +`string` + ## default + `"Opened"` + ## enum + * `"Enable"`: Always diagnose these files. * `"Opened"`: Only when these files are opened will it be diagnosed. * `"Disable"`: These files are not diagnosed. @@ -137,46 +211,73 @@ How to diagnose files loaded via `Lua.workspace.library`. * Disable: disable this diagnostic +## type +`object` # diagnostics.severity Modified diagnostic severity. +## type +`object` # diagnostics.workspaceDelay Latency (milliseconds) for workspace diagnostics. When you start the workspace, or edit any file, the entire workspace will be re-diagnosed in the background. Set to negative to disable workspace diagnostics. +## type +`integer` + ## default + `3000` # diagnostics.workspaceRate 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. +## type +`integer` + ## default + `100` # format.defaultConfig **Missing description!!** + +## type +`object` + ## default + `{}` # format.enable Enable code formatter. +## type +`boolean` + ## default + `true` # hint.arrayIndex Show hints of array index when constructing a table. +## type +`string` + ## default + `"Auto"` + ## enum + * `"Enable"`: Show hints in all tables. * `"Auto"`: Show hints only when the table is greater than 3 items, or the table is a mixed table. * `"Disable"`: Disable hints of array index. @@ -184,21 +285,34 @@ Show hints of array index when constructing a table. # hint.await **Missing description!!** + +## type +`boolean` + ## default + `true` # hint.enable Enable inlay hint. +## type +`boolean` # hint.paramName Show hints of parameter name at the function call. +## type +`string` + ## default + `"All"` + ## enum + * `"All"`: All types of parameters are shown. * `"Literal"`: Only literal type parameters are shown. * `"Disable"`: Disable parameter hints. @@ -207,68 +321,107 @@ Show hints of parameter name at the function call. Show type hints at the parameter of the function. +## type +`boolean` + ## default + `true` # hint.setType Show hints of type at assignment operation. +## type +`boolean` # hover.enable Enable hover. +## type +`boolean` + ## default + `true` # hover.enumsLimit When the value corresponds to multiple types, limit the number of types displaying. +## type +`integer` + ## default + `5` # hover.expandAlias **Missing description!!** + +## type +`boolean` + ## default + `true` # hover.previewFields When hovering to view a table, limits the maximum number of previews for fields. +## type +`integer` + ## default + `20` # hover.viewNumber Hover to view numeric content (only if literal is not decimal). +## type +`boolean` + ## default + `true` # hover.viewString Hover to view the contents of a string (only if the literal contains an escape character). +## type +`boolean` + ## default + `true` # hover.viewStringMax The maximum length of a hover to view the contents of a string. +## type +`integer` + ## default + `1000` # misc.parameters [Command line parameters](https://github.com/sumneko/lua-telemetry-server/tree/master/method) when starting the language service in VSCode. +## type +`array<string>` + ## default -`{}` + +`[]` # runtime.builtin @@ -279,14 +432,22 @@ Adjust the enabled state of the built-in library. You can disable (or redefine) * `disable`: always disable +## type +`object` # runtime.fileEncoding File encoding. The `ansi` option is only available under the `Windows` platform. +## type +`string` + ## default + `"utf8"` + ## enum + * `"utf8"` * `"ansi"` * `"utf16le"` @@ -295,15 +456,24 @@ File encoding. The `ansi` option is only available under the `Windows` platform. # runtime.meta **Missing description!!** + +## type +`string` + ## default + `"${version} ${language} ${encoding}"` # runtime.nonstandardSymbol Supports non-standard symbols. Make sure that your runtime environment supports these symbols. +## type +`array<string>` + ## default -`{}` + +`[]` # runtime.path @@ -313,19 +483,29 @@ if `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also If you want to load files outside the workspace, you need to set `Lua.workspace.library` first. +## type +`array<string>` + ## default -`{ "?.lua", "?/init.lua" }` + +`[ "?.lua", "?/init.lua" ]` # runtime.pathStrict When enabled, `runtime.path` will only search the first level of directories, see the description of `runtime.path`. +## type +`boolean` # runtime.plugin Plugin path. Please read [wiki](https://github.com/sumneko/lua-language-server/wiki/Plugin) to learn more. +## type +`string` + ## default + `""` # runtime.special @@ -339,21 +519,33 @@ The following example shows that 'include' is treated as' require '. ``` +## type +`object` + ## default + `{}` # runtime.unicodeName Allows Unicode characters in name. +## type +`boolean` # runtime.version Lua runtime version. +## type +`string` + ## default + `"Lua 5.4"` + ## enum + * `"Lua 5.1"` * `"Lua 5.2"` * `"Lua 5.3"` @@ -364,61 +556,96 @@ Lua runtime version. Semantic coloring of type annotations. +## type +`boolean` + ## default + `true` # semantic.enable Enable semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect. +## type +`boolean` + ## default + `true` # semantic.keyword Semantic coloring of keywords/literals/operators. You only need to enable this feature if your editor cannot do syntax coloring. +## type +`boolean` # semantic.variable Semantic coloring of variables/fields/parameters. +## type +`boolean` + ## default + `true` # signatureHelp.enable Enable signature help. +## type +`boolean` + ## default + `true` # spell.dict **Missing description!!** + +## type +`array<string>` + ## default -`{}` + +`[]` # telemetry.enable Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/sumneko/lua-language-server/wiki/Privacy-Policy). +## type +`boolean | null` + ## default + `nil` # window.progressBar Show progress bar in status bar. +## type +`boolean` + ## default + `true` # window.statusBar Show extension status in status bar. +## type +`boolean` + ## default + `true` # workspace.checkThirdParty @@ -433,61 +660,97 @@ Automatic detection and adaptation of third-party libraries, currently supported * Jass +## type +`boolean` + ## default + `true` # workspace.ignoreDir Ignored files and directories (Use `.gitignore` grammar). +## type +`array<string>` + ## default -`{ ".vscode" }` + +`[ ".vscode" ]` # workspace.ignoreSubmodules Ignore submodules. +## type +`boolean` + ## default + `true` # workspace.library 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. +## type +`array<string>` + ## default -`{}` + +`[]` # workspace.maxPreload Max preloaded files. +## type +`integer` + ## default + `5000` # workspace.preloadFileSize Skip files larger than this value (KB) when preloading. +## type +`integer` + ## default + `500` # workspace.supportScheme Provide language server for the Lua files of the following scheme. +## type +`array<string>` + ## default -`{ "file", "untitled", "git" }` + +`[ "file", "untitled", "git" ]` # workspace.useGitIgnore Ignore files list in `.gitignore` . +## type +`boolean` + ## default + `true` # workspace.userThirdParty Add private third-party library configuration file paths here, please refer to the built-in [configuration file path](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd) +## type +`array<string>` + ## default -`{}`
\ No newline at end of file + +`[]`
\ No newline at end of file diff --git a/doc/zh-cn/config/config.md b/doc/zh-cn/config/config.md index a0012ac8..83839806 100644 --- a/doc/zh-cn/config/config.md +++ b/doc/zh-cn/config/config.md @@ -2,16 +2,26 @@ 输入内容看起来是个文件名时,自动 `require` 此文件。 +## type +`boolean` + ## default + `true` # completion.callSnippet 显示函数调用片段。 +## type +`string` + ## default + `"Disable"` + ## enum + * `"Disable"`: 只显示 `函数名`。 * `"Both"`: 显示 `函数名` 与 `调用片段`。 * `"Replace"`: 只显示 `调用片段`。 @@ -20,23 +30,37 @@ 预览建议的相关代码片段,可能可以帮助你了解这项建议的用法。设置的数字表示代码片段的截取行数,设置为`0`可以禁用此功能。 +## type +`integer` + ## default + `0` # completion.enable 启用自动完成。 +## type +`boolean` + ## default + `true` # completion.keywordSnippet 显示关键字语法片段 +## type +`string` + ## default + `"Replace"` + ## enum + * `"Disable"`: 只显示 `关键字`。 * `"Both"`: 显示 `关键字` 与 `语法片段`。 * `"Replace"`: 只显示 `语法片段`。 @@ -45,30 +69,48 @@ 用于触发后缀建议的符号。 +## type +`string` + ## default + `"@"` # completion.requireSeparator `require` 时使用的分隔符。 +## type +`string` + ## default + `"."` # completion.showParams 在建议列表中显示函数的参数信息,函数拥有多个定义时会分开显示。 +## type +`boolean` + ## default + `true` # completion.showWord 在建议中显示上下文单词。 +## type +`string` + ## default + `"Fallback"` + ## enum + * `"Enable"`: 总是在建议中显示上下文单词。 * `"Fallback"`: 无法根据语义提供建议时才显示上下文单词。 * `"Disable"`: 不显示上下文单词。 @@ -77,44 +119,70 @@ 显示的上下文单词是否包含工作区中其他文件的内容。 +## type +`boolean` + ## default + `true` # diagnostics.disable 禁用的诊断(使用浮框括号内的代码)。 +## type +`array<string>` + ## default -`{}` + +`[]` # diagnostics.disableScheme 不诊断使用以下 scheme 的lua文件。 +## type +`array<string>` + ## default -`{ "git" }` + +`[ "git" ]` # diagnostics.enable 启用诊断。 +## type +`boolean` + ## default + `true` # diagnostics.globals 已定义的全局变量。 +## type +`array<string>` + ## default -`{}` + +`[]` # diagnostics.ignoredFiles 如何诊断被忽略的文件。 +## type +`string` + ## default + `"Opened"` + ## enum + * `"Enable"`: 总是诊断这些文件。 * `"Opened"`: 只有打开这些文件时才会诊断。 * `"Disable"`: 不诊断这些文件。 @@ -123,9 +191,15 @@ 如何诊断通过 `Lua.workspace.library` 加载的文件。 +## type +`string` + ## default + `"Opened"` + ## enum + * `"Enable"`: 总是诊断这些文件。 * `"Opened"`: 只有打开这些文件时才会诊断。 * `"Disable"`: 不诊断这些文件。 @@ -137,46 +211,73 @@ * Disable: 禁用此诊断 +## type +`object` # diagnostics.severity 修改诊断等级。 +## type +`object` # diagnostics.workspaceDelay 进行工作区诊断的延迟(毫秒)。当你启动工作区,或编辑了任意文件后,将会在后台对整个工作区进行重新诊断。设置为负数可以禁用工作区诊断。 +## type +`integer` + ## default + `3000` # diagnostics.workspaceRate 工作区诊断的运行速率(百分比)。降低该值会减少CPU占用,但是也会降低工作区诊断的速度。你当前正在编辑的文件的诊断总是全速完成,不受该选项影响。 +## type +`integer` + ## default + `100` # format.defaultConfig **Missing description!!** + +## type +`object` + ## default + `{}` # format.enable 启用代码格式化程序。 +## type +`boolean` + ## default + `true` # hint.arrayIndex 在构造表时提示数组索引。 +## type +`string` + ## default + `"Auto"` + ## enum + * `"Enable"`: 所有的表中都提示数组索引。 * `"Auto"`: 只有表大于3项,或者表是混合类型时才进行提示。 * `"Disable"`: 禁用数组索引提示。 @@ -184,21 +285,34 @@ # hint.await **Missing description!!** + +## type +`boolean` + ## default + `true` # hint.enable 启用内联提示。 +## type +`boolean` # hint.paramName 在函数调用处提示参数名。 +## type +`string` + ## default + `"All"` + ## enum + * `"All"`: 所有类型的参数均进行提示。 * `"Literal"`: 只有字面量类型的参数进行提示。 * `"Disable"`: 禁用参数提示。 @@ -207,68 +321,107 @@ 在函数的参数位置提示类型。 +## type +`boolean` + ## default + `true` # hint.setType 在赋值操作位置提示类型。 +## type +`boolean` # hover.enable 启用悬停提示。 +## type +`boolean` + ## default + `true` # hover.enumsLimit 当值对应多个类型时,限制类型的显示数量。 +## type +`integer` + ## default + `5` # hover.expandAlias **Missing description!!** + +## type +`boolean` + ## default + `true` # hover.previewFields 悬停提示查看表时,限制表内字段的最大预览数量。 +## type +`integer` + ## default + `20` # hover.viewNumber 悬停提示查看数字内容(仅当字面量不是十进制时)。 +## type +`boolean` + ## default + `true` # hover.viewString 悬停提示查看字符串内容(仅当字面量包含转义符时)。 +## type +`boolean` + ## default + `true` # hover.viewStringMax 悬停提示查看字符串内容时的最大长度。 +## type +`integer` + ## default + `1000` # misc.parameters VSCode中启动语言服务时的[命令行参数](https://github.com/sumneko/lua-language-server/wiki/Command-line)。 +## type +`array<string>` + ## default -`{}` + +`[]` # runtime.builtin @@ -279,14 +432,22 @@ VSCode中启动语言服务时的[命令行参数](https://github.com/sumneko/lu * `disable`: 总是禁用 +## type +`object` # runtime.fileEncoding 文件编码,`ansi` 选项只在 `Windows` 平台下有效。 +## type +`string` + ## default + `"utf8"` + ## enum + * `"utf8"` * `"ansi"` * `"utf16le"` @@ -295,15 +456,24 @@ VSCode中启动语言服务时的[命令行参数](https://github.com/sumneko/lu # runtime.meta **Missing description!!** + +## type +`string` + ## default + `"${version} ${language} ${encoding}"` # runtime.nonstandardSymbol 支持非标准的符号。请务必确认你的运行环境支持这些符号。 +## type +`array<string>` + ## default -`{}` + +`[]` # runtime.path @@ -313,19 +483,29 @@ VSCode中启动语言服务时的[命令行参数](https://github.com/sumneko/lu 如果你想要加载工作区以外的文件,你需要先设置 `Lua.workspace.library`。 +## type +`array<string>` + ## default -`{ "?.lua", "?/init.lua" }` + +`[ "?.lua", "?/init.lua" ]` # runtime.pathStrict 启用后 `runtime.path` 将只搜索第一层目录,见 `runtime.path` 的说明。 +## type +`boolean` # runtime.plugin 插件路径,请查阅[文档](https://github.com/sumneko/lua-language-server/wiki/Plugin)了解用法。 +## type +`string` + ## default + `""` # runtime.special @@ -339,21 +519,33 @@ VSCode中启动语言服务时的[命令行参数](https://github.com/sumneko/lu ``` +## type +`object` + ## default + `{}` # runtime.unicodeName 允许在名字中使用 Unicode 字符。 +## type +`boolean` # runtime.version Lua运行版本。 +## type +`string` + ## default + `"Lua 5.4"` + ## enum + * `"Lua 5.1"` * `"Lua 5.2"` * `"Lua 5.3"` @@ -364,61 +556,96 @@ Lua运行版本。 对类型注解进行语义着色。 +## type +`boolean` + ## default + `true` # semantic.enable 启用语义着色。你可能需要同时将 `editor.semanticHighlighting.enabled` 设置为 `true` 才能生效。 +## type +`boolean` + ## default + `true` # semantic.keyword 对关键字/字面量/运算符进行语义着色。只有当你的编辑器无法进行语法着色时才需要启用此功能。 +## type +`boolean` # semantic.variable 对变量/字段/参数进行语义着色。 +## type +`boolean` + ## default + `true` # signatureHelp.enable 启用参数提示。 +## type +`boolean` + ## default + `true` # spell.dict **Missing description!!** + +## type +`array<string>` + ## default -`{}` + +`[]` # telemetry.enable 启用遥测,通过网络发送你的编辑器信息与错误日志。在[此处](https://github.com/sumneko/lua-language-server/wiki/%E9%9A%90%E7%A7%81%E5%A3%B0%E6%98%8E)阅读我们的隐私声明。 +## type +`boolean | null` + ## default + `nil` # window.progressBar 在状态栏显示进度条。 +## type +`boolean` + ## default + `true` # window.statusBar 在状态栏显示插件状态。 +## type +`boolean` + ## default + `true` # workspace.checkThirdParty @@ -433,61 +660,97 @@ Lua运行版本。 * Jass +## type +`boolean` + ## default + `true` # workspace.ignoreDir 忽略的文件与目录(使用 `.gitignore` 语法)。 +## type +`array<string>` + ## default -`{ ".vscode" }` + +`[ ".vscode" ]` # workspace.ignoreSubmodules 忽略子模块。 +## type +`boolean` + ## default + `true` # workspace.library 除了当前工作区以外,还会从哪些目录中加载文件。这些目录中的文件将被视作外部提供的代码库,部分操作(如重命名字段)不会修改这些文件。 +## type +`array<string>` + ## default -`{}` + +`[]` # workspace.maxPreload 最大预加载文件数。 +## type +`integer` + ## default + `5000` # workspace.preloadFileSize 预加载时跳过大小大于该值(KB)的文件。 +## type +`integer` + ## default + `500` # workspace.supportScheme 为以下 scheme 的lua文件提供语言服务。 +## type +`array<string>` + ## default -`{ "file", "untitled", "git" }` + +`[ "file", "untitled", "git" ]` # workspace.useGitIgnore 忽略 `.gitignore` 中列举的文件。 +## type +`boolean` + ## default + `true` # workspace.userThirdParty 在这里添加私有的第三方库适配文件路径,请参考内置的[配置文件路径](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd) +## type +`array<string>` + ## default -`{}`
\ No newline at end of file + +`[]`
\ No newline at end of file diff --git a/doc/zh-tw/config/config.md b/doc/zh-tw/config/config.md index e0496b43..f0cc320d 100644 --- a/doc/zh-tw/config/config.md +++ b/doc/zh-tw/config/config.md @@ -2,16 +2,26 @@ 輸入內容看起來是個檔名時,自動 `require` 此檔案。 +## type +`boolean` + ## default + `true` # completion.callSnippet 顯示函式呼叫片段。 +## type +`string` + ## default + `"Disable"` + ## enum + * `"Disable"`: 只顯示 `函式名`。 * `"Both"`: 顯示 `函式名` 與 `呼叫片段`。 * `"Replace"`: 只顯示 `呼叫片段`。 @@ -20,23 +30,37 @@ 預覽建議的相關程式碼片段,可能可以幫助你瞭解這項建議的用法。設定的數字表示程式碼片段的擷取行數,設定為 `0` 可以停用此功能。 +## type +`integer` + ## default + `0` # completion.enable 啟用自動完成。 +## type +`boolean` + ## default + `true` # completion.keywordSnippet 顯示關鍵字語法片段。 +## type +`string` + ## default + `"Replace"` + ## enum + * `"Disable"`: 只顯示 `關鍵字`。 * `"Both"`: 顯示 `關鍵字` 與 `語法片段`。 * `"Replace"`: 只顯示 `語法片段`。 @@ -45,30 +69,48 @@ 用於觸發後綴建議的符號。 +## type +`string` + ## default + `"@"` # completion.requireSeparator `require` 時使用的分隔符。 +## type +`string` + ## default + `"."` # completion.showParams 在建議列表中顯示函式的參數資訊,函式擁有多個定義時會分開顯示。 +## type +`boolean` + ## default + `true` # completion.showWord 在建議中顯示上下文單詞。 +## type +`string` + ## default + `"Fallback"` + ## enum + * `"Enable"`: 總是在建議中顯示上下文單詞。 * `"Fallback"`: 無法根據語義提供建議時才顯示上下文單詞。 * `"Disable"`: 不顯示上下文單詞。 @@ -77,44 +119,70 @@ 顯示的上下文單詞是否包含工作區中其他檔案的內容。 +## type +`boolean` + ## default + `true` # diagnostics.disable 停用的診斷(使用浮框括號內的程式碼)。 +## type +`array<string>` + ## default -`{}` + +`[]` # diagnostics.disableScheme 不診斷使用以下 scheme 的lua檔案。 +## type +`array<string>` + ## default -`{ "git" }` + +`[ "git" ]` # diagnostics.enable 啟用診斷。 +## type +`boolean` + ## default + `true` # diagnostics.globals 已定義的全域變數。 +## type +`array<string>` + ## default -`{}` + +`[]` # diagnostics.ignoredFiles 如何診斷被忽略的檔案。 +## type +`string` + ## default + `"Opened"` + ## enum + * `"Enable"`: 總是診斷這些檔案。 * `"Opened"`: 只有打開這些檔案時才會診斷。 * `"Disable"`: 不診斷這些檔案。 @@ -123,9 +191,15 @@ 如何診斷透過 `Lua.workspace.library` 載入的檔案。 +## type +`string` + ## default + `"Opened"` + ## enum + * `"Enable"`: 總是診斷這些檔案。 * `"Opened"`: 只有打開這些檔案時才會診斷。 * `"Disable"`: 不診斷這些檔案。 @@ -137,46 +211,73 @@ * Disable: 停用此診斷 +## type +`object` # diagnostics.severity 修改診斷等級。 +## type +`object` # diagnostics.workspaceDelay 進行工作區診斷的延遲(毫秒)。當你啟動工作區,或編輯了任意檔案後,將會在背景對整個工作區進行重新診斷。設定為負數可以停用工作區診斷。 +## type +`integer` + ## default + `3000` # diagnostics.workspaceRate 工作區診斷的執行速率(百分比)。降低該值會減少CPU佔用,但是也會降低工作區診斷的速度。你目前正在編輯的檔案的診斷總是全速完成,不受該選項影響。 +## type +`integer` + ## default + `100` # format.defaultConfig **Missing description!!** + +## type +`object` + ## default + `{}` # format.enable 啟用程式碼格式化程式。 +## type +`boolean` + ## default + `true` # hint.arrayIndex 在建構表時提示陣列索引。 +## type +`string` + ## default + `"Auto"` + ## enum + * `"Enable"`: 所有的表中都提示陣列索引。 * `"Auto"`: 只有表大於3項,或者表是混合型別時才進行提示。 * `"Disable"`: 停用陣列索引提示。 @@ -184,21 +285,34 @@ # hint.await **Missing description!!** + +## type +`boolean` + ## default + `true` # hint.enable 啟用內嵌提示。 +## type +`boolean` # hint.paramName 在函式呼叫處提示參數名。 +## type +`string` + ## default + `"All"` + ## enum + * `"All"`: 所有型別的參數均進行提示。 * `"Literal"`: 只有字面常數型別的參數進行提示。 * `"Disable"`: 停用參數提示。 @@ -207,68 +321,107 @@ 在函式的參數位置提示型別。 +## type +`boolean` + ## default + `true` # hint.setType 在賦值操作位置提示型別。 +## type +`boolean` # hover.enable 啟用懸浮提示。 +## type +`boolean` + ## default + `true` # hover.enumsLimit 當值對應多個型別時,限制型別的顯示數量。 +## type +`integer` + ## default + `5` # hover.expandAlias **Missing description!!** + +## type +`boolean` + ## default + `true` # hover.previewFields 懸浮提示檢視表時,限制表內欄位的最大預覽數量。 +## type +`integer` + ## default + `20` # hover.viewNumber 懸浮提示檢視數字內容(僅當字面常數不是十進制時)。 +## type +`boolean` + ## default + `true` # hover.viewString 懸浮提示檢視字串內容(僅當字面常數包含跳脫字元時)。 +## type +`boolean` + ## default + `true` # hover.viewStringMax 懸浮提示檢視字串內容時的最大長度。 +## type +`integer` + ## default + `1000` # misc.parameters VSCode中啟動語言服務時的[命令列參數](https://github.com/sumneko/lua-language-server/wiki/Command-line)。 +## type +`array<string>` + ## default -`{}` + +`[]` # runtime.builtin @@ -279,14 +432,22 @@ VSCode中啟動語言服務時的[命令列參數](https://github.com/sumneko/lu * `disable`: 總是停用 +## type +`object` # runtime.fileEncoding 檔案編碼,`ansi` 選項只在 `Windows` 平台下有效。 +## type +`string` + ## default + `"utf8"` + ## enum + * `"utf8"` * `"ansi"` * `"utf16le"` @@ -295,15 +456,24 @@ VSCode中啟動語言服務時的[命令列參數](https://github.com/sumneko/lu # runtime.meta **Missing description!!** + +## type +`string` + ## default + `"${version} ${language} ${encoding}"` # runtime.nonstandardSymbol 支援非標準的符號。請務必確認你的執行環境支援這些符號。 +## type +`array<string>` + ## default -`{}` + +`[]` # runtime.path @@ -313,19 +483,29 @@ VSCode中啟動語言服務時的[命令列參數](https://github.com/sumneko/lu 如果你想要載入工作區以外的檔案,你需要先設定 `Lua.workspace.library`。 +## type +`array<string>` + ## default -`{ "?.lua", "?/init.lua" }` + +`[ "?.lua", "?/init.lua" ]` # runtime.pathStrict 啟用後 `runtime.path` 將只搜尋第一層目錄,見 `runtime.path` 的説明。 +## type +`boolean` # runtime.plugin 延伸模組路徑,請查閲[文件](https://github.com/sumneko/lua-language-server/wiki/Plugin)瞭解用法。 +## type +`string` + ## default + `""` # runtime.special @@ -339,21 +519,33 @@ VSCode中啟動語言服務時的[命令列參數](https://github.com/sumneko/lu ``` +## type +`object` + ## default + `{}` # runtime.unicodeName 允許在名字中使用 Unicode 字元。 +## type +`boolean` # runtime.version Lua執行版本。 +## type +`string` + ## default + `"Lua 5.4"` + ## enum + * `"Lua 5.1"` * `"Lua 5.2"` * `"Lua 5.3"` @@ -364,61 +556,96 @@ Lua執行版本。 對型別註解進行語義著色。 +## type +`boolean` + ## default + `true` # semantic.enable 啟用語義著色。你可能需要同時將 `editor.semanticHighlighting.enabled` 設定為 `true` 才能生效。 +## type +`boolean` + ## default + `true` # semantic.keyword 對關鍵字/字面常數/運算子進行語義著色。只有當你的編輯器無法進行語法著色時才需要啟用此功能。 +## type +`boolean` # semantic.variable 對變數/欄位/參數進行語義著色。 +## type +`boolean` + ## default + `true` # signatureHelp.enable 啟用參數提示。 +## type +`boolean` + ## default + `true` # spell.dict **Missing description!!** + +## type +`array<string>` + ## default -`{}` + +`[]` # telemetry.enable 啟用遙測,透過網路發送你的編輯器資訊與錯誤日誌。在[此處](https://github.com/sumneko/lua-language-server/wiki/%E9%9A%B1%E7%A7%81%E8%81%B2%E6%98%8E)閲讀我們的隱私聲明。 +## type +`boolean | null` + ## default + `nil` # window.progressBar 在狀態欄顯示進度條。 +## type +`boolean` + ## default + `true` # window.statusBar 在狀態欄顯示延伸模組狀態。 +## type +`boolean` + ## default + `true` # workspace.checkThirdParty @@ -433,61 +660,97 @@ Lua執行版本。 * Jass +## type +`boolean` + ## default + `true` # workspace.ignoreDir 忽略的檔案與目錄(使用 `.gitignore` 語法)。 +## type +`array<string>` + ## default -`{ ".vscode" }` + +`[ ".vscode" ]` # workspace.ignoreSubmodules 忽略子模組。 +## type +`boolean` + ## default + `true` # workspace.library 除了目前工作區以外,還會從哪些目錄中載入檔案。這些目錄中的檔案將被視作外部提供的程式碼庫,部分操作(如重新命名欄位)不會修改這些檔案。 +## type +`array<string>` + ## default -`{}` + +`[]` # workspace.maxPreload 最大預載入檔案數。 +## type +`integer` + ## default + `5000` # workspace.preloadFileSize 預載入時跳過大小大於該值(KB)的檔案。 +## type +`integer` + ## default + `500` # workspace.supportScheme 為以下 `scheme` 的lua檔案提供語言服務。 +## type +`array<string>` + ## default -`{ "file", "untitled", "git" }` + +`[ "file", "untitled", "git" ]` # workspace.useGitIgnore 忽略 `.gitignore` 中列舉的檔案。 +## type +`boolean` + ## default + `true` # workspace.userThirdParty 在這裡添加私有的第三方庫適應檔案路徑,請參考內建的[組態檔案路徑](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd) +## type +`array<string>` + ## default -`{}`
\ No newline at end of file + +`[]`
\ No newline at end of file diff --git a/script/provider/markdown.lua b/script/provider/markdown.lua index 6b7d24c8..de24e314 100644 --- a/script/provider/markdown.lua +++ b/script/provider/markdown.lua @@ -15,6 +15,7 @@ function mt:add(language, text) if not text then return self end + assert(type(text) == 'string') self._cacheResult = nil if type(text) == 'table' then self[#self+1] = { @@ -40,7 +41,15 @@ function mt:splitLine() return self end -function mt:string() +function mt:emptyLine() + self._cacheResult = nil + self[#self+1] = { + type = 'emptyline', + } + return self +end + +function mt:string(nl) if self._cacheResult then return self._cacheResult end @@ -59,6 +68,11 @@ function mt:string() lines[#lines+1] = '' lines[#lines+1] = '---' end + elseif obj.type == 'emptyline' then + if #lines > 0 + and lines[#lines] ~= '' then + lines[#lines+1] = '' + end elseif obj.type == 'markdown' then concat(obj.markdown) else @@ -101,7 +115,7 @@ function mt:string() end end - local result = table.concat(lines, '\n') + local result = table.concat(lines, nl or '\n') self._cacheResult = result return result end diff --git a/tools/build-doc.lua b/tools/build-doc.lua index 0ad50876..a1fee036 100644 --- a/tools/build-doc.lua +++ b/tools/build-doc.lua @@ -39,14 +39,27 @@ local function getDesc(lang, desc) return locale[id] end +local function buildType(md, lang, conf) + md:add('md', '## type') + if type(conf.type) == 'table' then + md:add('md', ('`%s | %s`'):format(conf.type[1], conf.type[2])) + elseif conf.type == 'array' then + md:add('md', ('`%s<%s>`'):format(conf.type, conf.items.type)) + else + md:add('md', ('`%s`'):format(conf.type)) + end + md:emptyLine() +end + local function buildDesc(md, lang, conf) local desc = conf.markdownDescription or conf.description desc = getDesc(lang, desc) if desc then - md:add('md', desc .. '\n') + md:add('md', desc) else md:add('md', '**Missing description!!**') end + md:emptyLine() end local function buildDefault(md, lang, conf) @@ -58,7 +71,13 @@ local function buildDefault(md, lang, conf) default = nil end md:add('md', '## default') - md:add('md', ('`%s`'):format(inspect(default))) + md:emptyLine() + if type(default) == 'table' and conf.type == 'array' then + md:add('md', ('`[%s]`'):format(inspect(default):sub(2, -2))) + else + md:add('md', ('`%s`'):format(inspect(default))) + end + md:emptyLine() end local function buildEnum(md, lang, conf) @@ -66,6 +85,7 @@ local function buildEnum(md, lang, conf) return nil end md:add('md', '## enum') + md:emptyLine() for i, enum in ipairs(conf.enum) do local desc = getDesc(lang, conf.markdownEnumDescriptions and conf.markdownEnumDescriptions[i]) if desc then @@ -82,11 +102,13 @@ local function buildMarkdown(lang) local configDoc = markdown() for name, conf in util.sortPairs(config) do - configDoc:add('md', '# ' .. name:gsub('^Lua%.', '') .. '\n') + configDoc:add('md', '# ' .. name:gsub('^Lua%.', '')) + configDoc:emptyLine() buildDesc(configDoc, lang, conf) + buildType(configDoc, lang, conf) buildDefault(configDoc, lang, conf) buildEnum(configDoc, lang, conf) - configDoc:add('md', '') + configDoc:emptyLine() end util.saveFile((dir / 'config.md'):string(), configDoc:string()) |