Skip to content

Commit 92a8bd6

Browse files
committed
3.4.0
1 parent 604f88a commit 92a8bd6

File tree

12 files changed

+771
-39
lines changed

12 files changed

+771
-39
lines changed

changelog.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
11
# changelog
22

3+
## 3.4.0
4+
`2022-6-29`
5+
* `NEW` diagnostics:
6+
* `cast-local-type`
7+
* `assign-type-mismatch`
8+
* `param-type-mismatch`
9+
* `unknown-cast-variable`
10+
* `cast-type-mismatch`
11+
* `missing-return-value`
12+
* `redundant-return-value`
13+
* `missing-return`
14+
* `return-type-mismatch`
15+
* `NEW` settings:
16+
* `diagnostics.groupSeverity`
17+
* `diagnostics.groupFileStatus`
18+
* `type.castNumberToInteger`
19+
* `type.weakUnionCheck`
20+
* `hint.semicolon`
21+
* `CHG` infer `nil` as redundant return value
22+
```lua
23+
local function f() end
24+
local x = f() -- `x` is `nil` instead of `unknown`
25+
```
26+
* `CHG` infer called function by params num
27+
```lua
28+
---@overload fun(x: number, y: number):string
29+
---@overload fun(x: number):number
30+
---@return boolean
31+
local function f() end
32+
33+
local n1 = f() -- `n1` is `boolean`
34+
local n2 = f(0) -- `n2` is `number`
35+
local n3 = f(0, 0) -- `n3` is `string`
36+
```
37+
* `CHG` semicolons and parentheses can be used in `DocTable`
38+
```lua
39+
---@type { (x: number); (y: boolean) }
40+
```
41+
* `CHG` return names and parentheses can be used in `DocFunction`
42+
```lua
43+
---@type fun():(x: number, y: number, ...: number)
44+
```
45+
* `CHG` supports `---@return boolean ...`
46+
* `CHG` improve experience for diagnostics and semantic-tokens
47+
* `FIX` diagnostics flash when opening a file
48+
* `FIX` sometimes workspace diagnostics are not triggered
49+
* `FIX` [#1228](https://github.com/sumneko/lua-language-server/issues/1228)
50+
* `FIX` [#1229](https://github.com/sumneko/lua-language-server/issues/1229)
51+
* `FIX` [#1242](https://github.com/sumneko/lua-language-server/issues/1242)
52+
* `FIX` [#1243](https://github.com/sumneko/lua-language-server/issues/1243)
53+
* `FIX` [#1249](https://github.com/sumneko/lua-language-server/issues/1249)
54+
355
## 3.3.1
456
`2022-6-17`
557
* `FIX` [#1213](https://github.com/sumneko/lua-language-server/issues/1213)

package.json

Lines changed: 141 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,32 @@
782782
],
783783
"type": "string"
784784
},
785+
"missing-return": {
786+
"default": "Any",
787+
"description": "%config.diagnostics.missing-return%",
788+
"enum": [
789+
"Any",
790+
"Opened",
791+
"None",
792+
"Any!",
793+
"Opened!",
794+
"None!"
795+
],
796+
"type": "string"
797+
},
798+
"missing-return-value": {
799+
"default": "Any",
800+
"description": "%config.diagnostics.missing-return-value%",
801+
"enum": [
802+
"Any",
803+
"Opened",
804+
"None",
805+
"Any!",
806+
"Opened!",
807+
"None!"
808+
],
809+
"type": "string"
810+
},
785811
"need-check-nil": {
786812
"default": "Opened",
787813
"description": "%config.diagnostics.need-check-nil%",
@@ -899,6 +925,19 @@
899925
],
900926
"type": "string"
901927
},
928+
"redundant-return-value": {
929+
"default": "Any",
930+
"description": "%config.diagnostics.redundant-return-value%",
931+
"enum": [
932+
"Any",
933+
"Opened",
934+
"None",
935+
"Any!",
936+
"Opened!",
937+
"None!"
938+
],
939+
"type": "string"
940+
},
902941
"redundant-value": {
903942
"default": "Any",
904943
"description": "%config.diagnostics.redundant-value%",
@@ -912,6 +951,19 @@
912951
],
913952
"type": "string"
914953
},
954+
"return-type-mismatch": {
955+
"default": "Opened",
956+
"description": "%config.diagnostics.return-type-mismatch%",
957+
"enum": [
958+
"Any",
959+
"Opened",
960+
"None",
961+
"Any!",
962+
"Opened!",
963+
"None!"
964+
],
965+
"type": "string"
966+
},
915967
"spell-check": {
916968
"default": "None",
917969
"description": "%config.diagnostics.spell-check%",
@@ -1461,6 +1513,36 @@
14611513
],
14621514
"type": "string"
14631515
},
1516+
"missing-return": {
1517+
"default": "Warning",
1518+
"description": "%config.diagnostics.missing-return%",
1519+
"enum": [
1520+
"Error",
1521+
"Warning",
1522+
"Information",
1523+
"Hint",
1524+
"Error!",
1525+
"Warning!",
1526+
"Information!",
1527+
"Hint!"
1528+
],
1529+
"type": "string"
1530+
},
1531+
"missing-return-value": {
1532+
"default": "Warning",
1533+
"description": "%config.diagnostics.missing-return-value%",
1534+
"enum": [
1535+
"Error",
1536+
"Warning",
1537+
"Information",
1538+
"Hint",
1539+
"Error!",
1540+
"Warning!",
1541+
"Information!",
1542+
"Hint!"
1543+
],
1544+
"type": "string"
1545+
},
14641546
"need-check-nil": {
14651547
"default": "Warning",
14661548
"description": "%config.diagnostics.need-check-nil%",
@@ -1596,6 +1678,21 @@
15961678
],
15971679
"type": "string"
15981680
},
1681+
"redundant-return-value": {
1682+
"default": "Warning",
1683+
"description": "%config.diagnostics.redundant-return-value%",
1684+
"enum": [
1685+
"Error",
1686+
"Warning",
1687+
"Information",
1688+
"Hint",
1689+
"Error!",
1690+
"Warning!",
1691+
"Information!",
1692+
"Hint!"
1693+
],
1694+
"type": "string"
1695+
},
15991696
"redundant-value": {
16001697
"default": "Warning",
16011698
"description": "%config.diagnostics.redundant-value%",
@@ -1611,6 +1708,21 @@
16111708
],
16121709
"type": "string"
16131710
},
1711+
"return-type-mismatch": {
1712+
"default": "Warning",
1713+
"description": "%config.diagnostics.return-type-mismatch%",
1714+
"enum": [
1715+
"Error",
1716+
"Warning",
1717+
"Information",
1718+
"Hint",
1719+
"Error!",
1720+
"Warning!",
1721+
"Information!",
1722+
"Hint!"
1723+
],
1724+
"type": "string"
1725+
},
16141726
"spell-check": {
16151727
"default": "Information",
16161728
"description": "%config.diagnostics.spell-check%",
@@ -1923,6 +2035,22 @@
19232035
"scope": "resource",
19242036
"type": "boolean"
19252037
},
2038+
"Lua.hint.semicolon": {
2039+
"default": "SameLine",
2040+
"enum": [
2041+
"All",
2042+
"SameLine",
2043+
"Disable"
2044+
],
2045+
"markdownDescription": "%config.hint.semicolon%",
2046+
"markdownEnumDescriptions": [
2047+
"%config.hint.semicolon.All%",
2048+
"%config.hint.semicolon.SameLine%",
2049+
"%config.hint.semicolon.Disable%"
2050+
],
2051+
"scope": "resource",
2052+
"type": "string"
2053+
},
19262054
"Lua.hint.setType": {
19272055
"default": false,
19282056
"markdownDescription": "%config.hint.setType%",
@@ -2315,6 +2443,18 @@
23152443
"null"
23162444
]
23172445
},
2446+
"Lua.type.castNumberToInteger": {
2447+
"default": false,
2448+
"markdownDescription": "%config.type.castNumberToInteger%",
2449+
"scope": "resource",
2450+
"type": "boolean"
2451+
},
2452+
"Lua.type.weakUnionCheck": {
2453+
"default": false,
2454+
"markdownDescription": "%config.type.weakUnionCheck%",
2455+
"scope": "resource",
2456+
"type": "boolean"
2457+
},
23182458
"Lua.window.progressBar": {
23192459
"default": true,
23202460
"markdownDescription": "%config.window.progressBar%",
@@ -2561,5 +2701,5 @@
25612701
"sponsor": {
25622702
"url": "https://github.com/sumneko/lua-language-server/issues/484"
25632703
},
2564-
"version": "3.3.1"
2704+
"version": "3.4.0"
25652705
}

