Skip to content

Commit 1997853

Browse files
committed
3.3.0
1 parent 47c6729 commit 1997853

File tree

12 files changed

+80
-16
lines changed

12 files changed

+80
-16
lines changed

changelog.md

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

3+
## 3.3.0
4+
`2022-6-15`
5+
* `NEW` `LuaDoc` supports `` `CODE` ``
6+
```lua
7+
---@type `CONST.X` | `CONST.Y`
8+
local x
9+
10+
if x == -- suggest `CONST.X` and `CONST.Y` here
11+
```
12+
* `CHG` infer type by `error`
13+
```lua
14+
---@type integer|nil
15+
local n
16+
17+
if not n then
18+
error('n is nil')
19+
end
20+
21+
print(n) -- `n` is `integer` here
22+
```
23+
* `CHG` infer type by `t and t.x`
24+
```lua
25+
---@type table|nil
26+
local t
27+
28+
local s = t and t.x or 1 -- `t` in `t.x` is `table`
29+
```
30+
* `CHG` infer type by `type(x)`
31+
```lua
32+
local x
33+
34+
if type(x) == 'string' then
35+
print(x) -- `x` is `string` here
36+
end
37+
38+
local tp = type(x)
39+
40+
if tp == 'boolean' then
41+
print(x) -- `x` is `boolean` here
42+
end
43+
```
44+
* `CHG` infer type by `>`/`<`/`>=`/`<=`
45+
* `FIX` with clients that support LSP 3.17 (VSCode), workspace diagnostics are triggered every time when opening a file.
46+
* `FIX` [#1204](https://github.com/sumneko/lua-language-server/issues/1204)
47+
* `FIX` [#1208](https://github.com/sumneko/lua-language-server/issues/1208)
48+
349
## 3.2.5
450
`2022-6-9`
551
* `NEW` provide config docs in `LUA_LANGUAGE_SERVER/doc/`

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,9 @@
15131513
"loadfile",
15141514
"pcall",
15151515
"xpcall",
1516-
"assert"
1516+
"assert",
1517+
"error",
1518+
"type"
15171519
],
15181520
"type": "string"
15191521
}
@@ -1842,5 +1844,5 @@
18421844
"type": "git",
18431845
"url": "https://github.com/sumneko/lua-language-server"
18441846
},
1845-
"version": "3.2.5"
1847+
"version": "3.3.0"
18461848
}

package.nls.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"config.hint.arrayIndex.Auto": "Show hints only when the table is greater than 3 items, or the table is a mixed table.",
6868
"config.hint.arrayIndex.Disable": "Disable hints of array index.",
6969
"config.hint.arrayIndex.Enable": "Show hints in all tables.",
70+
"config.hint.await": "If the called function is marked `---@async`, prompt `await` at the call.",
7071
"config.hint.enable": "Enable inlay hint.",
7172
"config.hint.paramName": "Show hints of parameter name at the function call.",
7273
"config.hint.paramName.All": "All types of parameters are shown.",
@@ -76,6 +77,7 @@
7677
"config.hint.setType": "Show hints of type at assignment operation.",
7778
"config.hover.enable": "Enable hover.",
7879
"config.hover.enumsLimit": "When the value corresponds to multiple types, limit the number of types displaying.",
80+
"config.hover.expandAlias": "Whether to expand the alias. For example, expands `---@alias myType boolean|number` appears as `boolean|number`, otherwise it appears as `myType'.\n",
7981
"config.hover.fieldInfer": "When hovering to view a table, type infer will be performed for each field. When the accumulated time of type infer reaches the set value (MS), the type infer of subsequent fields will be skipped.",
8082
"config.hover.previewFields": "When hovering to view a table, limits the maximum number of previews for fields.",
8183
"config.hover.viewNumber": "Hover to view numeric content (only if literal is not decimal).",

package.nls.pt-br.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"config.hint.arrayIndex.Auto": "Show hints only when the table is greater than 3 items, or the table is a mixed table.",
6868
"config.hint.arrayIndex.Disable": "Disable hints of array index.",
6969
"config.hint.arrayIndex.Enable": "Show hints in all tables.",
70+
"config.hint.await": "If the called function is marked `---@async`, prompt `await` at the call.",
7071
"config.hint.enable": "Enable inlay hint.",
7172
"config.hint.paramName": "Show hints of parameter name at the function call.",
7273
"config.hint.paramName.All": "All types of parameters are shown.",
@@ -76,6 +77,7 @@
7677
"config.hint.setType": "Show hints of type at assignment operation.",
7778
"config.hover.enable": "Enable hover.",
7879
"config.hover.enumsLimit": "When the value corresponds to multiple types, limit the number of types displaying.",
80+
"config.hover.expandAlias": "Whether to expand the alias. For example, expands `---@alias myType boolean|number` appears as `boolean|number`, otherwise it appears as `myType'.\n",
7981
"config.hover.fieldInfer": "When hovering to view a table, type infer will be performed for each field. When the accumulated time of type infer reaches the set value (MS), the type infer of subsequent fields will be skipped.",
8082
"config.hover.previewFields": "When hovering to view a table, limits the maximum number of previews for fields.",
8183
"config.hover.viewNumber": "Hover to view numeric content (only if literal is not decimal).",

