summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/en-us/config.md384
-rw-r--r--doc/pt-br/config.md384
-rw-r--r--doc/zh-cn/config.md384
-rw-r--r--doc/zh-tw/config.md392
-rw-r--r--script/proto/diagnostic.lua2
-rw-r--r--tools/build-doc.lua39
6 files changed, 1305 insertions, 280 deletions
diff --git a/doc/en-us/config.md b/doc/en-us/config.md
index 629c2038..11c51f05 100644
--- a/doc/en-us/config.md
+++ b/doc/en-us/config.md
@@ -10,7 +10,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -32,7 +32,7 @@ string
## default
-```json
+```jsonc
"Disable"
```
@@ -48,7 +48,7 @@ integer
## default
-```json
+```jsonc
0
```
@@ -64,7 +64,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -86,7 +86,7 @@ string
## default
-```json
+```jsonc
"Replace"
```
@@ -102,7 +102,7 @@ string
## default
-```json
+```jsonc
"@"
```
@@ -118,7 +118,7 @@ string
## default
-```json
+```jsonc
"."
```
@@ -134,7 +134,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -156,7 +156,7 @@ string
## default
-```json
+```jsonc
"Fallback"
```
@@ -172,7 +172,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -188,7 +188,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -204,7 +204,7 @@ Array<string>
## default
-```json
+```jsonc
["git"]
```
@@ -220,7 +220,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -236,7 +236,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -267,19 +267,92 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ * ambiguity-1
+ * count-down-loop
+ * different-requires
+ * newfield-call
+ * newline-call
+ */
"ambiguity": "Fallback",
+ /*
+ * await-in-sync
+ * not-yieldable
+ */
"await": "Fallback",
+ /*
+ * codestyle-check
+ * spell-check
+ */
"codestyle": "Fallback",
+ /*
+ * duplicate-index
+ * duplicate-set-field
+ */
"duplicate": "Fallback",
+ /*
+ * global-in-nil-env
+ * lowercase-global
+ * undefined-env-child
+ * undefined-global
+ */
"global": "Fallback",
+ /*
+ * cast-type-mismatch
+ * circle-doc-class
+ * doc-field-no-class
+ * duplicate-doc-alias
+ * duplicate-doc-field
+ * duplicate-doc-param
+ * undefined-doc-class
+ * undefined-doc-name
+ * undefined-doc-param
+ * unknown-cast-variable
+ * unknown-diag-code
+ */
"luadoc": "Fallback",
- "no-unknown": "Fallback",
+ /*
+ * redefined-local
+ */
"redefined": "Fallback",
+ /*
+ * close-non-object
+ * deprecated
+ * discard-returns
+ */
"strict": "Fallback",
+ /*
+ * no-unknown
+ */
+ "strong": "Fallback",
+ /*
+ * assign-type-mismatch
+ * cast-local-type
+ * cast-type-mismatch
+ * need-check-nil
+ * param-type-mismatch
+ * undefined-field
+ */
"type-check": "Fallback",
+ /*
+ * missing-parameter
+ * redundant-parameter
+ * redundant-value
+ * unbalanced-assignments
+ */
"unbalanced": "Fallback",
+ /*
+ * code-after-break
+ * empty-block
+ * redundant-return
+ * trailing-space
+ * unused-function
+ * unused-label
+ * unused-local
+ * unused-vararg
+ */
"unused": "Fallback"
}
```
@@ -307,19 +380,92 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ * ambiguity-1
+ * count-down-loop
+ * different-requires
+ * newfield-call
+ * newline-call
+ */
"ambiguity": "Fallback",
+ /*
+ * await-in-sync
+ * not-yieldable
+ */
"await": "Fallback",
+ /*
+ * codestyle-check
+ * spell-check
+ */
"codestyle": "Fallback",
+ /*
+ * duplicate-index
+ * duplicate-set-field
+ */
"duplicate": "Fallback",
+ /*
+ * global-in-nil-env
+ * lowercase-global
+ * undefined-env-child
+ * undefined-global
+ */
"global": "Fallback",
+ /*
+ * cast-type-mismatch
+ * circle-doc-class
+ * doc-field-no-class
+ * duplicate-doc-alias
+ * duplicate-doc-field
+ * duplicate-doc-param
+ * undefined-doc-class
+ * undefined-doc-name
+ * undefined-doc-param
+ * unknown-cast-variable
+ * unknown-diag-code
+ */
"luadoc": "Fallback",
- "no-unknown": "Fallback",
+ /*
+ * redefined-local
+ */
"redefined": "Fallback",
+ /*
+ * close-non-object
+ * deprecated
+ * discard-returns
+ */
"strict": "Fallback",
+ /*
+ * no-unknown
+ */
+ "strong": "Fallback",
+ /*
+ * assign-type-mismatch
+ * cast-local-type
+ * cast-type-mismatch
+ * need-check-nil
+ * param-type-mismatch
+ * undefined-field
+ */
"type-check": "Fallback",
+ /*
+ * missing-parameter
+ * redundant-parameter
+ * redundant-value
+ * unbalanced-assignments
+ */
"unbalanced": "Fallback",
+ /*
+ * code-after-break
+ * empty-block
+ * redundant-return
+ * trailing-space
+ * unused-function
+ * unused-label
+ * unused-local
+ * unused-vararg
+ */
"unused": "Fallback"
}
```
@@ -342,7 +488,7 @@ string
## default
-```json
+```jsonc
"Opened"
```
@@ -364,7 +510,7 @@ string
## default
-```json
+```jsonc
"Opened"
```
@@ -394,8 +540,11 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead.
+ */
"ambiguity-1": "Any",
"assign-type-mismatch": "Opened",
"await-in-sync": "None",
@@ -413,36 +562,84 @@ object<string, string>
"duplicate-doc-alias": "Any",
"duplicate-doc-field": "Any",
"duplicate-doc-param": "Any",
+ /*
+ Enable duplicate table index diagnostics.
+ */
"duplicate-index": "Any",
"duplicate-set-field": "Any",
+ /*
+ Enable empty code block diagnostics.
+ */
"empty-block": "Opened",
+ /*
+ Enable cannot use global variables ( `_ENV` is set to `nil`) diagnostics.
+ */
"global-in-nil-env": "Any",
+ /*
+ Enable lowercase global variable definition diagnostics.
+ */
"lowercase-global": "Any",
"missing-parameter": "Any",
"need-check-nil": "Opened",
+ /*
+ 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作
+ */
"newfield-call": "Any",
+ /*
+ Enable newline call diagnostics. Is's raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.
+ */
"newline-call": "Any",
"no-unknown": "None",
"not-yieldable": "None",
"param-type-mismatch": "Opened",
+ /*
+ Enable redefined local variable diagnostics.
+ */
"redefined-local": "Opened",
+ /*
+ Enable redundant function parameter diagnostics.
+ */
"redundant-parameter": "Any",
"redundant-return": "Opened",
+ /*
+ Enable the redundant values assigned diagnostics. It's raised during assignment operation, when the number of values is higher than the number of objects being assigned.
+ */
"redundant-value": "Any",
"spell-check": "None",
+ /*
+ Enable trailing space diagnostics.
+ */
"trailing-space": "Opened",
"unbalanced-assignments": "Any",
"undefined-doc-class": "Any",
"undefined-doc-name": "Any",
"undefined-doc-param": "Any",
+ /*
+ Enable undefined environment variable diagnostics. It's raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment.
+ */
"undefined-env-child": "Any",
"undefined-field": "Opened",
+ /*
+ Enable undefined global variable diagnostics.
+ */
"undefined-global": "Any",
"unknown-cast-variable": "Any",
"unknown-diag-code": "Any",
+ /*
+ Enable unused function diagnostics.
+ */
"unused-function": "Opened",
+ /*
+ Enable unused label diagnostics.
+ */
"unused-label": "Opened",
+ /*
+ Enable unused local variable diagnostics.
+ */
"unused-local": "Opened",
+ /*
+ Enable unused vararg diagnostics.
+ */
"unused-vararg": "Opened"
}
```
@@ -473,8 +670,11 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead.
+ */
"ambiguity-1": "Warning",
"assign-type-mismatch": "Warning",
"await-in-sync": "Warning",
@@ -492,36 +692,84 @@ object<string, string>
"duplicate-doc-alias": "Warning",
"duplicate-doc-field": "Warning",
"duplicate-doc-param": "Warning",
+ /*
+ Enable duplicate table index diagnostics.
+ */
"duplicate-index": "Warning",
"duplicate-set-field": "Warning",
+ /*
+ Enable empty code block diagnostics.
+ */
"empty-block": "Hint",
+ /*
+ Enable cannot use global variables ( `_ENV` is set to `nil`) diagnostics.
+ */
"global-in-nil-env": "Warning",
+ /*
+ Enable lowercase global variable definition diagnostics.
+ */
"lowercase-global": "Information",
"missing-parameter": "Warning",
"need-check-nil": "Warning",
+ /*
+ 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作
+ */
"newfield-call": "Warning",
+ /*
+ Enable newline call diagnostics. Is's raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.
+ */
"newline-call": "Warning",
"no-unknown": "Warning",
"not-yieldable": "Warning",
"param-type-mismatch": "Warning",
+ /*
+ Enable redefined local variable diagnostics.
+ */
"redefined-local": "Hint",
+ /*
+ Enable redundant function parameter diagnostics.
+ */
"redundant-parameter": "Warning",
"redundant-return": "Hint",
+ /*
+ Enable the redundant values assigned diagnostics. It's raised during assignment operation, when the number of values is higher than the number of objects being assigned.
+ */
"redundant-value": "Warning",
"spell-check": "Information",
+ /*
+ Enable trailing space diagnostics.
+ */
"trailing-space": "Hint",
"unbalanced-assignments": "Warning",
"undefined-doc-class": "Warning",
"undefined-doc-name": "Warning",
"undefined-doc-param": "Warning",
+ /*
+ Enable undefined environment variable diagnostics. It's raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment.
+ */
"undefined-env-child": "Information",
"undefined-field": "Warning",
+ /*
+ Enable undefined global variable diagnostics.
+ */
"undefined-global": "Warning",
"unknown-cast-variable": "Warning",
"unknown-diag-code": "Warning",
+ /*
+ Enable unused function diagnostics.
+ */
"unused-function": "Hint",
+ /*
+ Enable unused label diagnostics.
+ */
"unused-label": "Hint",
+ /*
+ Enable unused local variable diagnostics.
+ */
"unused-local": "Hint",
+ /*
+ Enable unused vararg diagnostics.
+ */
"unused-vararg": "Hint"
}
```
@@ -538,7 +786,7 @@ integer
## default
-```json
+```jsonc
3000
```
@@ -554,7 +802,7 @@ integer
## default
-```json
+```jsonc
100
```
@@ -572,7 +820,7 @@ Object<string, string>
## default
-```json
+```jsonc
{}
```
@@ -588,7 +836,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -610,7 +858,7 @@ string
## default
-```json
+```jsonc
"Auto"
```
@@ -626,7 +874,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -642,7 +890,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -664,7 +912,7 @@ string
## default
-```json
+```jsonc
"All"
```
@@ -680,7 +928,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -696,7 +944,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -712,7 +960,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -728,7 +976,7 @@ integer
## default
-```json
+```jsonc
5
```
@@ -745,7 +993,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -761,7 +1009,7 @@ integer
## default
-```json
+```jsonc
50
```
@@ -777,7 +1025,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -793,7 +1041,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -809,7 +1057,7 @@ integer
## default
-```json
+```jsonc
1000
```
@@ -825,7 +1073,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -852,7 +1100,7 @@ object<string, string>
## default
-```json
+```jsonc
{
"basic": "default",
"bit": "default",
@@ -891,7 +1139,7 @@ string
## default
-```json
+```jsonc
"utf8"
```
@@ -907,7 +1155,7 @@ string
## default
-```json
+```jsonc
"${version} ${language} ${encoding}"
```
@@ -938,7 +1186,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -958,7 +1206,7 @@ Array<string>
## default
-```json
+```jsonc
["?.lua","?/init.lua"]
```
@@ -974,7 +1222,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -990,7 +1238,7 @@ string
## default
-```json
+```jsonc
""
```
@@ -1013,7 +1261,7 @@ Object<string, string>
## default
-```json
+```jsonc
{}
```
@@ -1029,7 +1277,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -1053,7 +1301,7 @@ string
## default
-```json
+```jsonc
"Lua 5.4"
```
@@ -1069,7 +1317,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1085,7 +1333,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1101,7 +1349,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -1117,7 +1365,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1133,7 +1381,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1149,7 +1397,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -1166,7 +1414,7 @@ boolean | null
## default
-```json
+```jsonc
null
```
@@ -1182,7 +1430,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1198,7 +1446,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1222,7 +1470,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1238,7 +1486,7 @@ Array<string>
## default
-```json
+```jsonc
[".vscode"]
```
@@ -1254,7 +1502,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1270,7 +1518,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -1286,7 +1534,7 @@ integer
## default
-```json
+```jsonc
5000
```
@@ -1302,7 +1550,7 @@ integer
## default
-```json
+```jsonc
500
```
@@ -1318,7 +1566,7 @@ Array<string>
## default
-```json
+```jsonc
["file","untitled","git"]
```
@@ -1334,7 +1582,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1350,6 +1598,6 @@ Array<string>
## default
-```json
+```jsonc
[]
``` \ No newline at end of file
diff --git a/doc/pt-br/config.md b/doc/pt-br/config.md
index 629c2038..af6cfba0 100644
--- a/doc/pt-br/config.md
+++ b/doc/pt-br/config.md
@@ -10,7 +10,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -32,7 +32,7 @@ string
## default
-```json
+```jsonc
"Disable"
```
@@ -48,7 +48,7 @@ integer
## default
-```json
+```jsonc
0
```
@@ -64,7 +64,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -86,7 +86,7 @@ string
## default
-```json
+```jsonc
"Replace"
```
@@ -102,7 +102,7 @@ string
## default
-```json
+```jsonc
"@"
```
@@ -118,7 +118,7 @@ string
## default
-```json
+```jsonc
"."
```
@@ -134,7 +134,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -156,7 +156,7 @@ string
## default
-```json
+```jsonc
"Fallback"
```
@@ -172,7 +172,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -188,7 +188,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -204,7 +204,7 @@ Array<string>
## default
-```json
+```jsonc
["git"]
```
@@ -220,7 +220,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -236,7 +236,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -267,19 +267,92 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ * ambiguity-1
+ * count-down-loop
+ * different-requires
+ * newfield-call
+ * newline-call
+ */
"ambiguity": "Fallback",
+ /*
+ * await-in-sync
+ * not-yieldable
+ */
"await": "Fallback",
+ /*
+ * codestyle-check
+ * spell-check
+ */
"codestyle": "Fallback",
+ /*
+ * duplicate-index
+ * duplicate-set-field
+ */
"duplicate": "Fallback",
+ /*
+ * global-in-nil-env
+ * lowercase-global
+ * undefined-env-child
+ * undefined-global
+ */
"global": "Fallback",
+ /*
+ * cast-type-mismatch
+ * circle-doc-class
+ * doc-field-no-class
+ * duplicate-doc-alias
+ * duplicate-doc-field
+ * duplicate-doc-param
+ * undefined-doc-class
+ * undefined-doc-name
+ * undefined-doc-param
+ * unknown-cast-variable
+ * unknown-diag-code
+ */
"luadoc": "Fallback",
- "no-unknown": "Fallback",
+ /*
+ * redefined-local
+ */
"redefined": "Fallback",
+ /*
+ * close-non-object
+ * deprecated
+ * discard-returns
+ */
"strict": "Fallback",
+ /*
+ * no-unknown
+ */
+ "strong": "Fallback",
+ /*
+ * assign-type-mismatch
+ * cast-local-type
+ * cast-type-mismatch
+ * need-check-nil
+ * param-type-mismatch
+ * undefined-field
+ */
"type-check": "Fallback",
+ /*
+ * missing-parameter
+ * redundant-parameter
+ * redundant-value
+ * unbalanced-assignments
+ */
"unbalanced": "Fallback",
+ /*
+ * code-after-break
+ * empty-block
+ * redundant-return
+ * trailing-space
+ * unused-function
+ * unused-label
+ * unused-local
+ * unused-vararg
+ */
"unused": "Fallback"
}
```
@@ -307,19 +380,92 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ * ambiguity-1
+ * count-down-loop
+ * different-requires
+ * newfield-call
+ * newline-call
+ */
"ambiguity": "Fallback",
+ /*
+ * await-in-sync
+ * not-yieldable
+ */
"await": "Fallback",
+ /*
+ * codestyle-check
+ * spell-check
+ */
"codestyle": "Fallback",
+ /*
+ * duplicate-index
+ * duplicate-set-field
+ */
"duplicate": "Fallback",
+ /*
+ * global-in-nil-env
+ * lowercase-global
+ * undefined-env-child
+ * undefined-global
+ */
"global": "Fallback",
+ /*
+ * cast-type-mismatch
+ * circle-doc-class
+ * doc-field-no-class
+ * duplicate-doc-alias
+ * duplicate-doc-field
+ * duplicate-doc-param
+ * undefined-doc-class
+ * undefined-doc-name
+ * undefined-doc-param
+ * unknown-cast-variable
+ * unknown-diag-code
+ */
"luadoc": "Fallback",
- "no-unknown": "Fallback",
+ /*
+ * redefined-local
+ */
"redefined": "Fallback",
+ /*
+ * close-non-object
+ * deprecated
+ * discard-returns
+ */
"strict": "Fallback",
+ /*
+ * no-unknown
+ */
+ "strong": "Fallback",
+ /*
+ * assign-type-mismatch
+ * cast-local-type
+ * cast-type-mismatch
+ * need-check-nil
+ * param-type-mismatch
+ * undefined-field
+ */
"type-check": "Fallback",
+ /*
+ * missing-parameter
+ * redundant-parameter
+ * redundant-value
+ * unbalanced-assignments
+ */
"unbalanced": "Fallback",
+ /*
+ * code-after-break
+ * empty-block
+ * redundant-return
+ * trailing-space
+ * unused-function
+ * unused-label
+ * unused-local
+ * unused-vararg
+ */
"unused": "Fallback"
}
```
@@ -342,7 +488,7 @@ string
## default
-```json
+```jsonc
"Opened"
```
@@ -364,7 +510,7 @@ string
## default
-```json
+```jsonc
"Opened"
```
@@ -394,8 +540,11 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ 优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1`
+ */
"ambiguity-1": "Any",
"assign-type-mismatch": "Opened",
"await-in-sync": "None",
@@ -413,36 +562,84 @@ object<string, string>
"duplicate-doc-alias": "Any",
"duplicate-doc-field": "Any",
"duplicate-doc-param": "Any",
+ /*
+ 在字面量表中重复定义了索引
+ */
"duplicate-index": "Any",
"duplicate-set-field": "Any",
+ /*
+ 空代码块
+ */
"empty-block": "Opened",
+ /*
+ 不能使用全局变量( `_ENV` 被设置为了 `nil`)
+ */
"global-in-nil-env": "Any",
+ /*
+ 首字母小写的全局变量定义
+ */
"lowercase-global": "Any",
"missing-parameter": "Any",
"need-check-nil": "Opened",
+ /*
+ 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作
+ */
"newfield-call": "Any",
+ /*
+ 以 `(` 开始的新行,在语法上被解析为了上一行的函数调用
+ */
"newline-call": "Any",
"no-unknown": "None",
"not-yieldable": "None",
"param-type-mismatch": "Opened",
+ /*
+ 重复定义的局部变量
+ */
"redefined-local": "Opened",
+ /*
+ 函数调用时,传入了多余的参数
+ */
"redundant-parameter": "Any",
"redundant-return": "Opened",
+ /*
+ 赋值操作时,值的数量比被赋值的对象多
+ */
"redundant-value": "Any",
"spell-check": "None",
+ /*
+ 后置空格
+ */
"trailing-space": "Opened",
"unbalanced-assignments": "Any",
"undefined-doc-class": "Any",
"undefined-doc-name": "Any",
"undefined-doc-param": "Any",
+ /*
+ `_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中
+ */
"undefined-env-child": "Any",
"undefined-field": "Opened",
+ /*
+ 未定义的全局变量
+ */
"undefined-global": "Any",
"unknown-cast-variable": "Any",
"unknown-diag-code": "Any",
+ /*
+ 未使用的函数
+ */
"unused-function": "Opened",
+ /*
+ 未使用的标签
+ */
"unused-label": "Opened",
+ /*
+ 未使用的局部变量
+ */
"unused-local": "Opened",
+ /*
+ 未使用的不定参数
+ */
"unused-vararg": "Opened"
}
```
@@ -473,8 +670,11 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ 优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1`
+ */
"ambiguity-1": "Warning",
"assign-type-mismatch": "Warning",
"await-in-sync": "Warning",
@@ -492,36 +692,84 @@ object<string, string>
"duplicate-doc-alias": "Warning",
"duplicate-doc-field": "Warning",
"duplicate-doc-param": "Warning",
+ /*
+ 在字面量表中重复定义了索引
+ */
"duplicate-index": "Warning",
"duplicate-set-field": "Warning",
+ /*
+ 空代码块
+ */
"empty-block": "Hint",
+ /*
+ 不能使用全局变量( `_ENV` 被设置为了 `nil`)
+ */
"global-in-nil-env": "Warning",
+ /*
+ 首字母小写的全局变量定义
+ */
"lowercase-global": "Information",
"missing-parameter": "Warning",
"need-check-nil": "Warning",
+ /*
+ 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作
+ */
"newfield-call": "Warning",
+ /*
+ 以 `(` 开始的新行,在语法上被解析为了上一行的函数调用
+ */
"newline-call": "Warning",
"no-unknown": "Warning",
"not-yieldable": "Warning",
"param-type-mismatch": "Warning",
+ /*
+ 重复定义的局部变量
+ */
"redefined-local": "Hint",
+ /*
+ 函数调用时,传入了多余的参数
+ */
"redundant-parameter": "Warning",
"redundant-return": "Hint",
+ /*
+ 赋值操作时,值的数量比被赋值的对象多
+ */
"redundant-value": "Warning",
"spell-check": "Information",
+ /*
+ 后置空格
+ */
"trailing-space": "Hint",
"unbalanced-assignments": "Warning",
"undefined-doc-class": "Warning",
"undefined-doc-name": "Warning",
"undefined-doc-param": "Warning",
+ /*
+ `_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中
+ */
"undefined-env-child": "Information",
"undefined-field": "Warning",
+ /*
+ 未定义的全局变量
+ */
"undefined-global": "Warning",
"unknown-cast-variable": "Warning",
"unknown-diag-code": "Warning",
+ /*
+ 未使用的函数
+ */
"unused-function": "Hint",
+ /*
+ 未使用的标签
+ */
"unused-label": "Hint",
+ /*
+ 未使用的局部变量
+ */
"unused-local": "Hint",
+ /*
+ 未使用的不定参数
+ */
"unused-vararg": "Hint"
}
```
@@ -538,7 +786,7 @@ integer
## default
-```json
+```jsonc
3000
```
@@ -554,7 +802,7 @@ integer
## default
-```json
+```jsonc
100
```
@@ -572,7 +820,7 @@ Object<string, string>
## default
-```json
+```jsonc
{}
```
@@ -588,7 +836,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -610,7 +858,7 @@ string
## default
-```json
+```jsonc
"Auto"
```
@@ -626,7 +874,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -642,7 +890,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -664,7 +912,7 @@ string
## default
-```json
+```jsonc
"All"
```
@@ -680,7 +928,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -696,7 +944,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -712,7 +960,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -728,7 +976,7 @@ integer
## default
-```json
+```jsonc
5
```
@@ -745,7 +993,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -761,7 +1009,7 @@ integer
## default
-```json
+```jsonc
50
```
@@ -777,7 +1025,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -793,7 +1041,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -809,7 +1057,7 @@ integer
## default
-```json
+```jsonc
1000
```
@@ -825,7 +1073,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -852,7 +1100,7 @@ object<string, string>
## default
-```json
+```jsonc
{
"basic": "default",
"bit": "default",
@@ -891,7 +1139,7 @@ string
## default
-```json
+```jsonc
"utf8"
```
@@ -907,7 +1155,7 @@ string
## default
-```json
+```jsonc
"${version} ${language} ${encoding}"
```
@@ -938,7 +1186,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -958,7 +1206,7 @@ Array<string>
## default
-```json
+```jsonc
["?.lua","?/init.lua"]
```
@@ -974,7 +1222,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -990,7 +1238,7 @@ string
## default
-```json
+```jsonc
""
```
@@ -1013,7 +1261,7 @@ Object<string, string>
## default
-```json
+```jsonc
{}
```
@@ -1029,7 +1277,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -1053,7 +1301,7 @@ string
## default
-```json
+```jsonc
"Lua 5.4"
```
@@ -1069,7 +1317,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1085,7 +1333,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1101,7 +1349,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -1117,7 +1365,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1133,7 +1381,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1149,7 +1397,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -1166,7 +1414,7 @@ boolean | null
## default
-```json
+```jsonc
null
```
@@ -1182,7 +1430,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1198,7 +1446,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1222,7 +1470,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1238,7 +1486,7 @@ Array<string>
## default
-```json
+```jsonc
[".vscode"]
```
@@ -1254,7 +1502,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1270,7 +1518,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -1286,7 +1534,7 @@ integer
## default
-```json
+```jsonc
5000
```
@@ -1302,7 +1550,7 @@ integer
## default
-```json
+```jsonc
500
```
@@ -1318,7 +1566,7 @@ Array<string>
## default
-```json
+```jsonc
["file","untitled","git"]
```
@@ -1334,7 +1582,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1350,6 +1598,6 @@ Array<string>
## default
-```json
+```jsonc
[]
``` \ No newline at end of file
diff --git a/doc/zh-cn/config.md b/doc/zh-cn/config.md
index fdfbac11..ac819e07 100644
--- a/doc/zh-cn/config.md
+++ b/doc/zh-cn/config.md
@@ -10,7 +10,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -32,7 +32,7 @@ string
## default
-```json
+```jsonc
"Disable"
```
@@ -48,7 +48,7 @@ integer
## default
-```json
+```jsonc
0
```
@@ -64,7 +64,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -86,7 +86,7 @@ string
## default
-```json
+```jsonc
"Replace"
```
@@ -102,7 +102,7 @@ string
## default
-```json
+```jsonc
"@"
```
@@ -118,7 +118,7 @@ string
## default
-```json
+```jsonc
"."
```
@@ -134,7 +134,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -156,7 +156,7 @@ string
## default
-```json
+```jsonc
"Fallback"
```
@@ -172,7 +172,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -188,7 +188,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -204,7 +204,7 @@ Array<string>
## default
-```json
+```jsonc
["git"]
```
@@ -220,7 +220,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -236,7 +236,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -267,19 +267,92 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ * ambiguity-1
+ * count-down-loop
+ * different-requires
+ * newfield-call
+ * newline-call
+ */
"ambiguity": "Fallback",
+ /*
+ * await-in-sync
+ * not-yieldable
+ */
"await": "Fallback",
+ /*
+ * codestyle-check
+ * spell-check
+ */
"codestyle": "Fallback",
+ /*
+ * duplicate-index
+ * duplicate-set-field
+ */
"duplicate": "Fallback",
+ /*
+ * global-in-nil-env
+ * lowercase-global
+ * undefined-env-child
+ * undefined-global
+ */
"global": "Fallback",
+ /*
+ * cast-type-mismatch
+ * circle-doc-class
+ * doc-field-no-class
+ * duplicate-doc-alias
+ * duplicate-doc-field
+ * duplicate-doc-param
+ * undefined-doc-class
+ * undefined-doc-name
+ * undefined-doc-param
+ * unknown-cast-variable
+ * unknown-diag-code
+ */
"luadoc": "Fallback",
- "no-unknown": "Fallback",
+ /*
+ * redefined-local
+ */
"redefined": "Fallback",
+ /*
+ * close-non-object
+ * deprecated
+ * discard-returns
+ */
"strict": "Fallback",
+ /*
+ * no-unknown
+ */
+ "strong": "Fallback",
+ /*
+ * assign-type-mismatch
+ * cast-local-type
+ * cast-type-mismatch
+ * need-check-nil
+ * param-type-mismatch
+ * undefined-field
+ */
"type-check": "Fallback",
+ /*
+ * missing-parameter
+ * redundant-parameter
+ * redundant-value
+ * unbalanced-assignments
+ */
"unbalanced": "Fallback",
+ /*
+ * code-after-break
+ * empty-block
+ * redundant-return
+ * trailing-space
+ * unused-function
+ * unused-label
+ * unused-local
+ * unused-vararg
+ */
"unused": "Fallback"
}
```
@@ -307,19 +380,92 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ * ambiguity-1
+ * count-down-loop
+ * different-requires
+ * newfield-call
+ * newline-call
+ */
"ambiguity": "Fallback",
+ /*
+ * await-in-sync
+ * not-yieldable
+ */
"await": "Fallback",
+ /*
+ * codestyle-check
+ * spell-check
+ */
"codestyle": "Fallback",
+ /*
+ * duplicate-index
+ * duplicate-set-field
+ */
"duplicate": "Fallback",
+ /*
+ * global-in-nil-env
+ * lowercase-global
+ * undefined-env-child
+ * undefined-global
+ */
"global": "Fallback",
+ /*
+ * cast-type-mismatch
+ * circle-doc-class
+ * doc-field-no-class
+ * duplicate-doc-alias
+ * duplicate-doc-field
+ * duplicate-doc-param
+ * undefined-doc-class
+ * undefined-doc-name
+ * undefined-doc-param
+ * unknown-cast-variable
+ * unknown-diag-code
+ */
"luadoc": "Fallback",
- "no-unknown": "Fallback",
+ /*
+ * redefined-local
+ */
"redefined": "Fallback",
+ /*
+ * close-non-object
+ * deprecated
+ * discard-returns
+ */
"strict": "Fallback",
+ /*
+ * no-unknown
+ */
+ "strong": "Fallback",
+ /*
+ * assign-type-mismatch
+ * cast-local-type
+ * cast-type-mismatch
+ * need-check-nil
+ * param-type-mismatch
+ * undefined-field
+ */
"type-check": "Fallback",
+ /*
+ * missing-parameter
+ * redundant-parameter
+ * redundant-value
+ * unbalanced-assignments
+ */
"unbalanced": "Fallback",
+ /*
+ * code-after-break
+ * empty-block
+ * redundant-return
+ * trailing-space
+ * unused-function
+ * unused-label
+ * unused-local
+ * unused-vararg
+ */
"unused": "Fallback"
}
```
@@ -342,7 +488,7 @@ string
## default
-```json
+```jsonc
"Opened"
```
@@ -364,7 +510,7 @@ string
## default
-```json
+```jsonc
"Opened"
```
@@ -394,8 +540,11 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ 优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1`
+ */
"ambiguity-1": "Any",
"assign-type-mismatch": "Opened",
"await-in-sync": "None",
@@ -413,36 +562,84 @@ object<string, string>
"duplicate-doc-alias": "Any",
"duplicate-doc-field": "Any",
"duplicate-doc-param": "Any",
+ /*
+ 在字面量表中重复定义了索引
+ */
"duplicate-index": "Any",
"duplicate-set-field": "Any",
+ /*
+ 空代码块
+ */
"empty-block": "Opened",
+ /*
+ 不能使用全局变量( `_ENV` 被设置为了 `nil`)
+ */
"global-in-nil-env": "Any",
+ /*
+ 首字母小写的全局变量定义
+ */
"lowercase-global": "Any",
"missing-parameter": "Any",
"need-check-nil": "Opened",
+ /*
+ 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作
+ */
"newfield-call": "Any",
+ /*
+ 以 `(` 开始的新行,在语法上被解析为了上一行的函数调用
+ */
"newline-call": "Any",
"no-unknown": "None",
"not-yieldable": "None",
"param-type-mismatch": "Opened",
+ /*
+ 重复定义的局部变量
+ */
"redefined-local": "Opened",
+ /*
+ 函数调用时,传入了多余的参数
+ */
"redundant-parameter": "Any",
"redundant-return": "Opened",
+ /*
+ 赋值操作时,值的数量比被赋值的对象多
+ */
"redundant-value": "Any",
"spell-check": "None",
+ /*
+ 后置空格
+ */
"trailing-space": "Opened",
"unbalanced-assignments": "Any",
"undefined-doc-class": "Any",
"undefined-doc-name": "Any",
"undefined-doc-param": "Any",
+ /*
+ `_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中
+ */
"undefined-env-child": "Any",
"undefined-field": "Opened",
+ /*
+ 未定义的全局变量
+ */
"undefined-global": "Any",
"unknown-cast-variable": "Any",
"unknown-diag-code": "Any",
+ /*
+ 未使用的函数
+ */
"unused-function": "Opened",
+ /*
+ 未使用的标签
+ */
"unused-label": "Opened",
+ /*
+ 未使用的局部变量
+ */
"unused-local": "Opened",
+ /*
+ 未使用的不定参数
+ */
"unused-vararg": "Opened"
}
```
@@ -472,8 +669,11 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ 优先级歧义,如:`num or 0 + 1`,推测用户的实际期望为 `(num or 0) + 1`
+ */
"ambiguity-1": "Warning",
"assign-type-mismatch": "Warning",
"await-in-sync": "Warning",
@@ -491,36 +691,84 @@ object<string, string>
"duplicate-doc-alias": "Warning",
"duplicate-doc-field": "Warning",
"duplicate-doc-param": "Warning",
+ /*
+ 在字面量表中重复定义了索引
+ */
"duplicate-index": "Warning",
"duplicate-set-field": "Warning",
+ /*
+ 空代码块
+ */
"empty-block": "Hint",
+ /*
+ 不能使用全局变量( `_ENV` 被设置为了 `nil`)
+ */
"global-in-nil-env": "Warning",
+ /*
+ 首字母小写的全局变量定义
+ */
"lowercase-global": "Information",
"missing-parameter": "Warning",
"need-check-nil": "Warning",
+ /*
+ 在字面量表中,2行代码之间缺少分隔符,在语法上被解析为了一次索引操作
+ */
"newfield-call": "Warning",
+ /*
+ 以 `(` 开始的新行,在语法上被解析为了上一行的函数调用
+ */
"newline-call": "Warning",
"no-unknown": "Warning",
"not-yieldable": "Warning",
"param-type-mismatch": "Warning",
+ /*
+ 重复定义的局部变量
+ */
"redefined-local": "Hint",
+ /*
+ 函数调用时,传入了多余的参数
+ */
"redundant-parameter": "Warning",
"redundant-return": "Hint",
+ /*
+ 赋值操作时,值的数量比被赋值的对象多
+ */
"redundant-value": "Warning",
"spell-check": "Information",
+ /*
+ 后置空格
+ */
"trailing-space": "Hint",
"unbalanced-assignments": "Warning",
"undefined-doc-class": "Warning",
"undefined-doc-name": "Warning",
"undefined-doc-param": "Warning",
+ /*
+ `_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中
+ */
"undefined-env-child": "Information",
"undefined-field": "Warning",
+ /*
+ 未定义的全局变量
+ */
"undefined-global": "Warning",
"unknown-cast-variable": "Warning",
"unknown-diag-code": "Warning",
+ /*
+ 未使用的函数
+ */
"unused-function": "Hint",
+ /*
+ 未使用的标签
+ */
"unused-label": "Hint",
+ /*
+ 未使用的局部变量
+ */
"unused-local": "Hint",
+ /*
+ 未使用的不定参数
+ */
"unused-vararg": "Hint"
}
```
@@ -537,7 +785,7 @@ integer
## default
-```json
+```jsonc
3000
```
@@ -553,7 +801,7 @@ integer
## default
-```json
+```jsonc
100
```
@@ -571,7 +819,7 @@ Object<string, string>
## default
-```json
+```jsonc
{}
```
@@ -587,7 +835,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -609,7 +857,7 @@ string
## default
-```json
+```jsonc
"Auto"
```
@@ -625,7 +873,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -641,7 +889,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -663,7 +911,7 @@ string
## default
-```json
+```jsonc
"All"
```
@@ -679,7 +927,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -695,7 +943,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -711,7 +959,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -727,7 +975,7 @@ integer
## default
-```json
+```jsonc
5
```
@@ -744,7 +992,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -760,7 +1008,7 @@ integer
## default
-```json
+```jsonc
50
```
@@ -776,7 +1024,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -792,7 +1040,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -808,7 +1056,7 @@ integer
## default
-```json
+```jsonc
1000
```
@@ -824,7 +1072,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -851,7 +1099,7 @@ object<string, string>
## default
-```json
+```jsonc
{
"basic": "default",
"bit": "default",
@@ -890,7 +1138,7 @@ string
## default
-```json
+```jsonc
"utf8"
```
@@ -906,7 +1154,7 @@ string
## default
-```json
+```jsonc
"${version} ${language} ${encoding}"
```
@@ -937,7 +1185,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -957,7 +1205,7 @@ Array<string>
## default
-```json
+```jsonc
["?.lua","?/init.lua"]
```
@@ -973,7 +1221,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -989,7 +1237,7 @@ string
## default
-```json
+```jsonc
""
```
@@ -1012,7 +1260,7 @@ Object<string, string>
## default
-```json
+```jsonc
{}
```
@@ -1028,7 +1276,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -1052,7 +1300,7 @@ string
## default
-```json
+```jsonc
"Lua 5.4"
```
@@ -1068,7 +1316,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1084,7 +1332,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1100,7 +1348,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -1116,7 +1364,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1132,7 +1380,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1148,7 +1396,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -1165,7 +1413,7 @@ boolean | null
## default
-```json
+```jsonc
null
```
@@ -1181,7 +1429,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1197,7 +1445,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1221,7 +1469,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1237,7 +1485,7 @@ Array<string>
## default
-```json
+```jsonc
[".vscode"]
```
@@ -1253,7 +1501,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1269,7 +1517,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -1285,7 +1533,7 @@ integer
## default
-```json
+```jsonc
5000
```
@@ -1301,7 +1549,7 @@ integer
## default
-```json
+```jsonc
500
```
@@ -1317,7 +1565,7 @@ Array<string>
## default
-```json
+```jsonc
["file","untitled","git"]
```
@@ -1333,7 +1581,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1349,6 +1597,6 @@ Array<string>
## default
-```json
+```jsonc
[]
``` \ No newline at end of file
diff --git a/doc/zh-tw/config.md b/doc/zh-tw/config.md
index c1f93e41..57b28cac 100644
--- a/doc/zh-tw/config.md
+++ b/doc/zh-tw/config.md
@@ -10,7 +10,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -32,7 +32,7 @@ string
## default
-```json
+```jsonc
"Disable"
```
@@ -48,7 +48,7 @@ integer
## default
-```json
+```jsonc
0
```
@@ -64,7 +64,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -86,7 +86,7 @@ string
## default
-```json
+```jsonc
"Replace"
```
@@ -102,7 +102,7 @@ string
## default
-```json
+```jsonc
"@"
```
@@ -118,7 +118,7 @@ string
## default
-```json
+```jsonc
"."
```
@@ -134,7 +134,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -156,7 +156,7 @@ string
## default
-```json
+```jsonc
"Fallback"
```
@@ -172,7 +172,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -188,7 +188,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -204,7 +204,7 @@ Array<string>
## default
-```json
+```jsonc
["git"]
```
@@ -220,7 +220,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -236,7 +236,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -267,19 +267,92 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ * ambiguity-1
+ * count-down-loop
+ * different-requires
+ * newfield-call
+ * newline-call
+ */
"ambiguity": "Fallback",
+ /*
+ * await-in-sync
+ * not-yieldable
+ */
"await": "Fallback",
+ /*
+ * codestyle-check
+ * spell-check
+ */
"codestyle": "Fallback",
+ /*
+ * duplicate-index
+ * duplicate-set-field
+ */
"duplicate": "Fallback",
+ /*
+ * global-in-nil-env
+ * lowercase-global
+ * undefined-env-child
+ * undefined-global
+ */
"global": "Fallback",
+ /*
+ * cast-type-mismatch
+ * circle-doc-class
+ * doc-field-no-class
+ * duplicate-doc-alias
+ * duplicate-doc-field
+ * duplicate-doc-param
+ * undefined-doc-class
+ * undefined-doc-name
+ * undefined-doc-param
+ * unknown-cast-variable
+ * unknown-diag-code
+ */
"luadoc": "Fallback",
- "no-unknown": "Fallback",
+ /*
+ * redefined-local
+ */
"redefined": "Fallback",
+ /*
+ * close-non-object
+ * deprecated
+ * discard-returns
+ */
"strict": "Fallback",
+ /*
+ * no-unknown
+ */
+ "strong": "Fallback",
+ /*
+ * assign-type-mismatch
+ * cast-local-type
+ * cast-type-mismatch
+ * need-check-nil
+ * param-type-mismatch
+ * undefined-field
+ */
"type-check": "Fallback",
+ /*
+ * missing-parameter
+ * redundant-parameter
+ * redundant-value
+ * unbalanced-assignments
+ */
"unbalanced": "Fallback",
+ /*
+ * code-after-break
+ * empty-block
+ * redundant-return
+ * trailing-space
+ * unused-function
+ * unused-label
+ * unused-local
+ * unused-vararg
+ */
"unused": "Fallback"
}
```
@@ -307,19 +380,92 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ * ambiguity-1
+ * count-down-loop
+ * different-requires
+ * newfield-call
+ * newline-call
+ */
"ambiguity": "Fallback",
+ /*
+ * await-in-sync
+ * not-yieldable
+ */
"await": "Fallback",
+ /*
+ * codestyle-check
+ * spell-check
+ */
"codestyle": "Fallback",
+ /*
+ * duplicate-index
+ * duplicate-set-field
+ */
"duplicate": "Fallback",
+ /*
+ * global-in-nil-env
+ * lowercase-global
+ * undefined-env-child
+ * undefined-global
+ */
"global": "Fallback",
+ /*
+ * cast-type-mismatch
+ * circle-doc-class
+ * doc-field-no-class
+ * duplicate-doc-alias
+ * duplicate-doc-field
+ * duplicate-doc-param
+ * undefined-doc-class
+ * undefined-doc-name
+ * undefined-doc-param
+ * unknown-cast-variable
+ * unknown-diag-code
+ */
"luadoc": "Fallback",
- "no-unknown": "Fallback",
+ /*
+ * redefined-local
+ */
"redefined": "Fallback",
+ /*
+ * close-non-object
+ * deprecated
+ * discard-returns
+ */
"strict": "Fallback",
+ /*
+ * no-unknown
+ */
+ "strong": "Fallback",
+ /*
+ * assign-type-mismatch
+ * cast-local-type
+ * cast-type-mismatch
+ * need-check-nil
+ * param-type-mismatch
+ * undefined-field
+ */
"type-check": "Fallback",
+ /*
+ * missing-parameter
+ * redundant-parameter
+ * redundant-value
+ * unbalanced-assignments
+ */
"unbalanced": "Fallback",
+ /*
+ * code-after-break
+ * empty-block
+ * redundant-return
+ * trailing-space
+ * unused-function
+ * unused-label
+ * unused-local
+ * unused-vararg
+ */
"unused": "Fallback"
}
```
@@ -342,7 +488,7 @@ string
## default
-```json
+```jsonc
"Opened"
```
@@ -364,7 +510,7 @@ string
## default
-```json
+```jsonc
"Opened"
```
@@ -394,8 +540,11 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ 優先順序歧義,如: `num or 0 + 1` ,推測使用者的實際期望為 `(num or 0) + 1`
+ */
"ambiguity-1": "Any",
"assign-type-mismatch": "Opened",
"await-in-sync": "None",
@@ -413,36 +562,84 @@ object<string, string>
"duplicate-doc-alias": "Any",
"duplicate-doc-field": "Any",
"duplicate-doc-param": "Any",
+ /*
+ 在字面常數表中重複定義了索引
+ */
"duplicate-index": "Any",
"duplicate-set-field": "Any",
+ /*
+ 空程式碼區塊
+ */
"empty-block": "Opened",
+ /*
+ 不能使用全域變數( `_ENV` 被設定為 `nil`)
+ */
"global-in-nil-env": "Any",
+ /*
+ 首字母小寫的全域變數定義
+ */
"lowercase-global": "Any",
"missing-parameter": "Any",
"need-check-nil": "Opened",
+ /*
+ 在字面常數表中,2行程式碼之間缺少分隔符,在語法上被解析為了一次索引操作
+ */
"newfield-call": "Any",
+ /*
+ 以 `(` 開始的新行,在語法上被解析為了上一行的函式呼叫
+ */
"newline-call": "Any",
"no-unknown": "None",
"not-yieldable": "None",
"param-type-mismatch": "Opened",
+ /*
+ 重複定義的區域變數
+ */
"redefined-local": "Opened",
+ /*
+ 函式呼叫時,傳入了多餘的引數
+ */
"redundant-parameter": "Any",
"redundant-return": "Opened",
+ /*
+ 賦值操作時,值的數量比被賦值的對象多
+ */
"redundant-value": "Any",
"spell-check": "None",
+ /*
+ 後置空格
+ */
"trailing-space": "Opened",
"unbalanced-assignments": "Any",
"undefined-doc-class": "Any",
"undefined-doc-name": "Any",
"undefined-doc-param": "Any",
+ /*
+ `_ENV` 被設定為了新的字面常數表,但是試圖獲取的全域變數不在這張表中
+ */
"undefined-env-child": "Any",
"undefined-field": "Opened",
+ /*
+ 未定義的全域變數
+ */
"undefined-global": "Any",
"unknown-cast-variable": "Any",
"unknown-diag-code": "Any",
+ /*
+ 未使用的函式
+ */
"unused-function": "Opened",
+ /*
+ 未使用的標籤
+ */
"unused-label": "Opened",
+ /*
+ 未使用的區域變數
+ */
"unused-local": "Opened",
+ /*
+ 未使用的不定引數
+ */
"unused-vararg": "Opened"
}
```
@@ -472,8 +669,11 @@ object<string, string>
## default
-```json
+```jsonc
{
+ /*
+ 優先順序歧義,如: `num or 0 + 1` ,推測使用者的實際期望為 `(num or 0) + 1`
+ */
"ambiguity-1": "Warning",
"assign-type-mismatch": "Warning",
"await-in-sync": "Warning",
@@ -491,43 +691,91 @@ object<string, string>
"duplicate-doc-alias": "Warning",
"duplicate-doc-field": "Warning",
"duplicate-doc-param": "Warning",
+ /*
+ 在字面常數表中重複定義了索引
+ */
"duplicate-index": "Warning",
"duplicate-set-field": "Warning",
+ /*
+ 空程式碼區塊
+ */
"empty-block": "Hint",
+ /*
+ 不能使用全域變數( `_ENV` 被設定為 `nil`)
+ */
"global-in-nil-env": "Warning",
+ /*
+ 首字母小寫的全域變數定義
+ */
"lowercase-global": "Information",
"missing-parameter": "Warning",
"need-check-nil": "Warning",
+ /*
+ 在字面常數表中,2行程式碼之間缺少分隔符,在語法上被解析為了一次索引操作
+ */
"newfield-call": "Warning",
+ /*
+ 以 `(` 開始的新行,在語法上被解析為了上一行的函式呼叫
+ */
"newline-call": "Warning",
"no-unknown": "Warning",
"not-yieldable": "Warning",
"param-type-mismatch": "Warning",
+ /*
+ 重複定義的區域變數
+ */
"redefined-local": "Hint",
+ /*
+ 函式呼叫時,傳入了多餘的引數
+ */
"redundant-parameter": "Warning",
"redundant-return": "Hint",
+ /*
+ 賦值操作時,值的數量比被賦值的對象多
+ */
"redundant-value": "Warning",
"spell-check": "Information",
+ /*
+ 後置空格
+ */
"trailing-space": "Hint",
"unbalanced-assignments": "Warning",
"undefined-doc-class": "Warning",
"undefined-doc-name": "Warning",
"undefined-doc-param": "Warning",
+ /*
+ `_ENV` 被設定為了新的字面常數表,但是試圖獲取的全域變數不在這張表中
+ */
"undefined-env-child": "Information",
"undefined-field": "Warning",
+ /*
+ 未定義的全域變數
+ */
"undefined-global": "Warning",
"unknown-cast-variable": "Warning",
"unknown-diag-code": "Warning",
+ /*
+ 未使用的函式
+ */
"unused-function": "Hint",
+ /*
+ 未使用的標籤
+ */
"unused-label": "Hint",
+ /*
+ 未使用的區域變數
+ */
"unused-local": "Hint",
+ /*
+ 未使用的不定引數
+ */
"unused-vararg": "Hint"
}
```
# diagnostics.workspaceDelay
-進行工作區診斷的延遲(毫秒)。當你啟動工作區,或編輯了任意檔案後,將會在背景對整個工作區進行重新診斷。設定為負數可以停用工作區診斷。
+進行工作區診斷的延遲(毫秒)。當你啟動工作區,或編輯了任何檔案後,將會在背景對整個工作區進行重新診斷。設定為負數可以停用工作區診斷。
## type
@@ -537,7 +785,7 @@ integer
## default
-```json
+```jsonc
3000
```
@@ -553,7 +801,7 @@ integer
## default
-```json
+```jsonc
100
```
@@ -571,7 +819,7 @@ Object<string, string>
## default
-```json
+```jsonc
{}
```
@@ -587,7 +835,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -609,7 +857,7 @@ string
## default
-```json
+```jsonc
"Auto"
```
@@ -625,7 +873,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -641,7 +889,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -663,7 +911,7 @@ string
## default
-```json
+```jsonc
"All"
```
@@ -679,7 +927,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -695,7 +943,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -711,7 +959,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -727,7 +975,7 @@ integer
## default
-```json
+```jsonc
5
```
@@ -744,7 +992,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -760,7 +1008,7 @@ integer
## default
-```json
+```jsonc
50
```
@@ -776,7 +1024,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -792,7 +1040,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -808,7 +1056,7 @@ integer
## default
-```json
+```jsonc
1000
```
@@ -824,13 +1072,13 @@ Array<string>
## default
-```json
+```jsonc
[]
```
# runtime.builtin
-調整內建庫的啟用狀態,你可以根據實際執行環境停用不存在的庫(或重新定義)。
+調整內建庫的啟用狀態,你可以根據實際執行環境停用(或重新定義)不存在的庫。
* `default`: 表示庫會根據執行版本啟用或停用
* `enable`: 總是啟用
@@ -851,7 +1099,7 @@ object<string, string>
## default
-```json
+```jsonc
{
"basic": "default",
"bit": "default",
@@ -873,7 +1121,7 @@ object<string, string>
# runtime.fileEncoding
-檔案編碼,`ansi` 選項只在 `Windows` 平台下有效。
+檔案編碼,選項 `ansi` 只在 `Windows` 平台下有效。
## type
@@ -890,7 +1138,7 @@ string
## default
-```json
+```jsonc
"utf8"
```
@@ -906,7 +1154,7 @@ string
## default
-```json
+```jsonc
"${version} ${language} ${encoding}"
```
@@ -937,7 +1185,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -957,7 +1205,7 @@ Array<string>
## default
-```json
+```jsonc
["?.lua","?/init.lua"]
```
@@ -973,7 +1221,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -989,13 +1237,13 @@ string
## default
-```json
+```jsonc
""
```
# runtime.special
-將自訂全域變數視為一些特殊的內建變數,語言服務將提供特殊的支援。
+將自訂全域變數視為一些特殊的內建變數,語言伺服將提供特殊的支援。
下面這個例子表示將 `include` 視為 `require` 。
```json
"Lua.runtime.special" : {
@@ -1012,7 +1260,7 @@ Object<string, string>
## default
-```json
+```jsonc
{}
```
@@ -1028,7 +1276,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -1052,7 +1300,7 @@ string
## default
-```json
+```jsonc
"Lua 5.4"
```
@@ -1068,7 +1316,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1084,7 +1332,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1100,7 +1348,7 @@ boolean
## default
-```json
+```jsonc
false
```
@@ -1116,7 +1364,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1132,7 +1380,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1148,7 +1396,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -1165,7 +1413,7 @@ boolean | null
## default
-```json
+```jsonc
null
```
@@ -1181,7 +1429,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1197,7 +1445,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1221,7 +1469,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1237,7 +1485,7 @@ Array<string>
## default
-```json
+```jsonc
[".vscode"]
```
@@ -1253,7 +1501,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1269,7 +1517,7 @@ Array<string>
## default
-```json
+```jsonc
[]
```
@@ -1285,7 +1533,7 @@ integer
## default
-```json
+```jsonc
5000
```
@@ -1301,7 +1549,7 @@ integer
## default
-```json
+```jsonc
500
```
@@ -1317,7 +1565,7 @@ Array<string>
## default
-```json
+```jsonc
["file","untitled","git"]
```
@@ -1333,7 +1581,7 @@ boolean
## default
-```json
+```jsonc
true
```
@@ -1349,6 +1597,6 @@ Array<string>
## default
-```json
+```jsonc
[]
``` \ No newline at end of file
diff --git a/script/proto/diagnostic.lua b/script/proto/diagnostic.lua
index d8bac443..59f33693 100644
--- a/script/proto/diagnostic.lua
+++ b/script/proto/diagnostic.lua
@@ -135,7 +135,7 @@ m.register {
m.register {
'no-unknown',
} {
- group = 'no-unknown',
+ group = 'strong',
severity = 'Warning',
status = 'None',
}
diff --git a/tools/build-doc.lua b/tools/build-doc.lua
index 7fa56706..fbf5fa6b 100644
--- a/tools/build-doc.lua
+++ b/tools/build-doc.lua
@@ -6,6 +6,19 @@ local markdown = require 'provider.markdown'
local util = require 'utility'
local lloader = require 'locale-loader'
local json = require 'json-beautify'
+local diagd = require 'proto.diagnostic'
+
+local function mergeDiagnosticGroupLocale(locale)
+ for groupName, names in pairs(diagd.diagnosticGroups) do
+ local key = ('config.diagnostics.%s'):format(groupName)
+ local list = {}
+ for name in util.sortPairs(names) do
+ list[#list+1] = ('* %s'):format(name)
+ end
+ local desc = table.concat(list, '\n')
+ locale[key] = desc
+ end
+end
local function getLocale()
local locale = {}
@@ -15,6 +28,8 @@ local function getLocale()
local text = util.loadFile((dirPath / 'setting.lua'):string())
if text then
locale[lang] = lloader(text, lang)
+ -- add `config.diagnostics.XXX`
+ mergeDiagnosticGroupLocale(locale[lang])
end
end
@@ -85,10 +100,28 @@ local function buildDefault(md, lang, conf)
default[k] = v.default
end
end
- setmetatable(default, json.object)
- md:add('json', ('%s'):format(json.beautify(default, { indent = ' ' })))
+ local list = util.getTableKeys(default, true)
+ if #list == 0 then
+ md:add('jsonc', '{}')
+ return
+ end
+ md:add('jsonc', '{')
+ for i, k in ipairs(list) do
+ local desc = getDesc(lang, conf.properties[k].description)
+ if desc then
+ md:add('jsonc', ' /*')
+ md:add('jsonc', (' %s'):format(desc:gsub('\n', '\n ')))
+ md:add('jsonc', ' */')
+ end
+ if i == #list then
+ md:add('jsonc',(' %s: %s'):format(json.encode(k), json.encode(default[k])))
+ else
+ md:add('jsonc',(' %s: %s,'):format(json.encode(k), json.encode(default[k])))
+ end
+ end
+ md:add('jsonc', '}')
else
- md:add('json', ('%s'):format(json.encode(default)))
+ md:add('jsonc', ('%s'):format(json.encode(default)))
end
end