package.nls.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"config.diagnostics.strict": "* close-non-object\n* deprecated\n* discard-returns",
6666
"config.diagnostics.strong": "* no-unknown",
6767
"config.diagnostics.trailing-space": "Enable trailing space diagnostics.",
68-
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* need-check-nil\n* param-type-mismatch\n* undefined-field",
69-
"config.diagnostics.unbalanced": "* missing-parameter\n* redundant-parameter\n* redundant-value\n* unbalanced-assignments",
68+
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* need-check-nil\n* param-type-mismatch\n* return-type-mismatch\n* undefined-field",
69+
"config.diagnostics.unbalanced": "* missing-parameter\n* missing-return\n* missing-return-value\n* redundant-parameter\n* redundant-return-value\n* redundant-value\n* unbalanced-assignments",
7070
"config.diagnostics.undefined-env-child": "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.",
7171
"config.diagnostics.undefined-global": "Enable undefined global variable diagnostics.",
7272
"config.diagnostics.unused": "* code-after-break\n* empty-block\n* redundant-return\n* trailing-space\n* unused-function\n* unused-label\n* unused-local\n* unused-vararg",
@@ -89,6 +89,10 @@
8989
"config.hint.paramName.Disable": "Disable parameter hints.",
9090
"config.hint.paramName.Literal": "Only literal type parameters are shown.",
9191
"config.hint.paramType": "Show type hints at the parameter of the function.",
92+
"config.hint.semicolon": "If there is no semicolon at the end of the statement, display a virtual semicolon.",
93+
"config.hint.semicolon.All": "All statements display virtual semicolons.",
94+
"config.hint.semicolon.Disable": "Disable virtual semicolons.",
95+
"config.hint.semicolon.SameLine": "When two statements are on the same line, display a semicolon between them.",
9296
"config.hint.setType": "Show hints of type at assignment operation.",
9397
"config.hover.enable": "Enable hover.",
9498
"config.hover.enumsLimit": "When the value corresponds to multiple types, limit the number of types displaying.",