package.nls.zh-cn.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"config.hint.arrayIndex.Auto": "只有表大于3项,或者表是混合类型时才进行提示。",
6868
"config.hint.arrayIndex.Disable": "禁用数组索引提示。",
6969
"config.hint.arrayIndex.Enable": "所有的表中都提示数组索引。",
70+
"config.hint.await": "如果调用的函数被标记为了 `---@async` ,则在调用处提示 `await` 。",
7071
"config.hint.enable": "启用内联提示。",
7172
"config.hint.paramName": "在函数调用处提示参数名。",
7273
"config.hint.paramName.All": "所有类型的参数均进行提示。",
@@ -76,6 +77,7 @@
7677
"config.hint.setType": "在赋值操作位置提示类型。",
7778
"config.hover.enable": "启用悬停提示。",
7879
"config.hover.enumsLimit": "当值对应多个类型时,限制类型的显示数量。",
80+
"config.hover.expandAlias": "是否展开别名。例如 `---@alias myType boolean|number` 展开后显示为 `boolean|number`,否则显示为 `myType`。\n",
7981
"config.hover.fieldInfer": "悬停提示查看表时,会对表的每个字段进行类型推测,当类型推测的用时累计达到该设定值(毫秒)时,将跳过后续字段的类型推测。",
8082
"config.hover.previewFields": "悬停提示查看表时,限制表内字段的最大预览数量。",
8183
"config.hover.viewNumber": "悬停提示查看数字内容(仅当字面量不是十进制时)。",

package.nls.zh-tw.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"config.hint.arrayIndex.Auto": "只有表大於3項,或者表是混合型別時才進行提示。",
6868
"config.hint.arrayIndex.Disable": "停用陣列索引提示。",
6969
"config.hint.arrayIndex.Enable": "所有的表中都提示陣列索引。",
70+
"config.hint.await": "If the called function is marked `---@async`, prompt `await` at the call.",
7071
"config.hint.enable": "啟用內嵌提示。",
7172
"config.hint.paramName": "在函式呼叫處提示參數名。",
7273
"config.hint.paramName.All": "所有型別的參數均進行提示。",
@@ -76,6 +77,7 @@
7677
"config.hint.setType": "在賦值操作位置提示型別。",
7778
"config.hover.enable": "啟用懸浮提示。",
7879
"config.hover.enumsLimit": "當值對應多個型別時,限制型別的顯示數量。",
80+
"config.hover.expandAlias": "Whether to expand the alias. For example, expands `---@alias myType boolean|number` appears as `boolean|number`, otherwise it appears as `myType'.\n",
7981
"config.hover.fieldInfer": "懸浮提示檢視表時,會對表的每個欄位進行型別推測,當型別推測的用時累計達到該設定值(毫秒)時,將跳過後續欄位的型別推測。",
8082
"config.hover.previewFields": "懸浮提示檢視表時,限制表內欄位的最大預覽數量。",
8183
"config.hover.viewNumber": "懸浮提示檢視數字內容(僅當字面常數不是十進制時)。",

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.2.5"
3+
local VERSION = "3.3.0"
44

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

server

setting/schema-pt-br.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@
12501250
},
12511251
"hint.await": {
12521252
"default": true,
1253-
"markdownDescription": "%config.hint.await%",
1253+
"markdownDescription": "If the called function is marked `---@async`, prompt `await` at the call.",
12541254
"scope": "resource",
12551255
"type": "boolean"
12561256
},
@@ -1327,7 +1327,7 @@
13271327
},
13281328
"hover.expandAlias": {
13291329
"default": true,
1330-
"markdownDescription": "%config.hover.expandAlias%",
1330+
"markdownDescription": "Whether to expand the alias. For example, expands `---@alias myType boolean|number` appears as `boolean|number`, otherwise it appears as `myType'.\n",
13311331
"scope": "resource",
13321332
"type": "boolean"
13331333
},
@@ -1652,7 +1652,9 @@
16521652
"loadfile",
16531653
"pcall",
16541654
"xpcall",
1655-
"assert"
1655+
"assert",
1656+
"error",
1657+
"type"
16561658
],
16571659
"type": "string"
16581660
}

setting/schema-zh-cn.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@
12501250
},
12511251
"hint.await": {
12521252
"default": true,
1253-
"markdownDescription": "%config.hint.await%",
1253+
"markdownDescription": "如果调用的函数被标记为了 `---@async` ,则在调用处提示 `await` 。",
12541254
"scope": "resource",
12551255
"type": "boolean"
12561256
},
@@ -1327,7 +1327,7 @@
13271327
},
13281328
"hover.expandAlias": {
13291329
"default": true,
1330-
"markdownDescription": "%config.hover.expandAlias%",
1330+
"markdownDescription": "是否展开别名。例如 `---@alias myType boolean|number` 展开后显示为 `boolean|number`,否则显示为 `myType`。\n",
13311331
"scope": "resource",
13321332
"type": "boolean"
13331333
},
@@ -1652,7 +1652,9 @@
16521652
"loadfile",
16531653
"pcall",
16541654
"xpcall",
1655-
"assert"
1655+
"assert",
1656+
"error",
1657+
"type"
16561658
],
16571659
"type": "string"
16581660
}

0 commit comments

Comments
 (0)