Skip to content

Commit ec394a9

Browse files
committed
2.4.0
1 parent 62eeafc commit ec394a9

File tree

7 files changed

+116
-24
lines changed

7 files changed

+116
-24
lines changed

changelog.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,63 @@
11
# changelog
22

33
## 2.4.0
4+
`2021-10-1`
5+
* `NEW` loading settings from `.luarc.json`
46
* `NEW` settings:
57
+ `Lua.diagnostics.libraryFiles`
68
+ `Lua.diagnostics.ignoredFiles`
79
+ `Lua.completion.showWord`
810
+ `Lua.completion.requireSeparator`
911
* `NEW` diagnostics:
1012
+ `different-requires`
13+
* `NEW` `---@CustomClass<string, number>`
14+
* `NEW` supports `$/cancelRequest`
15+
* `NEW` `EventEmitter`
16+
```lua
17+
--- @class Emit
18+
--- @field on fun(eventName: string, cb: function)
19+
--- @field on fun(eventName: '"died"', cb: fun(i: integer))
20+
--- @field on fun(eventName: '"won"', cb: fun(s: string))
21+
local emit = {}
22+
23+
emit:on(--[[support autocomplete fr "died" and "won"]])
24+
25+
emit:on("died", function (i)
26+
-- should be i: integer
27+
end)
28+
29+
emit:on('won', function (s)
30+
-- should be s: string
31+
end)
32+
```
33+
* `NEW` `---@module 'moduleName'`
34+
```lua
35+
---@module 'mylib'
36+
local lib -- the same as `local lib = require 'mylib'`
37+
```
38+
* `NEW` add supports of `skynet`
1139
* `CHG` hover: improve showing multi defines
1240
* `CHG` hover: improve showing multi comments at enums
41+
* `CHG` hover: shows method
1342
* `CHG` hint: `Lua.hint.paramName` now supports `Disable`, `Literal` and `All`
1443
* `CHG` only search first file by `require`
44+
* `CHG` no longer infer by usage
1545
* `CHG` no longer ignore file names case in Windows
1646
* `CHG` watching library changes
47+
* `CHG` completion: improve misspelling results
48+
* `CHG` completion: `Lua.completion.displayContext` default to `0`
49+
* `CHG` completion: `autoRequire` has better inserting position
50+
* `CHG` diagnostics:
51+
+ `redundant-parameter` default severity to `Warning`
52+
+ `redundant-value` default severity to `Warning`
53+
* `CHG` infer: more strict of calculation results
54+
* `CHG` [#663](https://github.com/sumneko/lua-language-server/issues/663)
1755
* `FIX` runtime errors
1856
* `FIX` hint: may show param-2 as `self`
57+
* `FIX` semantic: may fail when scrolling
58+
* `FIX` [#647](https://github.com/sumneko/lua-language-server/issues/647)
59+
* `FIX` [#660](https://github.com/sumneko/lua-language-server/issues/660)
60+
* `FIX` [#673](https://github.com/sumneko/lua-language-server/issues/673)
1961

2062
## 2.3.7
2163
`2021-8-17`

package.json

Lines changed: 64 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"untrustedWorkspaces": {
1515
"description": "",
1616
"restrictedConfigurations": [
17-
"Lua.develop.enable",
1817
"Lua.runtime.plugin",
1918
"Lua.misc.parameters"
2019
],
@@ -33,12 +32,14 @@
3332
"default": "Semantic",
3433
"enum": [
3534
"Grammar",
36-
"Semantic"
35+
"Semantic",
36+
"SemanticEnhanced"
3737
],
3838
"markdownDescription": "%config.color.mode%",
3939
"markdownEnumDescriptions": [
4040
"%config.color.mode.Grammar%",
41-
"%config.color.mode.Semantic%"
41+
"%config.color.mode.Semantic%",
42+
"%config.color.mode.SemanticEnhanced%"
4243
],
4344
"scope": "resource",
4445
"type": "string"
@@ -66,7 +67,7 @@
6667
"type": "string"
6768
},
6869
"Lua.completion.displayContext": {
69-
"default": 6,
70+
"default": 0,
7071
"markdownDescription": "%config.completion.displayContext%",
7172
"scope": "resource",
7273
"type": "integer"
@@ -150,7 +151,7 @@
150151
"type": "array"
151152
},
152153
"Lua.diagnostics.ignoredFiles": {
153-
"default": "Disable",
154+
"default": "Opened",
154155
"enum": [
155156
"Enable",
156157
"Opened",
@@ -166,7 +167,7 @@
166167
"type": "string"
167168
},
168169
"Lua.diagnostics.libraryFiles": {
169-
"default": "Disable",
170+
"default": "Opened",
170171
"enum": [
171172
"Enable",
172173
"Opened",
@@ -437,6 +438,17 @@
437438
"scope": "resource",
438439
"type": "string"
439440
},
441+
"type-check": {
442+
"default": "None",
443+
"description": "%config.diagnostics.type-check%",
444+
"enum": [
445+
"Any",
446+
"Opened",
447+
"None"
448+
],
449+
"scope": "resource",
450+
"type": "string"
451+
},
440452
"unbalanced-assignments": {
441453
"default": "Any",
442454
"description": "%config.diagnostics.unbalanced-assignments%",
@@ -818,7 +830,7 @@
818830
"type": "string"
819831
},
820832
"redundant-parameter": {
821-
"default": "Hint",
833+
"default": "Warning",
822834
"description": "%config.diagnostics.redundant-parameter%",
823835
"enum": [
824836
"Error",
@@ -830,7 +842,7 @@
830842
"type": "string"
831843
},
832844
"redundant-value": {
833-
"default": "Hint",
845+
"default": "Warning",
834846
"description": "%config.diagnostics.redundant-value%",
835847
"enum": [
836848
"Error",
@@ -853,6 +865,18 @@
853865
"scope": "resource",
854866
"type": "string"
855867
},
868+
"type-check": {
869+
"default": "Warning",
870+
"description": "%config.diagnostics.type-check%",
871+
"enum": [
872+
"Error",
873+
"Warning",
874+
"Information",
875+
"Hint"
876+
],
877+
"scope": "resource",
878+
"type": "string"
879+
},
856880
"unbalanced-assignments": {
857881
"default": "Warning",
858882
"description": "%config.diagnostics.unbalanced-assignments%",
@@ -1455,40 +1479,60 @@
14551479
{
14561480
"language": "lua",
14571481
"scopes": {
1458-
"interface.declaration": [
1482+
"function": [
1483+
"variable.function.lua"
1484+
],
1485+
"function.declaration": [
14591486
"entity.name.function.lua"
14601487
],
1461-
"namespace.deprecated": [
1462-
"entity.name.label"
1488+
"function.defaultLibrary": [
1489+
"support.function.lua"
14631490
],
1464-
"namespace.readonly": [
1465-
"constant.language.lua"
1491+
"function.static": [
1492+
"entity.name.function.lua"
14661493
],
1467-
"namespace.static": [
1468-
"support.function.lua"
1494+
"method": [
1495+
"entity.name.function.lua"
1496+
],
1497+
"method.declaration": [
1498+
"entity.name.function.lua"
14691499
],
14701500
"parameter.declaration": [
1471-
"variable.parameter"
1501+
"variable.parameter.lua"
1502+
],
1503+
"property": [
1504+
"variable.other.property.lua"
14721505
],
14731506
"property.declaration": [
1474-
"entity.other.attribute"
1507+
"entity.other.property.lua"
14751508
],
14761509
"variable": [
14771510
"variable.other.lua"
14781511
],
14791512
"variable.abstract": [
14801513
"variable.other.constant.lua"
14811514
],
1482-
"variable.static": [
1515+
"variable.declaration": [
1516+
"variable.other.lua"
1517+
],
1518+
"variable.defaultLibrary": [
1519+
"support.constant.lua"
1520+
],
1521+
"variable.local": [
1522+
"variable.other.lua"
1523+
],
1524+
"variable.readonly": [
14831525
"variable.other.constant.lua"
1526+
],
1527+
"variable.static": [
1528+
"variable.other.lua"
14841529
]
14851530
}
14861531
}
14871532
]
14881533
},
14891534
"description": "Lua Language Server coded by Lua",
14901535
"displayName": "Lua",
1491-
"enableProposedApi": true,
14921536
"engines": {
14931537
"vscode": "^1.23.0"
14941538
},
@@ -1506,5 +1550,5 @@
15061550
"type": "git",
15071551
"url": "https://github.com/sumneko/lua-language-server"
15081552
},
1509-
"version": "2.3.7"
1553+
"version": "2.4.0"
15101554
}

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"config.color.mode": "Color mode.",
44
"config.color.mode.Grammar": "Grammar color.",
55
"config.color.mode.Semantic": "Semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect.",
6+
"config.color.mode.SemanticEnhanced": "Enhanced semantic color. Like `Semantic`, but with additional analysis which might be more computationally expensive.",
67
"config.completion.autoRequire": "When the input looks like a file name, automatically `require` this file.",
78
"config.completion.callSnippet": "Shows function call snippets.",
89
"config.completion.callSnippet.Both": "Shows `function name` and `call snippet`.",

package.nls.zh-cn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"config.color.mode": "着色模式。",
55
"config.color.mode.Grammar": "语法着色。",
66
"config.color.mode.Semantic": "语义着色。你可能需要同时将 `editor.semanticHighlighting.enabled` 设置为 `true` 才能生效。",
7+
"config.color.mode.SemanticEnhanced": "增强的语义颜色。 类似于`Semantic`,但会进行额外的分析(也会带来额外的开销)。",
78
"config.completion.autoRequire": "输入内容看起来是个文件名时,自动 `require` 此文件。",
89
"config.completion.callSnippet": "显示函数调用片段。",
910
"config.completion.callSnippet.Both": "显示 `函数名` 与 `调用片段`。",

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 = "2.3.7"
3+
local VERSION = "2.4.0"
44

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

publish.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ local count = copyFiles(ROOT , out) {
185185
print(('复制了[%d]个文件'):format(count))
186186

187187
print('开始测试...')
188-
runTest(out / 'server')
188+
--runTest(out / 'server')
189189

190190
print('删除多余文件...')
191191
removeFiles(out) {
@@ -209,12 +209,15 @@ end
209209
local function shell(command)
210210
command.stdout = true
211211
command.stderr = true
212+
command.searchPath = true
212213
local show = {}
213214
for _, c in ipairs(command) do
214215
show[#show+1] = tostring(c)
215216
end
217+
table.insert(command, 1, 'cmd')
218+
table.insert(command, 2, '/c')
216219
print(table.concat(show, ' '))
217-
local p, err = subprocess.shell(command)
220+
local p, err = subprocess.spawn(command)
218221
if not p then
219222
error(err)
220223
end
@@ -224,6 +227,7 @@ local function shell(command)
224227
end
225228

226229
local vsix = ROOT / 'publish' / ('lua-' .. version .. '.vsix')
230+
227231
shell {
228232
'vsce', 'package',
229233
'-o', vsix,

server

0 commit comments

Comments
 (0)