package.nls.pt-br.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"config.diagnostics.strict": "* close-non-object\n* deprecated\n* discard-returns",
6666
"config.diagnostics.strong": "* no-unknown",
6767
"config.diagnostics.trailing-space": "后置空格",
68-
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* need-check-nil\n* param-type-mismatch\n* undefined-field",
69-
"config.diagnostics.unbalanced": "* missing-parameter\n* redundant-parameter\n* redundant-value\n* unbalanced-assignments",
68+
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* need-check-nil\n* param-type-mismatch\n* return-type-mismatch\n* undefined-field",
69+
"config.diagnostics.unbalanced": "* missing-parameter\n* missing-return\n* missing-return-value\n* redundant-parameter\n* redundant-return-value\n* redundant-value\n* unbalanced-assignments",
7070
"config.diagnostics.undefined-env-child": "`_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中",
7171
"config.diagnostics.undefined-global": "未定义的全局变量",
7272
"config.diagnostics.unused": "* code-after-break\n* empty-block\n* redundant-return\n* trailing-space\n* unused-function\n* unused-label\n* unused-local\n* unused-vararg",
@@ -89,6 +89,10 @@
8989
"config.hint.paramName.Disable": "Disable parameter hints.",
9090
"config.hint.paramName.Literal": "Only literal type parameters are shown.",
9191
"config.hint.paramType": "Show type hints at the parameter of the function.",
92+
"config.hint.semicolon": "If there is no semicolon at the end of the statement, display a virtual semicolon.",
93+
"config.hint.semicolon.All": "All statements display virtual semicolons.",
94+
"config.hint.semicolon.Disable": "Disable virtual semicolons.",
95+
"config.hint.semicolon.SameLine": "When two statements are on the same line, display a semicolon between them.",
9296
"config.hint.setType": "Show hints of type at assignment operation.",
9397
"config.hover.enable": "Enable hover.",
9498
"config.hover.enumsLimit": "When the value corresponds to multiple types, limit the number of types displaying.",

package.nls.zh-cn.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"config.diagnostics.strict": "* close-non-object\n* deprecated\n* discard-returns",
6666
"config.diagnostics.strong": "* no-unknown",
6767
"config.diagnostics.trailing-space": "后置空格",
68-
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* need-check-nil\n* param-type-mismatch\n* undefined-field",
69-
"config.diagnostics.unbalanced": "* missing-parameter\n* redundant-parameter\n* redundant-value\n* unbalanced-assignments",
68+
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* need-check-nil\n* param-type-mismatch\n* return-type-mismatch\n* undefined-field",
69+
"config.diagnostics.unbalanced": "* missing-parameter\n* missing-return\n* missing-return-value\n* redundant-parameter\n* redundant-return-value\n* redundant-value\n* unbalanced-assignments",
7070
"config.diagnostics.undefined-env-child": "`_ENV` 被设置为了新的字面量表,但是试图获取的全局变量不再这张表中",
7171
"config.diagnostics.undefined-global": "未定义的全局变量",
7272
"config.diagnostics.unused": "* code-after-break\n* empty-block\n* redundant-return\n* trailing-space\n* unused-function\n* unused-label\n* unused-local\n* unused-vararg",
@@ -89,6 +89,10 @@
8989
"config.hint.paramName.Disable": "禁用参数提示。",
9090
"config.hint.paramName.Literal": "只有字面量类型的参数进行提示。",
9191
"config.hint.paramType": "在函数的参数位置提示类型。",
92+
"config.hint.semicolon": "若语句尾部没有分号,则显示虚拟分号。",
93+
"config.hint.semicolon.All": "所有语句都显示虚拟分号。",
94+
"config.hint.semicolon.Disable": "禁用虚拟分号。",
95+
"config.hint.semicolon.SameLine": "2个语句在同一行时,在它们之间显示分号。",
9296
"config.hint.setType": "在赋值操作位置提示类型。",
9397
"config.hover.enable": "启用悬停提示。",
9498
"config.hover.enumsLimit": "当值对应多个类型时,限制类型的显示数量。",

