diff options
-rw-r--r-- | doc/en-us/config.md | 159 | ||||
-rw-r--r-- | doc/pt-br/config.md | 373 | ||||
-rw-r--r-- | doc/zh-cn/config.md | 373 | ||||
-rw-r--r-- | doc/zh-tw/config.md | 373 | ||||
-rw-r--r-- | locale/en-us/setting.lua | 10 | ||||
-rw-r--r-- | locale/pt-br/setting.lua | 10 | ||||
-rw-r--r-- | locale/zh-cn/setting.lua | 10 | ||||
-rw-r--r-- | locale/zh-tw/setting.lua | 10 |
8 files changed, 1309 insertions, 9 deletions
diff --git a/doc/en-us/config.md b/doc/en-us/config.md index 584ab2d1..28fd118e 100644 --- a/doc/en-us/config.md +++ b/doc/en-us/config.md @@ -224,10 +224,36 @@ Array<string> * ``"exp-in-action"`` * ``"global-in-nil-env"`` * ``"index-in-func-name"`` +* ``"invisible"`` * ``"jump-local-scope"`` * ``"keyword"`` * ``"local-limit"`` * ``"lowercase-global"`` +* ``"lua-doc-miss-sign"`` +* ``"luadoc-error-diag-mode"`` +* ``"luadoc-miss-alias-extends"`` +* ``"luadoc-miss-alias-name"`` +* ``"luadoc-miss-arg-name"`` +* ``"luadoc-miss-cate-name"`` +* ``"luadoc-miss-class-extends-name"`` +* ``"luadoc-miss-class-name"`` +* ``"luadoc-miss-diag-mode"`` +* ``"luadoc-miss-diag-name"`` +* ``"luadoc-miss-field-extends"`` +* ``"luadoc-miss-field-name"`` +* ``"luadoc-miss-fun-after-overload"`` +* ``"luadoc-miss-generic-name"`` +* ``"luadoc-miss-local-name"`` +* ``"luadoc-miss-module-name"`` +* ``"luadoc-miss-operator-name"`` +* ``"luadoc-miss-param-extends"`` +* ``"luadoc-miss-param-name"`` +* ``"luadoc-miss-see-name"`` +* ``"luadoc-miss-sign-name"`` +* ``"luadoc-miss-symbol"`` +* ``"luadoc-miss-type-name"`` +* ``"luadoc-miss-vararg-type"`` +* ``"luadoc-miss-version"`` * ``"malformed-number"`` * ``"miss-end"`` * ``"miss-esc-x"`` @@ -245,6 +271,7 @@ Array<string> * ``"missing-return"`` * ``"missing-return-value"`` * ``"need-check-nil"`` +* ``"need-paren"`` * ``"newfield-call"`` * ``"newline-call"`` * ``"no-unknown"`` @@ -420,6 +447,7 @@ object<string, string> * close-non-object * deprecated * discard-returns + * invisible */ "strict": "Fallback", /* @@ -538,6 +566,7 @@ object<string, string> * close-non-object * deprecated * discard-returns + * invisible */ "strict": "Fallback", /* @@ -723,7 +752,7 @@ object<string, string> /* Enable diagnostics for setting the same field in a class more than once. */ - "duplicate-set-field": "Any", + "duplicate-set-field": "Opened", /* Enable empty code block diagnostics. */ @@ -733,6 +762,10 @@ object<string, string> */ "global-in-nil-env": "Any", /* + Enable diagnostics for accesses to fields which are invisible. + */ + "invisible": "Any", + /* Enable lowercase global variable definition diagnostics. */ "lowercase-global": "Any", @@ -977,6 +1010,10 @@ object<string, string> */ "global-in-nil-env": "Warning", /* + Enable diagnostics for accesses to fields which are invisible. + */ + "invisible": "Warning", + /* Enable lowercase global variable definition diagnostics. */ "lowercase-global": "Information", @@ -1129,7 +1166,7 @@ Array<string> # 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. +Latency (milliseconds) for workspace diagnostics. ## type @@ -1143,6 +1180,28 @@ integer 3000 ``` +# diagnostics.workspaceEvent + +Set the time to trigger workspace diagnostics. + +## type + +```ts +string +``` + +## enum + +* ``"OnChange"``: Trigger workspace diagnostics when the file is changed. +* ``"OnSave"``: Trigger workspace diagnostics when the file is saved. +* ``"None"``: Disable workspace diagnostics. + +## default + +```jsonc +"OnSave" +``` + # 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. @@ -1159,6 +1218,54 @@ integer 100 ``` +# doc.packageName + +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. + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + +# doc.privateName + +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. + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + +# doc.protectedName + +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. + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + # format.defaultConfig The default format configuration. Has a lower priority than `.editorconfig` file in the workspace. @@ -1436,9 +1543,25 @@ integer 1000 ``` +# misc.executablePath + +Specify the executable path in VSCode. + +## type + +```ts +string +``` + +## default + +```jsonc +"" +``` + # misc.parameters -[Command line parameters](https://github.com/sumneko/lua-telemetry-server/tree/master/method) when starting the language service in VSCode. +[Command line parameters](https://github.com/sumneko/lua-telemetry-server/tree/master/method) when starting the language server in VSCode. ## type @@ -1490,6 +1613,7 @@ object<string, string> "os": "default", "package": "default", "string": "default", + "string.buffer": "default", "table": "default", "table.clear": "default", "table.new": "default", @@ -1872,6 +1996,35 @@ boolean false ``` +# typeFormat.config + +Configures the formatting behavior while typing Lua code. + +## type + +```ts +object<string, string> +``` + +## default + +```jsonc +{ + /* + Controls if `end` is automatically completed at suitable positions. + */ + "auto_complete_end": "true", + /* + Controls if a separator is automatically appended at the end of a table declaration. + */ + "auto_complete_table_sep": "true", + /* + Controls if a line is formatted at all. + */ + "format_line": "true" +} +``` + # window.progressBar Show progress bar in status bar. diff --git a/doc/pt-br/config.md b/doc/pt-br/config.md index e984f172..aa9bd81e 100644 --- a/doc/pt-br/config.md +++ b/doc/pt-br/config.md @@ -224,10 +224,36 @@ Array<string> * ``"exp-in-action"`` * ``"global-in-nil-env"`` * ``"index-in-func-name"`` +* ``"invisible"`` * ``"jump-local-scope"`` * ``"keyword"`` * ``"local-limit"`` * ``"lowercase-global"`` +* ``"lua-doc-miss-sign"`` +* ``"luadoc-error-diag-mode"`` +* ``"luadoc-miss-alias-extends"`` +* ``"luadoc-miss-alias-name"`` +* ``"luadoc-miss-arg-name"`` +* ``"luadoc-miss-cate-name"`` +* ``"luadoc-miss-class-extends-name"`` +* ``"luadoc-miss-class-name"`` +* ``"luadoc-miss-diag-mode"`` +* ``"luadoc-miss-diag-name"`` +* ``"luadoc-miss-field-extends"`` +* ``"luadoc-miss-field-name"`` +* ``"luadoc-miss-fun-after-overload"`` +* ``"luadoc-miss-generic-name"`` +* ``"luadoc-miss-local-name"`` +* ``"luadoc-miss-module-name"`` +* ``"luadoc-miss-operator-name"`` +* ``"luadoc-miss-param-extends"`` +* ``"luadoc-miss-param-name"`` +* ``"luadoc-miss-see-name"`` +* ``"luadoc-miss-sign-name"`` +* ``"luadoc-miss-symbol"`` +* ``"luadoc-miss-type-name"`` +* ``"luadoc-miss-vararg-type"`` +* ``"luadoc-miss-version"`` * ``"malformed-number"`` * ``"miss-end"`` * ``"miss-esc-x"`` @@ -245,6 +271,7 @@ Array<string> * ``"missing-return"`` * ``"missing-return-value"`` * ``"need-check-nil"`` +* ``"need-paren"`` * ``"newfield-call"`` * ``"newline-call"`` * ``"no-unknown"`` @@ -420,6 +447,7 @@ object<string, string> * close-non-object * deprecated * discard-returns + * invisible */ "strict": "Fallback", /* @@ -538,6 +566,7 @@ object<string, string> * close-non-object * deprecated * discard-returns + * invisible */ "strict": "Fallback", /* @@ -655,27 +684,75 @@ object<string, string> 优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1` */ "ambiguity-1": "Any", + /* + Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable. + */ "assign-type-mismatch": "Opened", + /* + Enable diagnostics for calls of asynchronous functions within a synchronous function. + */ "await-in-sync": "None", + /* + Enable diagnostics for casts of local variables where the target type does not match the defined type. + */ "cast-local-type": "Opened", + /* + Enable diagnostics for casts where the target type does not match the initial type. + */ "cast-type-mismatch": "Opened", "circle-doc-class": "Any", + /* + Enable diagnostics for attempts to close a variable with a non-object. + */ "close-non-object": "Any", + /* + Enable diagnostics for code placed after a break statement in a loop. + */ "code-after-break": "Opened", + /* + Enable diagnostics for incorrectly styled lines. + */ "codestyle-check": "None", + /* + Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing. + */ "count-down-loop": "Any", + /* + Enable diagnostics to highlight deprecated API. + */ "deprecated": "Any", + /* + Enable diagnostics for files which are required by two different paths. + */ "different-requires": "Any", + /* + Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored. + */ "discard-returns": "Any", + /* + Enable diagnostics to highlight a field annotation without a defining class annotation. + */ "doc-field-no-class": "Any", + /* + Enable diagnostics for a duplicated alias annotation name. + */ "duplicate-doc-alias": "Any", + /* + Enable diagnostics for a duplicated field annotation name. + */ "duplicate-doc-field": "Any", + /* + Enable diagnostics for a duplicated param annotation name. + */ "duplicate-doc-param": "Any", /* 在字面量表中重复定义了索引 */ "duplicate-index": "Any", - "duplicate-set-field": "Any", + /* + Enable diagnostics for setting the same field in a class more than once. + */ + "duplicate-set-field": "Opened", /* 空代码块 */ @@ -685,12 +762,28 @@ object<string, string> */ "global-in-nil-env": "Any", /* + Enable diagnostics for accesses to fields which are invisible. + */ + "invisible": "Any", + /* 首字母小写的全局变量定义 */ "lowercase-global": "Any", + /* + Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters. + */ "missing-parameter": "Any", + /* + Enable diagnostics for functions with return annotations which have no return statement. + */ "missing-return": "Any", + /* + Enable diagnostics for return statements without values although the containing function declares returns. + */ "missing-return-value": "Any", + /* + Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before. + */ "need-check-nil": "Opened", /* 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作 @@ -700,8 +793,17 @@ object<string, string> 以 `(` 开始的新行,在语法上被解析为了上一行的函数调用 */ "newline-call": "Any", + /* + Enable diagnostics for cases in which the type cannot be inferred. + */ "no-unknown": "None", + /* + Enable diagnostics for calls to `coroutine.yield()` when it is not permitted. + */ "not-yieldable": "None", + /* + Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition. + */ "param-type-mismatch": "Opened", /* 重复定义的局部变量 @@ -711,34 +813,73 @@ object<string, string> 函数调用时,传入了多余的参数 */ "redundant-parameter": "Any", + /* + Enable diagnostics for return statements which are not needed because the function would exit on its own. + */ "redundant-return": "Opened", + /* + Enable diagnostics for return statements which return an extra value which is not specified by a return annotation. + */ "redundant-return-value": "Any", /* 赋值操作时,值的数量比被赋值的对象多 */ "redundant-value": "Any", + /* + Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation. + */ "return-type-mismatch": "Opened", + /* + Enable diagnostics for typos in strings. + */ "spell-check": "None", /* 后置空格 */ "trailing-space": "Opened", + /* + Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`). + */ "unbalanced-assignments": "Any", + /* + Enable diagnostics for class annotations in which an undefined class is referenced. + */ "undefined-doc-class": "Any", + /* + Enable diagnostics for type annotations referencing an undefined type or alias. + */ "undefined-doc-name": "Any", + /* + Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition. + */ "undefined-doc-param": "Any", /* `_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中 */ "undefined-env-child": "Any", + /* + Enable diagnostics for cases in which an undefined field of a variable is read. + */ "undefined-field": "Opened", /* 未定义的全局变量 */ "undefined-global": "Any", + /* + Enable diagnostics for casts of undefined variables. + */ "unknown-cast-variable": "Any", + /* + Enable diagnostics in cases in which an unknown diagnostics code is entered. + */ "unknown-diag-code": "Any", + /* + Enable diagnostics for unknown operators. + */ "unknown-operator": "Any", + /* + Enable diagnostics for unreachable code. + */ "unreachable-code": "Opened", /* 未使用的函数 @@ -791,26 +932,74 @@ object<string, string> 优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1` */ "ambiguity-1": "Warning", + /* + Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable. + */ "assign-type-mismatch": "Warning", + /* + Enable diagnostics for calls of asynchronous functions within a synchronous function. + */ "await-in-sync": "Warning", + /* + Enable diagnostics for casts of local variables where the target type does not match the defined type. + */ "cast-local-type": "Warning", + /* + Enable diagnostics for casts where the target type does not match the initial type. + */ "cast-type-mismatch": "Warning", "circle-doc-class": "Warning", + /* + Enable diagnostics for attempts to close a variable with a non-object. + */ "close-non-object": "Warning", + /* + Enable diagnostics for code placed after a break statement in a loop. + */ "code-after-break": "Hint", + /* + Enable diagnostics for incorrectly styled lines. + */ "codestyle-check": "Warning", + /* + Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing. + */ "count-down-loop": "Warning", + /* + Enable diagnostics to highlight deprecated API. + */ "deprecated": "Warning", + /* + Enable diagnostics for files which are required by two different paths. + */ "different-requires": "Warning", + /* + Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored. + */ "discard-returns": "Warning", + /* + Enable diagnostics to highlight a field annotation without a defining class annotation. + */ "doc-field-no-class": "Warning", + /* + Enable diagnostics for a duplicated alias annotation name. + */ "duplicate-doc-alias": "Warning", + /* + Enable diagnostics for a duplicated field annotation name. + */ "duplicate-doc-field": "Warning", + /* + Enable diagnostics for a duplicated param annotation name. + */ "duplicate-doc-param": "Warning", /* 在字面量表中重复定义了索引 */ "duplicate-index": "Warning", + /* + Enable diagnostics for setting the same field in a class more than once. + */ "duplicate-set-field": "Warning", /* 空代码块 @@ -821,12 +1010,28 @@ object<string, string> */ "global-in-nil-env": "Warning", /* + Enable diagnostics for accesses to fields which are invisible. + */ + "invisible": "Warning", + /* 首字母小写的全局变量定义 */ "lowercase-global": "Information", + /* + Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters. + */ "missing-parameter": "Warning", + /* + Enable diagnostics for functions with return annotations which have no return statement. + */ "missing-return": "Warning", + /* + Enable diagnostics for return statements without values although the containing function declares returns. + */ "missing-return-value": "Warning", + /* + Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before. + */ "need-check-nil": "Warning", /* 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作 @@ -836,8 +1041,17 @@ object<string, string> 以 `(` 开始的新行,在语法上被解析为了上一行的函数调用 */ "newline-call": "Warning", + /* + Enable diagnostics for cases in which the type cannot be inferred. + */ "no-unknown": "Warning", + /* + Enable diagnostics for calls to `coroutine.yield()` when it is not permitted. + */ "not-yieldable": "Warning", + /* + Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition. + */ "param-type-mismatch": "Warning", /* 重复定义的局部变量 @@ -847,34 +1061,73 @@ object<string, string> 函数调用时,传入了多余的参数 */ "redundant-parameter": "Warning", + /* + Enable diagnostics for return statements which are not needed because the function would exit on its own. + */ "redundant-return": "Hint", + /* + Enable diagnostics for return statements which return an extra value which is not specified by a return annotation. + */ "redundant-return-value": "Warning", /* 赋值操作时,值的数量比被赋值的对象多 */ "redundant-value": "Warning", + /* + Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation. + */ "return-type-mismatch": "Warning", + /* + Enable diagnostics for typos in strings. + */ "spell-check": "Information", /* 后置空格 */ "trailing-space": "Hint", + /* + Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`). + */ "unbalanced-assignments": "Warning", + /* + Enable diagnostics for class annotations in which an undefined class is referenced. + */ "undefined-doc-class": "Warning", + /* + Enable diagnostics for type annotations referencing an undefined type or alias. + */ "undefined-doc-name": "Warning", + /* + Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition. + */ "undefined-doc-param": "Warning", /* `_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中 */ "undefined-env-child": "Information", + /* + Enable diagnostics for cases in which an undefined field of a variable is read. + */ "undefined-field": "Warning", /* 未定义的全局变量 */ "undefined-global": "Warning", + /* + Enable diagnostics for casts of undefined variables. + */ "unknown-cast-variable": "Warning", + /* + Enable diagnostics in cases in which an unknown diagnostics code is entered. + */ "unknown-diag-code": "Warning", + /* + Enable diagnostics for unknown operators. + */ "unknown-operator": "Warning", + /* + Enable diagnostics for unreachable code. + */ "unreachable-code": "Hint", /* 未使用的函数 @@ -913,7 +1166,7 @@ Array<string> # 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. +Latency (milliseconds) for workspace diagnostics. ## type @@ -927,6 +1180,28 @@ integer 3000 ``` +# diagnostics.workspaceEvent + +Set the time to trigger workspace diagnostics. + +## type + +```ts +string +``` + +## enum + +* ``"OnChange"``: Trigger workspace diagnostics when the file is changed. +* ``"OnSave"``: Trigger workspace diagnostics when the file is saved. +* ``"None"``: Disable workspace diagnostics. + +## default + +```jsonc +"OnSave" +``` + # 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. @@ -943,6 +1218,54 @@ integer 100 ``` +# doc.packageName + +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. + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + +# doc.privateName + +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. + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + +# doc.protectedName + +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. + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + # format.defaultConfig The default format configuration. Has a lower priority than `.editorconfig` file in the workspace. @@ -1220,6 +1543,22 @@ integer 1000 ``` +# misc.executablePath + +Specify the executable path in VSCode. + +## type + +```ts +string +``` + +## default + +```jsonc +"" +``` + # misc.parameters [Command line parameters](https://github.com/sumneko/lua-telemetry-server/tree/master/method) when starting the language service in VSCode. @@ -1274,6 +1613,7 @@ object<string, string> "os": "default", "package": "default", "string": "default", + "string.buffer": "default", "table": "default", "table.clear": "default", "table.new": "default", @@ -1656,6 +1996,35 @@ boolean false ``` +# typeFormat.config + +Configures the formatting behavior while typing Lua code. + +## type + +```ts +object<string, string> +``` + +## default + +```jsonc +{ + /* + Controls if `end` is automatically completed at suitable positions. + */ + "auto_complete_end": "true", + /* + Controls if a separator is automatically appended at the end of a table declaration. + */ + "auto_complete_table_sep": "true", + /* + Controls if a line is formatted at all. + */ + "format_line": "true" +} +``` + # window.progressBar Show progress bar in status bar. diff --git a/doc/zh-cn/config.md b/doc/zh-cn/config.md index 00739179..3cde1608 100644 --- a/doc/zh-cn/config.md +++ b/doc/zh-cn/config.md @@ -224,10 +224,36 @@ Array<string> * ``"exp-in-action"`` * ``"global-in-nil-env"`` * ``"index-in-func-name"`` +* ``"invisible"`` * ``"jump-local-scope"`` * ``"keyword"`` * ``"local-limit"`` * ``"lowercase-global"`` +* ``"lua-doc-miss-sign"`` +* ``"luadoc-error-diag-mode"`` +* ``"luadoc-miss-alias-extends"`` +* ``"luadoc-miss-alias-name"`` +* ``"luadoc-miss-arg-name"`` +* ``"luadoc-miss-cate-name"`` +* ``"luadoc-miss-class-extends-name"`` +* ``"luadoc-miss-class-name"`` +* ``"luadoc-miss-diag-mode"`` +* ``"luadoc-miss-diag-name"`` +* ``"luadoc-miss-field-extends"`` +* ``"luadoc-miss-field-name"`` +* ``"luadoc-miss-fun-after-overload"`` +* ``"luadoc-miss-generic-name"`` +* ``"luadoc-miss-local-name"`` +* ``"luadoc-miss-module-name"`` +* ``"luadoc-miss-operator-name"`` +* ``"luadoc-miss-param-extends"`` +* ``"luadoc-miss-param-name"`` +* ``"luadoc-miss-see-name"`` +* ``"luadoc-miss-sign-name"`` +* ``"luadoc-miss-symbol"`` +* ``"luadoc-miss-type-name"`` +* ``"luadoc-miss-vararg-type"`` +* ``"luadoc-miss-version"`` * ``"malformed-number"`` * ``"miss-end"`` * ``"miss-esc-x"`` @@ -245,6 +271,7 @@ Array<string> * ``"missing-return"`` * ``"missing-return-value"`` * ``"need-check-nil"`` +* ``"need-paren"`` * ``"newfield-call"`` * ``"newline-call"`` * ``"no-unknown"`` @@ -420,6 +447,7 @@ object<string, string> * close-non-object * deprecated * discard-returns + * invisible */ "strict": "Fallback", /* @@ -538,6 +566,7 @@ object<string, string> * close-non-object * deprecated * discard-returns + * invisible */ "strict": "Fallback", /* @@ -655,27 +684,75 @@ object<string, string> 优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1` */ "ambiguity-1": "Any", + /* + Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable. + */ "assign-type-mismatch": "Opened", + /* + Enable diagnostics for calls of asynchronous functions within a synchronous function. + */ "await-in-sync": "None", + /* + Enable diagnostics for casts of local variables where the target type does not match the defined type. + */ "cast-local-type": "Opened", + /* + Enable diagnostics for casts where the target type does not match the initial type. + */ "cast-type-mismatch": "Opened", "circle-doc-class": "Any", + /* + Enable diagnostics for attempts to close a variable with a non-object. + */ "close-non-object": "Any", + /* + Enable diagnostics for code placed after a break statement in a loop. + */ "code-after-break": "Opened", + /* + Enable diagnostics for incorrectly styled lines. + */ "codestyle-check": "None", + /* + Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing. + */ "count-down-loop": "Any", + /* + Enable diagnostics to highlight deprecated API. + */ "deprecated": "Any", + /* + Enable diagnostics for files which are required by two different paths. + */ "different-requires": "Any", + /* + Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored. + */ "discard-returns": "Any", + /* + Enable diagnostics to highlight a field annotation without a defining class annotation. + */ "doc-field-no-class": "Any", + /* + Enable diagnostics for a duplicated alias annotation name. + */ "duplicate-doc-alias": "Any", + /* + Enable diagnostics for a duplicated field annotation name. + */ "duplicate-doc-field": "Any", + /* + Enable diagnostics for a duplicated param annotation name. + */ "duplicate-doc-param": "Any", /* 在字面量表中重复定义了索引 */ "duplicate-index": "Any", - "duplicate-set-field": "Any", + /* + Enable diagnostics for setting the same field in a class more than once. + */ + "duplicate-set-field": "Opened", /* 空代码块 */ @@ -685,12 +762,28 @@ object<string, string> */ "global-in-nil-env": "Any", /* + Enable diagnostics for accesses to fields which are invisible. + */ + "invisible": "Any", + /* 首字母小写的全局变量定义 */ "lowercase-global": "Any", + /* + Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters. + */ "missing-parameter": "Any", + /* + Enable diagnostics for functions with return annotations which have no return statement. + */ "missing-return": "Any", + /* + Enable diagnostics for return statements without values although the containing function declares returns. + */ "missing-return-value": "Any", + /* + Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before. + */ "need-check-nil": "Opened", /* 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作 @@ -700,8 +793,17 @@ object<string, string> 以 `(` 开始的新行,在语法上被解析为了上一行的函数调用 */ "newline-call": "Any", + /* + Enable diagnostics for cases in which the type cannot be inferred. + */ "no-unknown": "None", + /* + Enable diagnostics for calls to `coroutine.yield()` when it is not permitted. + */ "not-yieldable": "None", + /* + Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition. + */ "param-type-mismatch": "Opened", /* 重复定义的局部变量 @@ -711,34 +813,73 @@ object<string, string> 函数调用时,传入了多余的参数 */ "redundant-parameter": "Any", + /* + Enable diagnostics for return statements which are not needed because the function would exit on its own. + */ "redundant-return": "Opened", + /* + Enable diagnostics for return statements which return an extra value which is not specified by a return annotation. + */ "redundant-return-value": "Any", /* 赋值操作时,值的数量比被赋值的对象多 */ "redundant-value": "Any", + /* + Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation. + */ "return-type-mismatch": "Opened", + /* + Enable diagnostics for typos in strings. + */ "spell-check": "None", /* 后置空格 */ "trailing-space": "Opened", + /* + Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`). + */ "unbalanced-assignments": "Any", + /* + Enable diagnostics for class annotations in which an undefined class is referenced. + */ "undefined-doc-class": "Any", + /* + Enable diagnostics for type annotations referencing an undefined type or alias. + */ "undefined-doc-name": "Any", + /* + Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition. + */ "undefined-doc-param": "Any", /* `_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中 */ "undefined-env-child": "Any", + /* + Enable diagnostics for cases in which an undefined field of a variable is read. + */ "undefined-field": "Opened", /* 未定义的全局变量 */ "undefined-global": "Any", + /* + Enable diagnostics for casts of undefined variables. + */ "unknown-cast-variable": "Any", + /* + Enable diagnostics in cases in which an unknown diagnostics code is entered. + */ "unknown-diag-code": "Any", + /* + Enable diagnostics for unknown operators. + */ "unknown-operator": "Any", + /* + Enable diagnostics for unreachable code. + */ "unreachable-code": "Opened", /* 未使用的函数 @@ -790,26 +931,74 @@ object<string, string> 优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1` */ "ambiguity-1": "Warning", + /* + Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable. + */ "assign-type-mismatch": "Warning", + /* + Enable diagnostics for calls of asynchronous functions within a synchronous function. + */ "await-in-sync": "Warning", + /* + Enable diagnostics for casts of local variables where the target type does not match the defined type. + */ "cast-local-type": "Warning", + /* + Enable diagnostics for casts where the target type does not match the initial type. + */ "cast-type-mismatch": "Warning", "circle-doc-class": "Warning", + /* + Enable diagnostics for attempts to close a variable with a non-object. + */ "close-non-object": "Warning", + /* + Enable diagnostics for code placed after a break statement in a loop. + */ "code-after-break": "Hint", + /* + Enable diagnostics for incorrectly styled lines. + */ "codestyle-check": "Warning", + /* + Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing. + */ "count-down-loop": "Warning", + /* + Enable diagnostics to highlight deprecated API. + */ "deprecated": "Warning", + /* + Enable diagnostics for files which are required by two different paths. + */ "different-requires": "Warning", + /* + Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored. + */ "discard-returns": "Warning", + /* + Enable diagnostics to highlight a field annotation without a defining class annotation. + */ "doc-field-no-class": "Warning", + /* + Enable diagnostics for a duplicated alias annotation name. + */ "duplicate-doc-alias": "Warning", + /* + Enable diagnostics for a duplicated field annotation name. + */ "duplicate-doc-field": "Warning", + /* + Enable diagnostics for a duplicated param annotation name. + */ "duplicate-doc-param": "Warning", /* 在字面量表中重复定义了索引 */ "duplicate-index": "Warning", + /* + Enable diagnostics for setting the same field in a class more than once. + */ "duplicate-set-field": "Warning", /* 空代码块 @@ -820,12 +1009,28 @@ object<string, string> */ "global-in-nil-env": "Warning", /* + Enable diagnostics for accesses to fields which are invisible. + */ + "invisible": "Warning", + /* 首字母小写的全局变量定义 */ "lowercase-global": "Information", + /* + Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters. + */ "missing-parameter": "Warning", + /* + Enable diagnostics for functions with return annotations which have no return statement. + */ "missing-return": "Warning", + /* + Enable diagnostics for return statements without values although the containing function declares returns. + */ "missing-return-value": "Warning", + /* + Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before. + */ "need-check-nil": "Warning", /* 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作 @@ -835,8 +1040,17 @@ object<string, string> 以 `(` 开始的新行,在语法上被解析为了上一行的函数调用 */ "newline-call": "Warning", + /* + Enable diagnostics for cases in which the type cannot be inferred. + */ "no-unknown": "Warning", + /* + Enable diagnostics for calls to `coroutine.yield()` when it is not permitted. + */ "not-yieldable": "Warning", + /* + Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition. + */ "param-type-mismatch": "Warning", /* 重复定义的局部变量 @@ -846,34 +1060,73 @@ object<string, string> 函数调用时,传入了多余的参数 */ "redundant-parameter": "Warning", + /* + Enable diagnostics for return statements which are not needed because the function would exit on its own. + */ "redundant-return": "Hint", + /* + Enable diagnostics for return statements which return an extra value which is not specified by a return annotation. + */ "redundant-return-value": "Warning", /* 赋值操作时,值的数量比被赋值的对象多 */ "redundant-value": "Warning", + /* + Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation. + */ "return-type-mismatch": "Warning", + /* + Enable diagnostics for typos in strings. + */ "spell-check": "Information", /* 后置空格 */ "trailing-space": "Hint", + /* + Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`). + */ "unbalanced-assignments": "Warning", + /* + Enable diagnostics for class annotations in which an undefined class is referenced. + */ "undefined-doc-class": "Warning", + /* + Enable diagnostics for type annotations referencing an undefined type or alias. + */ "undefined-doc-name": "Warning", + /* + Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition. + */ "undefined-doc-param": "Warning", /* `_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中 */ "undefined-env-child": "Information", + /* + Enable diagnostics for cases in which an undefined field of a variable is read. + */ "undefined-field": "Warning", /* 未定义的全局变量 */ "undefined-global": "Warning", + /* + Enable diagnostics for casts of undefined variables. + */ "unknown-cast-variable": "Warning", + /* + Enable diagnostics in cases in which an unknown diagnostics code is entered. + */ "unknown-diag-code": "Warning", + /* + Enable diagnostics for unknown operators. + */ "unknown-operator": "Warning", + /* + Enable diagnostics for unreachable code. + */ "unreachable-code": "Hint", /* 未使用的函数 @@ -912,7 +1165,7 @@ Array<string> # diagnostics.workspaceDelay -进行工作区诊断的延迟(毫秒)。当你启动工作区,或编辑了任意文件后,将会在后台对整个工作区进行重新诊断。设置为负数可以禁用工作区诊断。 +进行工作区诊断的延迟(毫秒)。 ## type @@ -926,6 +1179,28 @@ integer 3000 ``` +# diagnostics.workspaceEvent + +设置触发工作区诊断的时机。 + +## type + +```ts +string +``` + +## enum + +* ``"OnChange"``: 当文件发生变化时触发工作区诊断。 +* ``"OnSave"``: 当文件保存时触发工作区诊断。 +* ``"None"``: 关闭工作区诊断。 + +## default + +```jsonc +"OnSave" +``` + # diagnostics.workspaceRate 工作区诊断的运行速率(百分比)。降低该值会减少CPU占用,但是也会降低工作区诊断的速度。你当前正在编辑的文件的诊断总是全速完成,不受该选项影响。 @@ -942,6 +1217,54 @@ integer 100 ``` +# doc.packageName + +将特定名称的字段视为package,例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 只能在定义所在的文件中访问。 + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + +# doc.privateName + +将特定名称的字段视为私有,例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 是私有字段,只能在定义所在的类中访问。 + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + +# doc.protectedName + +将特定名称的字段视为受保护,例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 是受保护的字段,只能在定义所在的类极其子类中访问。 + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + # format.defaultConfig 默认的格式化配置,优先级低于工作区内的 `.editorconfig` 文件。 @@ -1219,6 +1542,22 @@ integer 1000 ``` +# misc.executablePath + +VSCode中指定可执行文件路径。 + +## type + +```ts +string +``` + +## default + +```jsonc +"" +``` + # misc.parameters VSCode中启动语言服务时的[命令行参数](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#arguments)。 @@ -1273,6 +1612,7 @@ object<string, string> "os": "default", "package": "default", "string": "default", + "string.buffer": "default", "table": "default", "table.clear": "default", "table.new": "default", @@ -1655,6 +1995,35 @@ boolean false ``` +# typeFormat.config + +Configures the formatting behavior while typing Lua code. + +## type + +```ts +object<string, string> +``` + +## default + +```jsonc +{ + /* + Controls if `end` is automatically completed at suitable positions. + */ + "auto_complete_end": "true", + /* + Controls if a separator is automatically appended at the end of a table declaration. + */ + "auto_complete_table_sep": "true", + /* + Controls if a line is formatted at all. + */ + "format_line": "true" +} +``` + # window.progressBar 在状态栏显示进度条。 diff --git a/doc/zh-tw/config.md b/doc/zh-tw/config.md index 95a03011..636cdd1a 100644 --- a/doc/zh-tw/config.md +++ b/doc/zh-tw/config.md @@ -224,10 +224,36 @@ Array<string> * ``"exp-in-action"`` * ``"global-in-nil-env"`` * ``"index-in-func-name"`` +* ``"invisible"`` * ``"jump-local-scope"`` * ``"keyword"`` * ``"local-limit"`` * ``"lowercase-global"`` +* ``"lua-doc-miss-sign"`` +* ``"luadoc-error-diag-mode"`` +* ``"luadoc-miss-alias-extends"`` +* ``"luadoc-miss-alias-name"`` +* ``"luadoc-miss-arg-name"`` +* ``"luadoc-miss-cate-name"`` +* ``"luadoc-miss-class-extends-name"`` +* ``"luadoc-miss-class-name"`` +* ``"luadoc-miss-diag-mode"`` +* ``"luadoc-miss-diag-name"`` +* ``"luadoc-miss-field-extends"`` +* ``"luadoc-miss-field-name"`` +* ``"luadoc-miss-fun-after-overload"`` +* ``"luadoc-miss-generic-name"`` +* ``"luadoc-miss-local-name"`` +* ``"luadoc-miss-module-name"`` +* ``"luadoc-miss-operator-name"`` +* ``"luadoc-miss-param-extends"`` +* ``"luadoc-miss-param-name"`` +* ``"luadoc-miss-see-name"`` +* ``"luadoc-miss-sign-name"`` +* ``"luadoc-miss-symbol"`` +* ``"luadoc-miss-type-name"`` +* ``"luadoc-miss-vararg-type"`` +* ``"luadoc-miss-version"`` * ``"malformed-number"`` * ``"miss-end"`` * ``"miss-esc-x"`` @@ -245,6 +271,7 @@ Array<string> * ``"missing-return"`` * ``"missing-return-value"`` * ``"need-check-nil"`` +* ``"need-paren"`` * ``"newfield-call"`` * ``"newline-call"`` * ``"no-unknown"`` @@ -420,6 +447,7 @@ object<string, string> * close-non-object * deprecated * discard-returns + * invisible */ "strict": "Fallback", /* @@ -538,6 +566,7 @@ object<string, string> * close-non-object * deprecated * discard-returns + * invisible */ "strict": "Fallback", /* @@ -655,27 +684,75 @@ object<string, string> 優先順序歧義,如: `num or 0 + 1` ,推測使用者的實際期望為 `(num or 0) + 1` */ "ambiguity-1": "Any", + /* + Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable. + */ "assign-type-mismatch": "Opened", + /* + Enable diagnostics for calls of asynchronous functions within a synchronous function. + */ "await-in-sync": "None", + /* + Enable diagnostics for casts of local variables where the target type does not match the defined type. + */ "cast-local-type": "Opened", + /* + Enable diagnostics for casts where the target type does not match the initial type. + */ "cast-type-mismatch": "Opened", "circle-doc-class": "Any", + /* + Enable diagnostics for attempts to close a variable with a non-object. + */ "close-non-object": "Any", + /* + Enable diagnostics for code placed after a break statement in a loop. + */ "code-after-break": "Opened", + /* + Enable diagnostics for incorrectly styled lines. + */ "codestyle-check": "None", + /* + Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing. + */ "count-down-loop": "Any", + /* + Enable diagnostics to highlight deprecated API. + */ "deprecated": "Any", + /* + Enable diagnostics for files which are required by two different paths. + */ "different-requires": "Any", + /* + Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored. + */ "discard-returns": "Any", + /* + Enable diagnostics to highlight a field annotation without a defining class annotation. + */ "doc-field-no-class": "Any", + /* + Enable diagnostics for a duplicated alias annotation name. + */ "duplicate-doc-alias": "Any", + /* + Enable diagnostics for a duplicated field annotation name. + */ "duplicate-doc-field": "Any", + /* + Enable diagnostics for a duplicated param annotation name. + */ "duplicate-doc-param": "Any", /* 在字面常數表中重複定義了索引 */ "duplicate-index": "Any", - "duplicate-set-field": "Any", + /* + Enable diagnostics for setting the same field in a class more than once. + */ + "duplicate-set-field": "Opened", /* 空程式碼區塊 */ @@ -685,12 +762,28 @@ object<string, string> */ "global-in-nil-env": "Any", /* + Enable diagnostics for accesses to fields which are invisible. + */ + "invisible": "Any", + /* 首字母小寫的全域變數定義 */ "lowercase-global": "Any", + /* + Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters. + */ "missing-parameter": "Any", + /* + Enable diagnostics for functions with return annotations which have no return statement. + */ "missing-return": "Any", + /* + Enable diagnostics for return statements without values although the containing function declares returns. + */ "missing-return-value": "Any", + /* + Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before. + */ "need-check-nil": "Opened", /* 在字面常數表中,2行程式碼之間缺少分隔符,在語法上被解析為了一次索引操作 @@ -700,8 +793,17 @@ object<string, string> 以 `(` 開始的新行,在語法上被解析為了上一行的函式呼叫 */ "newline-call": "Any", + /* + Enable diagnostics for cases in which the type cannot be inferred. + */ "no-unknown": "None", + /* + Enable diagnostics for calls to `coroutine.yield()` when it is not permitted. + */ "not-yieldable": "None", + /* + Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition. + */ "param-type-mismatch": "Opened", /* 重複定義的區域變數 @@ -711,34 +813,73 @@ object<string, string> 函式呼叫時,傳入了多餘的引數 */ "redundant-parameter": "Any", + /* + Enable diagnostics for return statements which are not needed because the function would exit on its own. + */ "redundant-return": "Opened", + /* + Enable diagnostics for return statements which return an extra value which is not specified by a return annotation. + */ "redundant-return-value": "Any", /* 賦值操作時,值的數量比被賦值的對象多 */ "redundant-value": "Any", + /* + Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation. + */ "return-type-mismatch": "Opened", + /* + Enable diagnostics for typos in strings. + */ "spell-check": "None", /* 後置空格 */ "trailing-space": "Opened", + /* + Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`). + */ "unbalanced-assignments": "Any", + /* + Enable diagnostics for class annotations in which an undefined class is referenced. + */ "undefined-doc-class": "Any", + /* + Enable diagnostics for type annotations referencing an undefined type or alias. + */ "undefined-doc-name": "Any", + /* + Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition. + */ "undefined-doc-param": "Any", /* `_ENV` 被設定為了新的字面常數表,但是試圖獲取的全域變數不在這張表中 */ "undefined-env-child": "Any", + /* + Enable diagnostics for cases in which an undefined field of a variable is read. + */ "undefined-field": "Opened", /* 未定義的全域變數 */ "undefined-global": "Any", + /* + Enable diagnostics for casts of undefined variables. + */ "unknown-cast-variable": "Any", + /* + Enable diagnostics in cases in which an unknown diagnostics code is entered. + */ "unknown-diag-code": "Any", + /* + Enable diagnostics for unknown operators. + */ "unknown-operator": "Any", + /* + Enable diagnostics for unreachable code. + */ "unreachable-code": "Opened", /* 未使用的函式 @@ -790,26 +931,74 @@ object<string, string> 優先順序歧義,如: `num or 0 + 1` ,推測使用者的實際期望為 `(num or 0) + 1` */ "ambiguity-1": "Warning", + /* + Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable. + */ "assign-type-mismatch": "Warning", + /* + Enable diagnostics for calls of asynchronous functions within a synchronous function. + */ "await-in-sync": "Warning", + /* + Enable diagnostics for casts of local variables where the target type does not match the defined type. + */ "cast-local-type": "Warning", + /* + Enable diagnostics for casts where the target type does not match the initial type. + */ "cast-type-mismatch": "Warning", "circle-doc-class": "Warning", + /* + Enable diagnostics for attempts to close a variable with a non-object. + */ "close-non-object": "Warning", + /* + Enable diagnostics for code placed after a break statement in a loop. + */ "code-after-break": "Hint", + /* + Enable diagnostics for incorrectly styled lines. + */ "codestyle-check": "Warning", + /* + Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing. + */ "count-down-loop": "Warning", + /* + Enable diagnostics to highlight deprecated API. + */ "deprecated": "Warning", + /* + Enable diagnostics for files which are required by two different paths. + */ "different-requires": "Warning", + /* + Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored. + */ "discard-returns": "Warning", + /* + Enable diagnostics to highlight a field annotation without a defining class annotation. + */ "doc-field-no-class": "Warning", + /* + Enable diagnostics for a duplicated alias annotation name. + */ "duplicate-doc-alias": "Warning", + /* + Enable diagnostics for a duplicated field annotation name. + */ "duplicate-doc-field": "Warning", + /* + Enable diagnostics for a duplicated param annotation name. + */ "duplicate-doc-param": "Warning", /* 在字面常數表中重複定義了索引 */ "duplicate-index": "Warning", + /* + Enable diagnostics for setting the same field in a class more than once. + */ "duplicate-set-field": "Warning", /* 空程式碼區塊 @@ -820,12 +1009,28 @@ object<string, string> */ "global-in-nil-env": "Warning", /* + Enable diagnostics for accesses to fields which are invisible. + */ + "invisible": "Warning", + /* 首字母小寫的全域變數定義 */ "lowercase-global": "Information", + /* + Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters. + */ "missing-parameter": "Warning", + /* + Enable diagnostics for functions with return annotations which have no return statement. + */ "missing-return": "Warning", + /* + Enable diagnostics for return statements without values although the containing function declares returns. + */ "missing-return-value": "Warning", + /* + Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before. + */ "need-check-nil": "Warning", /* 在字面常數表中,2行程式碼之間缺少分隔符,在語法上被解析為了一次索引操作 @@ -835,8 +1040,17 @@ object<string, string> 以 `(` 開始的新行,在語法上被解析為了上一行的函式呼叫 */ "newline-call": "Warning", + /* + Enable diagnostics for cases in which the type cannot be inferred. + */ "no-unknown": "Warning", + /* + Enable diagnostics for calls to `coroutine.yield()` when it is not permitted. + */ "not-yieldable": "Warning", + /* + Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition. + */ "param-type-mismatch": "Warning", /* 重複定義的區域變數 @@ -846,34 +1060,73 @@ object<string, string> 函式呼叫時,傳入了多餘的引數 */ "redundant-parameter": "Warning", + /* + Enable diagnostics for return statements which are not needed because the function would exit on its own. + */ "redundant-return": "Hint", + /* + Enable diagnostics for return statements which return an extra value which is not specified by a return annotation. + */ "redundant-return-value": "Warning", /* 賦值操作時,值的數量比被賦值的對象多 */ "redundant-value": "Warning", + /* + Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation. + */ "return-type-mismatch": "Warning", + /* + Enable diagnostics for typos in strings. + */ "spell-check": "Information", /* 後置空格 */ "trailing-space": "Hint", + /* + Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`). + */ "unbalanced-assignments": "Warning", + /* + Enable diagnostics for class annotations in which an undefined class is referenced. + */ "undefined-doc-class": "Warning", + /* + Enable diagnostics for type annotations referencing an undefined type or alias. + */ "undefined-doc-name": "Warning", + /* + Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition. + */ "undefined-doc-param": "Warning", /* `_ENV` 被設定為了新的字面常數表,但是試圖獲取的全域變數不在這張表中 */ "undefined-env-child": "Information", + /* + Enable diagnostics for cases in which an undefined field of a variable is read. + */ "undefined-field": "Warning", /* 未定義的全域變數 */ "undefined-global": "Warning", + /* + Enable diagnostics for casts of undefined variables. + */ "unknown-cast-variable": "Warning", + /* + Enable diagnostics in cases in which an unknown diagnostics code is entered. + */ "unknown-diag-code": "Warning", + /* + Enable diagnostics for unknown operators. + */ "unknown-operator": "Warning", + /* + Enable diagnostics for unreachable code. + */ "unreachable-code": "Hint", /* 未使用的函式 @@ -912,7 +1165,7 @@ Array<string> # diagnostics.workspaceDelay -進行工作區診斷的延遲(毫秒)。當你啟動工作區,或編輯了任何檔案後,將會在背景對整個工作區進行重新診斷。設定為負數可以停用工作區診斷。 +進行工作區診斷的延遲(毫秒)。 ## type @@ -926,6 +1179,28 @@ integer 3000 ``` +# diagnostics.workspaceEvent + +Set the time to trigger workspace diagnostics. + +## type + +```ts +string +``` + +## enum + +* ``"OnChange"``: Trigger workspace diagnostics when the file is changed. +* ``"OnSave"``: Trigger workspace diagnostics when the file is saved. +* ``"None"``: Disable workspace diagnostics. + +## default + +```jsonc +"OnSave" +``` + # diagnostics.workspaceRate 工作區診斷的執行速率(百分比)。降低該值會減少CPU使用率,但是也會降低工作區診斷的速度。你目前正在編輯的檔案的診斷總是全速完成,不受該選項影響。 @@ -942,6 +1217,54 @@ integer 100 ``` +# doc.packageName + +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. + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + +# doc.privateName + +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. + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + +# doc.protectedName + +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. + +## type + +```ts +Array<string> +``` + +## default + +```jsonc +[] +``` + # format.defaultConfig 預設的格式化組態,優先順序低於工作區內的 `.editorconfig` 檔案。 @@ -1219,6 +1542,22 @@ integer 1000 ``` +# misc.executablePath + +Specify the executable path in VSCode. + +## type + +```ts +string +``` + +## default + +```jsonc +"" +``` + # misc.parameters VSCode中啟動語言伺服時的[命令列參數](https://github.com/sumneko/lua-language-server/wiki/Getting-Started#arguments)。 @@ -1273,6 +1612,7 @@ object<string, string> "os": "default", "package": "default", "string": "default", + "string.buffer": "default", "table": "default", "table.clear": "default", "table.new": "default", @@ -1655,6 +1995,35 @@ boolean false ``` +# typeFormat.config + +Configures the formatting behavior while typing Lua code. + +## type + +```ts +object<string, string> +``` + +## default + +```jsonc +{ + /* + Controls if `end` is automatically completed at suitable positions. + */ + "auto_complete_end": "true", + /* + Controls if a separator is automatically appended at the end of a table declaration. + */ + "auto_complete_table_sep": "true", + /* + Controls if a line is formatted at all. + */ + "format_line": "true" +} +``` + # window.progressBar 在狀態欄顯示進度條。 diff --git a/locale/en-us/setting.lua b/locale/en-us/setting.lua index 13334fc3..507893bd 100644 --- a/locale/en-us/setting.lua +++ b/locale/en-us/setting.lua @@ -369,6 +369,8 @@ config.diagnostics['duplicate-doc-param'] = 'Enable diagnostics for a duplicated param annotation name.' config.diagnostics['duplicate-set-field'] = 'Enable diagnostics for setting the same field in a class more than once.' +config.diagnostics['invisible'] = +'Enable diagnostics for accesses to fields which are invisible.' config.diagnostics['missing-parameter'] = 'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' config.diagnostics['missing-return'] = @@ -409,3 +411,11 @@ config.diagnostics['unknown-operator'] = 'Enable diagnostics for unknown operators.' config.diagnostics['unreachable-code'] = 'Enable diagnostics for unreachable code.' +config.typeFormat.config = +'Configures the formatting behavior while typing Lua code.' +config.typeFormat.config.auto_complete_end = +'Controls if `end` is automatically completed at suitable positions.' +config.typeFormat.config.auto_complete_table_sep = +'Controls if a separator is automatically appended at the end of a table declaration.' +config.typeFormat.config.format_line = +'Controls if a line is formatted at all.' diff --git a/locale/pt-br/setting.lua b/locale/pt-br/setting.lua index 8770548f..efc936e2 100644 --- a/locale/pt-br/setting.lua +++ b/locale/pt-br/setting.lua @@ -369,6 +369,8 @@ config.diagnostics['duplicate-doc-param'] = -- TODO: need translate! 'Enable diagnostics for a duplicated param annotation name.' config.diagnostics['duplicate-set-field'] = -- TODO: need translate! 'Enable diagnostics for setting the same field in a class more than once.' +config.diagnostics['invisible'] = -- TODO: need translate! +'Enable diagnostics for accesses to fields which are invisible.' config.diagnostics['missing-parameter'] = -- TODO: need translate! 'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' config.diagnostics['missing-return'] = -- TODO: need translate! @@ -409,3 +411,11 @@ config.diagnostics['unknown-operator'] = -- TODO: need translate! 'Enable diagnostics for unknown operators.' config.diagnostics['unreachable-code'] = -- TODO: need translate! 'Enable diagnostics for unreachable code.' +config.typeFormat.config = -- TODO: need translate! +'Configures the formatting behavior while typing Lua code.' +config.typeFormat.config.auto_complete_end = -- TODO: need translate! +'Controls if `end` is automatically completed at suitable positions.' +config.typeFormat.config.auto_complete_table_sep = -- TODO: need translate! +'Controls if a separator is automatically appended at the end of a table declaration.' +config.typeFormat.config.format_line = -- TODO: need translate! +'Controls if a line is formatted at all.' diff --git a/locale/zh-cn/setting.lua b/locale/zh-cn/setting.lua index 2bf5f9a6..c1dde6fb 100644 --- a/locale/zh-cn/setting.lua +++ b/locale/zh-cn/setting.lua @@ -368,6 +368,8 @@ config.diagnostics['duplicate-doc-param'] = -- TODO: need translate! 'Enable diagnostics for a duplicated param annotation name.' config.diagnostics['duplicate-set-field'] = -- TODO: need translate! 'Enable diagnostics for setting the same field in a class more than once.' +config.diagnostics['invisible'] = -- TODO: need translate! +'Enable diagnostics for accesses to fields which are invisible.' config.diagnostics['missing-parameter'] = -- TODO: need translate! 'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' config.diagnostics['missing-return'] = -- TODO: need translate! @@ -408,3 +410,11 @@ config.diagnostics['unknown-operator'] = -- TODO: need translate! 'Enable diagnostics for unknown operators.' config.diagnostics['unreachable-code'] = -- TODO: need translate! 'Enable diagnostics for unreachable code.' +config.typeFormat.config = -- TODO: need translate! +'Configures the formatting behavior while typing Lua code.' +config.typeFormat.config.auto_complete_end = -- TODO: need translate! +'Controls if `end` is automatically completed at suitable positions.' +config.typeFormat.config.auto_complete_table_sep = -- TODO: need translate! +'Controls if a separator is automatically appended at the end of a table declaration.' +config.typeFormat.config.format_line = -- TODO: need translate! +'Controls if a line is formatted at all.' diff --git a/locale/zh-tw/setting.lua b/locale/zh-tw/setting.lua index a2c34e29..b33ed782 100644 --- a/locale/zh-tw/setting.lua +++ b/locale/zh-tw/setting.lua @@ -368,6 +368,8 @@ config.diagnostics['duplicate-doc-param'] = -- TODO: need translate! 'Enable diagnostics for a duplicated param annotation name.' config.diagnostics['duplicate-set-field'] = -- TODO: need translate! 'Enable diagnostics for setting the same field in a class more than once.' +config.diagnostics['invisible'] = -- TODO: need translate! +'Enable diagnostics for accesses to fields which are invisible.' config.diagnostics['missing-parameter'] = -- TODO: need translate! 'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' config.diagnostics['missing-return'] = -- TODO: need translate! @@ -408,3 +410,11 @@ config.diagnostics['unknown-operator'] = -- TODO: need translate! 'Enable diagnostics for unknown operators.' config.diagnostics['unreachable-code'] = -- TODO: need translate! 'Enable diagnostics for unreachable code.' +config.typeFormat.config = -- TODO: need translate! +'Configures the formatting behavior while typing Lua code.' +config.typeFormat.config.auto_complete_end = -- TODO: need translate! +'Controls if `end` is automatically completed at suitable positions.' +config.typeFormat.config.auto_complete_table_sep = -- TODO: need translate! +'Controls if a separator is automatically appended at the end of a table declaration.' +config.typeFormat.config.format_line = -- TODO: need translate! +'Controls if a line is formatted at all.' |