Skip to content

Commit a7d5107

Browse files
committed
3.5.0
1 parent 05f0e5c commit a7d5107

File tree

12 files changed

+942
-417
lines changed

12 files changed

+942
-417
lines changed

changelog.md

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

3+
## 3.5.0
4+
`2022-7-19`
5+
* `NEW` `LuaDoc`: `---@operator`:
6+
```lua
7+
---@class fspath
8+
---@operator div(string|fspath): fspath
9+
10+
---@type fspath
11+
local root
12+
13+
local fileName = root / 'script' / 'main.lua' -- `fileName` is `fspath` here
14+
```
15+
* `NEW` `LuaDoc`: `---@source`:
16+
```lua
17+
-- Also supports absolute path or relative path (based on current file path)
18+
---@source file:///xxx.c:50:20
19+
XXX = 1 -- when finding definitions of `XXX`, returns `file:///xxx.c:50:20` instead here.
20+
```
21+
* `NEW` `LuaDoc`: `---@enum`:
22+
```lua
23+
---@enum animal
24+
Animal = {
25+
Cat = 1,
26+
Dog = 2,
27+
}
28+
29+
---@param x animal
30+
local function f(x) end
31+
32+
f() -- suggests `Animal.Cat`, `Animal.Dog`, `1`, `2` as the first parameter
33+
```
34+
* `NEW` diagnostics:
35+
* `unknown-operator`
36+
* `unreachable-code`
37+
* `NEW` settings:
38+
* `diagnostics.unusedLocalExclude`
39+
* `NEW` VSCode: add support for [EmmyLuaUnity](https://marketplace.visualstudio.com/items?itemName=CppCXY.emmylua-unity)
40+
* `CHG` support multi-type:
41+
```lua
42+
---@type number, _, boolean
43+
local a, b, c -- `a` is `number`, `b` is `unknown`, `c` is `boolean`
44+
```
45+
* `CHG` treat `_ENV = XXX` as `local _ENV = XXX`
46+
* `_ENV = nil`: disable all globals
47+
* `_ENV = {}`: allow all globals
48+
* `_ENV = {} ---@type mathlib`: only allow globals in `mathlib`
49+
* `CHG` hover: dose not show unknown `---@XXX` as description
50+
* `CHG` contravariance is allowed at the class declaration
51+
```lua
52+
---@class BaseClass
53+
local BaseClass
54+
55+
---@class MyClass: BaseClass
56+
local MyClass = BaseClass -- OK!
57+
```
58+
* `CHG` hover: supports path in link
59+
```lua
60+
--![](image.png) --> will convert to `--![](file:///xxxx/image.png)`
61+
local x
62+
```
63+
* `CHG` signature: only show signatures matching the entered parameters
64+
* `FIX` [#880](https://github.com/sumneko/lua-language-server/issues/880)
65+
* `FIX` [#1284](https://github.com/sumneko/lua-language-server/issues/1284)
66+
* `FIX` [#1292](https://github.com/sumneko/lua-language-server/issues/1292)
67+
* `FIX` [#1294](https://github.com/sumneko/lua-language-server/issues/1294)
68+
* `FIX` [#1306](https://github.com/sumneko/lua-language-server/issues/1306)
69+
* `FIX` [#1311](https://github.com/sumneko/lua-language-server/issues/1311)
70+
* `FIX` [#1317](https://github.com/sumneko/lua-language-server/issues/1317)
71+
* `FIX` [#1320](https://github.com/sumneko/lua-language-server/issues/1320)
72+
* `FIX` [#1330](https://github.com/sumneko/lua-language-server/issues/1330)
73+
* `FIX` [#1345](https://github.com/sumneko/lua-language-server/issues/1345)
74+
* `FIX` [#1346](https://github.com/sumneko/lua-language-server/issues/1346)
75+
* `FIX` [#1348](https://github.com/sumneko/lua-language-server/issues/1348)
76+
377
## 3.4.2
478
`2022-7-6`
579
* `CHG` diagnostic: `type-check` ignores `nil` in `getfield`

package.json

Lines changed: 166 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -122,99 +122,101 @@
122122
"default": [],
123123
"items": {
124124
"enum": [
125-
"not-yieldable",
126-
"redundant-parameter",
125+
"action-after-return",
126+
"ambiguity-1",
127+
"args-after-dots",
128+
"assign-type-mismatch",
129+
"await-in-sync",
130+
"block-after-else",
127131
"break-outside",
128-
"undefined-doc-class",
129-
"unknown-symbol",
130-
"miss-method",
131-
"err-nonstandard-symbol",
132-
"unknown-attribute",
133-
"unexpect-efunc-name",
132+
"cast-local-type",
133+
"cast-type-mismatch",
134+
"circle-doc-class",
135+
"close-non-object",
136+
"code-after-break",
137+
"codestyle-check",
138+
"count-down-loop",
139+
"deprecated",
134140
"different-requires",
135-
"miss-end",
136-
"await-in-sync",
137-
"args-after-dots",
138-
"err-eq-as-assign",
139-
"newfield-call",
141+
"discard-returns",
142+
"doc-field-no-class",
143+
"duplicate-doc-alias",
144+
"duplicate-doc-field",
145+
"duplicate-doc-param",
146+
"duplicate-index",
147+
"duplicate-set-field",
148+
"empty-block",
140149
"err-assign-as-eq",
141-
"undefined-doc-param",
142-
"param-type-mismatch",
150+
"err-c-long-comment",
151+
"err-comment-prefix",
152+
"err-do-as-then",
153+
"err-eq-as-assign",
154+
"err-esc",
155+
"err-nonstandard-symbol",
156+
"err-then-as-do",
157+
"exp-in-action",
143158
"global-in-nil-env",
144-
"missing-parameter",
145-
"miss-sep-in-table",
146-
"unknown-cast-variable",
147-
"miss-loop-min",
159+
"index-in-func-name",
160+
"jump-local-scope",
161+
"keyword",
162+
"local-limit",
163+
"lowercase-global",
148164
"malformed-number",
149-
"err-do-as-then",
150-
"spell-check",
151-
"undefined-env-child",
152-
"missing-return-value",
153-
"discard-returns",
154-
"redundant-return",
165+
"miss-end",
155166
"miss-esc-x",
156-
"redundant-value",
157-
"duplicate-doc-alias",
158-
"doc-field-no-class",
159-
"no-visible-label",
160167
"miss-exp",
168+
"miss-exponent",
169+
"miss-field",
161170
"miss-loop-max",
171+
"miss-loop-min",
172+
"miss-method",
162173
"miss-name",
163-
"empty-block",
164-
"unused-local",
165-
"err-then-as-do",
166-
"duplicate-doc-field",
167-
"redefined-label",
168-
"exp-in-action",
169-
"set-const",
170-
"circle-doc-class",
171-
"unexpect-lfunc-name",
172-
"unsupport-symbol",
173-
"unused-label",
174-
"action-after-return",
175-
"unexpect-dots",
174+
"miss-sep-in-table",
175+
"miss-space-between",
176+
"miss-symbol",
177+
"missing-parameter",
178+
"missing-return",
179+
"missing-return-value",
180+
"need-check-nil",
181+
"newfield-call",
176182
"newline-call",
177-
"jump-local-scope",
178-
"close-non-object",
179-
"miss-field",
180-
"count-down-loop",
181-
"cast-type-mismatch",
182-
"duplicate-index",
183-
"unexpect-symbol",
184-
"block-after-else",
185-
"unicode-name",
186-
"miss-exponent",
187-
"err-esc",
183+
"no-unknown",
184+
"no-visible-label",
185+
"not-yieldable",
186+
"param-type-mismatch",
187+
"redefined-label",
188+
"redefined-local",
189+
"redundant-parameter",
190+
"redundant-return",
188191
"redundant-return-value",
192+
"redundant-value",
193+
"return-type-mismatch",
194+
"set-const",
195+
"spell-check",
196+
"trailing-space",
189197
"unbalanced-assignments",
190-
"err-c-long-comment",
198+
"undefined-doc-class",
191199
"undefined-doc-name",
192-
"ambiguity-1",
193-
"trailing-space",
194-
"deprecated",
195-
"codestyle-check",
196-
"missing-return",
200+
"undefined-doc-param",
201+
"undefined-env-child",
202+
"undefined-field",
197203
"undefined-global",
198-
"unused-function",
199-
"code-after-break",
200-
"assign-type-mismatch",
201-
"local-limit",
202-
"cast-local-type",
203-
"need-check-nil",
204-
"keyword",
204+
"unexpect-dots",
205+
"unexpect-efunc-name",
206+
"unexpect-lfunc-name",
207+
"unexpect-symbol",
208+
"unicode-name",
209+
"unknown-attribute",
210+
"unknown-cast-variable",
205211
"unknown-diag-code",
206-
"unused-vararg",
207-
"err-comment-prefix",
208-
"lowercase-global",
209-
"return-type-mismatch",
210-
"duplicate-set-field",
211-
"redefined-local",
212-
"no-unknown",
213-
"duplicate-doc-param",
214-
"index-in-func-name",
215-
"miss-symbol",
216-
"undefined-field",
217-
"miss-space-between"
212+
"unknown-operator",
213+
"unknown-symbol",
214+
"unreachable-code",
215+
"unsupport-symbol",
216+
"unused-function",
217+
"unused-label",
218+
"unused-local",
219+
"unused-vararg"
218220
],
219221
"type": "string"
220222
},
@@ -1202,6 +1204,32 @@
12021204
],
12031205
"type": "string"
12041206
},
1207+
"unknown-operator": {
1208+
"default": "Any",
1209+
"description": "%config.diagnostics.unknown-operator%",
1210+
"enum": [
1211+
"Any",
1212+
"Opened",
1213+
"None",
1214+
"Any!",
1215+
"Opened!",
1216+
"None!"
1217+
],
1218+
"type": "string"
1219+
},
1220+
"unreachable-code": {
1221+
"default": "Opened",
1222+
"description": "%config.diagnostics.unreachable-code%",
1223+
"enum": [
1224+
"Any",
1225+
"Opened",
1226+
"None",
1227+
"Any!",
1228+
"Opened!",
1229+
"None!"
1230+
],
1231+
"type": "string"
1232+
},
12051233
"unused-function": {
12061234
"default": "Opened",
12071235
"description": "%config.diagnostics.unused-function%",
@@ -1983,6 +2011,36 @@
19832011
],
19842012
"type": "string"
19852013
},
2014+
"unknown-operator": {
2015+
"default": "Warning",
2016+
"description": "%config.diagnostics.unknown-operator%",
2017+
"enum": [
2018+
"Error",
2019+
"Warning",
2020+
"Information",
2021+
"Hint",
2022+
"Error!",
2023+
"Warning!",
2024+
"Information!",
2025+
"Hint!"
2026+
],
2027+
"type": "string"
2028+
},
2029+
"unreachable-code": {
2030+
"default": "Hint",
2031+
"description": "%config.diagnostics.unreachable-code%",
2032+
"enum": [
2033+
"Error",
2034+
"Warning",
2035+
"Information",
2036+
"Hint",
2037+
"Error!",
2038+
"Warning!",
2039+
"Information!",
2040+
"Hint!"
2041+
],
2042+
"type": "string"
2043+
},
19862044
"unused-function": {
19872045
"default": "Hint",
19882046
"description": "%config.diagnostics.unused-function%",
@@ -2048,6 +2106,15 @@
20482106
"title": "severity",
20492107
"type": "object"
20502108
},
2109+
"Lua.diagnostics.unusedLocalExclude": {
2110+
"default": [],
2111+
"items": {
2112+
"type": "string"
2113+
},
2114+
"markdownDescription": "%config.diagnostics.unusedLocalExclude%",
2115+
"scope": "resource",
2116+
"type": "array"
2117+
},
20512118
"Lua.diagnostics.workspaceDelay": {
20522119
"default": 3000,
20532120
"markdownDescription": "%config.diagnostics.workspaceDelay%",
@@ -2347,6 +2414,26 @@
23472414
],
23482415
"type": "string"
23492416
},
2417+
"table.clear": {
2418+
"default": "default",
2419+
"description": "%config.runtime.builtin.table.clear%",
2420+
"enum": [
2421+
"default",
2422+
"enable",
2423+
"disable"
2424+
],
2425+
"type": "string"
2426+
},
2427+
"table.new": {
2428+
"default": "default",
2429+
"description": "%config.runtime.builtin.table.new%",
2430+
"enum": [
2431+
"default",
2432+
"enable",
2433+
"disable"
2434+
],
2435+
"type": "string"
2436+
},
23502437
"utf8": {
23512438
"default": "default",
23522439
"description": "%config.runtime.builtin.utf8%",
@@ -2809,5 +2896,5 @@
28092896
"sponsor": {
28102897
"url": "https://github.com/sumneko/lua-language-server/issues/484"
28112898
},
2812-
"version": "3.4.2"
2899+
"version": "3.5.0"
28132900
}

0 commit comments

Comments
 (0)