package.nls.zh-tw.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"config.diagnostics.strict": "* close-non-object\n* deprecated\n* discard-returns",
6666
"config.diagnostics.strong": "* no-unknown",
6767
"config.diagnostics.trailing-space": "後置空格",
68-
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* need-check-nil\n* param-type-mismatch\n* undefined-field",
69-
"config.diagnostics.unbalanced": "* missing-parameter\n* redundant-parameter\n* redundant-value\n* unbalanced-assignments",
68+
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* need-check-nil\n* param-type-mismatch\n* return-type-mismatch\n* undefined-field",
69+
"config.diagnostics.unbalanced": "* missing-parameter\n* missing-return\n* missing-return-value\n* redundant-parameter\n* redundant-return-value\n* redundant-value\n* unbalanced-assignments",
7070
"config.diagnostics.undefined-env-child": "`_ENV` 被設定為了新的字面常數表,但是試圖獲取的全域變數不在這張表中",
7171
"config.diagnostics.undefined-global": "未定義的全域變數",
7272
"config.diagnostics.unused": "* code-after-break\n* empty-block\n* redundant-return\n* trailing-space\n* unused-function\n* unused-label\n* unused-local\n* unused-vararg",
@@ -89,6 +89,10 @@
8989
"config.hint.paramName.Disable": "停用參數提示。",
9090
"config.hint.paramName.Literal": "只有字面常數類型的參數進行提示。",
9191
"config.hint.paramType": "在函式的參數位置提示類型。",
92+
"config.hint.semicolon": "若陳述式尾部沒有分號,則顯示虛擬分號。",
93+
"config.hint.semicolon.All": "所有陳述式都顯示虛擬分號。",
94+
"config.hint.semicolon.Disable": "停用虛擬分號。",
95+
"config.hint.semicolon.SameLine": "兩個陳述式在同一行時,在它們之間顯示分號。",
9296
"config.hint.setType": "在賦值操作位置提示類型。",
9397
"config.hover.enable": "啟用懸浮提示。",
9498
"config.hover.enumsLimit": "當值對應多個類型時,限制類型的顯示數量。",
@@ -118,8 +122,8 @@
118122
"config.signatureHelp.enable": "啟用參數提示。",
119123
"config.spell.dict": "拼寫檢查的自訂單詞。",
120124
"config.telemetry.enable": "啟用遙測,透過網路發送你的編輯器資訊與錯誤日誌。在[此處](https://github.com/sumneko/lua-language-server/wiki/%E9%9A%B1%E7%A7%81%E8%81%B2%E6%98%8E)閱讀我們的隱私聲明。\n",
121-
"config.type.castNumberToInteger": "Allowed to assign the `number` type to the `integer` type.",
122-
"config.type.weakUnionCheck": "Once one subtype of a union type meets the condition, the union type also meets the condition.\n\nWhen this setting is `false`, the `number|boolean` type cannot be assigned to the `number` type. It can be with `true`.\n",
125+
"config.type.castNumberToInteger": "允許將 `number` 類型賦值給 `integer` 類型。",
126+
"config.type.weakUnionCheck": "同位類型中只要有一個子類型滿足條件,則同位類型也滿足條件。\n\n此設定為 `false` 時,`number|boolean` 類型無法賦給 `number` 類型;為 `true` 時則可以。\n",
123127
"config.window.progressBar": "在狀態欄顯示進度條。",
124128
"config.window.statusBar": "在狀態欄顯示延伸模組狀態。",
125129
"config.workspace.checkThirdParty": "自動偵測與適應第三方庫,目前支援的庫為:\n\n* OpenResty\n* Cocos4.0\n* LÖVE\n* LÖVR\n* skynet\n* Jass\n",

package/build.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local json = require 'json-beautify'
22

3-
local VERSION = "3.3.1"
3+
local VERSION = "3.4.0"
44

55
local package = require 'package.package'
66
local fsu = require 'fs-utility'

server

0 commit comments

Comments
 (0)