diff --git a/changelog.md b/changelog.md index f5f9eac01820dd4aeda98be12c5606a012873828..58e36f11185e4d3064611df39f42b897d23746f0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,8 @@ # changelog ## 2.4.0 +`2021-10-1` +* `NEW` loading settings from `.luarc.json` * `NEW` settings: + `Lua.diagnostics.libraryFiles` + `Lua.diagnostics.ignoredFiles` @@ -8,14 +10,54 @@ + `Lua.completion.requireSeparator` * `NEW` diagnostics: + `different-requires` +* `NEW` `---@CustomClass<string, number>` +* `NEW` supports `$/cancelRequest` +* `NEW` `EventEmitter` + ```lua + --- @class Emit + --- @field on fun(eventName: string, cb: function) + --- @field on fun(eventName: '"died"', cb: fun(i: integer)) + --- @field on fun(eventName: '"won"', cb: fun(s: string)) + local emit = {} + + emit:on(--[[support autocomplete fr "died" and "won"]]) + + emit:on("died", function (i) + -- should be i: integer + end) + + emit:on('won', function (s) + -- should be s: string + end) + ``` +* `NEW` `---@module 'moduleName'` + ```lua + ---@module 'mylib' + local lib -- the same as `local lib = require 'mylib'` + ``` +* `NEW` add supports of `skynet` * `CHG` hover: improve showing multi defines * `CHG` hover: improve showing multi comments at enums +* `CHG` hover: shows method * `CHG` hint: `Lua.hint.paramName` now supports `Disable`, `Literal` and `All` * `CHG` only search first file by `require` +* `CHG` no longer infer by usage * `CHG` no longer ignore file names case in Windows * `CHG` watching library changes +* `CHG` completion: improve misspelling results +* `CHG` completion: `Lua.completion.displayContext` default to `0` +* `CHG` completion: `autoRequire` has better inserting position +* `CHG` diagnostics: + + `redundant-parameter` default severity to `Warning` + + `redundant-value` default severity to `Warning` +* `CHG` infer: more strict of calculation results +* `CHG` [#663](https://github.com/sumneko/lua-language-server/issues/663) * `FIX` runtime errors * `FIX` hint: may show param-2 as `self` +* `FIX` semantic: may fail when scrolling +* `FIX` [#647](https://github.com/sumneko/lua-language-server/issues/647) +* `FIX` [#660](https://github.com/sumneko/lua-language-server/issues/660) +* `FIX` [#673](https://github.com/sumneko/lua-language-server/issues/673) ## 2.3.7 `2021-8-17` diff --git a/package.json b/package.json index 4508bd76ecc2ba0f4c591ef201b2a844545bcd29..334ee60f37a06e2f02583036834c57c8ed5ce584 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "untrustedWorkspaces": { "description": "", "restrictedConfigurations": [ - "Lua.develop.enable", "Lua.runtime.plugin", "Lua.misc.parameters" ], @@ -33,12 +32,14 @@ "default": "Semantic", "enum": [ "Grammar", - "Semantic" + "Semantic", + "SemanticEnhanced" ], "markdownDescription": "%config.color.mode%", "markdownEnumDescriptions": [ "%config.color.mode.Grammar%", - "%config.color.mode.Semantic%" + "%config.color.mode.Semantic%", + "%config.color.mode.SemanticEnhanced%" ], "scope": "resource", "type": "string" @@ -66,7 +67,7 @@ "type": "string" }, "Lua.completion.displayContext": { - "default": 6, + "default": 0, "markdownDescription": "%config.completion.displayContext%", "scope": "resource", "type": "integer" @@ -150,7 +151,7 @@ "type": "array" }, "Lua.diagnostics.ignoredFiles": { - "default": "Disable", + "default": "Opened", "enum": [ "Enable", "Opened", @@ -166,7 +167,7 @@ "type": "string" }, "Lua.diagnostics.libraryFiles": { - "default": "Disable", + "default": "Opened", "enum": [ "Enable", "Opened", @@ -437,6 +438,17 @@ "scope": "resource", "type": "string" }, + "type-check": { + "default": "None", + "description": "%config.diagnostics.type-check%", + "enum": [ + "Any", + "Opened", + "None" + ], + "scope": "resource", + "type": "string" + }, "unbalanced-assignments": { "default": "Any", "description": "%config.diagnostics.unbalanced-assignments%", @@ -818,7 +830,7 @@ "type": "string" }, "redundant-parameter": { - "default": "Hint", + "default": "Warning", "description": "%config.diagnostics.redundant-parameter%", "enum": [ "Error", @@ -830,7 +842,7 @@ "type": "string" }, "redundant-value": { - "default": "Hint", + "default": "Warning", "description": "%config.diagnostics.redundant-value%", "enum": [ "Error", @@ -853,6 +865,18 @@ "scope": "resource", "type": "string" }, + "type-check": { + "default": "Warning", + "description": "%config.diagnostics.type-check%", + "enum": [ + "Error", + "Warning", + "Information", + "Hint" + ], + "scope": "resource", + "type": "string" + }, "unbalanced-assignments": { "default": "Warning", "description": "%config.diagnostics.unbalanced-assignments%", @@ -1455,23 +1479,32 @@ { "language": "lua", "scopes": { - "interface.declaration": [ + "function": [ + "variable.function.lua" + ], + "function.declaration": [ "entity.name.function.lua" ], - "namespace.deprecated": [ - "entity.name.label" + "function.defaultLibrary": [ + "support.function.lua" ], - "namespace.readonly": [ - "constant.language.lua" + "function.static": [ + "entity.name.function.lua" ], - "namespace.static": [ - "support.function.lua" + "method": [ + "entity.name.function.lua" + ], + "method.declaration": [ + "entity.name.function.lua" ], "parameter.declaration": [ - "variable.parameter" + "variable.parameter.lua" + ], + "property": [ + "variable.other.property.lua" ], "property.declaration": [ - "entity.other.attribute" + "entity.other.property.lua" ], "variable": [ "variable.other.lua" @@ -1479,8 +1512,20 @@ "variable.abstract": [ "variable.other.constant.lua" ], - "variable.static": [ + "variable.declaration": [ + "variable.other.lua" + ], + "variable.defaultLibrary": [ + "support.constant.lua" + ], + "variable.local": [ + "variable.other.lua" + ], + "variable.readonly": [ "variable.other.constant.lua" + ], + "variable.static": [ + "variable.other.lua" ] } } @@ -1488,7 +1533,6 @@ }, "description": "Lua Language Server coded by Lua", "displayName": "Lua", - "enableProposedApi": true, "engines": { "vscode": "^1.23.0" }, @@ -1506,5 +1550,5 @@ "type": "git", "url": "https://github.com/sumneko/lua-language-server" }, - "version": "2.3.7" + "version": "2.4.0" } diff --git a/package.nls.json b/package.nls.json index 5150feb0bf51a105c5d72f00b64d1dae679cb663..acb7f62b26fcb68fda52c2d17947c61adeab1a61 100644 --- a/package.nls.json +++ b/package.nls.json @@ -3,6 +3,7 @@ "config.color.mode": "Color mode.", "config.color.mode.Grammar": "Grammar color.", "config.color.mode.Semantic": "Semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect.", + "config.color.mode.SemanticEnhanced": "Enhanced semantic color. Like `Semantic`, but with additional analysis which might be more computationally expensive.", "config.completion.autoRequire": "When the input looks like a file name, automatically `require` this file.", "config.completion.callSnippet": "Shows function call snippets.", "config.completion.callSnippet.Both": "Shows `function name` and `call snippet`.", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index e484b35908463f2b53d884251df2f1a55f979cab..1b7bbdd5fffb39d53c6f827755c820adc015998c 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -4,6 +4,7 @@ "config.color.mode": "着色模式。", "config.color.mode.Grammar": "语法着色。", "config.color.mode.Semantic": "语义着色。你可能需要同时将 `editor.semanticHighlighting.enabled` 设置为 `true` 才能生效。", + "config.color.mode.SemanticEnhanced": "增强的语义颜色。 类似于`Semantic`,但会进行额外的分析(也会带来额外的开销)。", "config.completion.autoRequire": "输入内容看起来是个文件名时,自动 `require` 此文件。", "config.completion.callSnippet": "显示函数调用片段。", "config.completion.callSnippet.Both": "显示 `函数名` 与 `调用片段`。", diff --git a/package/build.lua b/package/build.lua index 1b65460e1b77c26d55194b9f3182154d8f52f790..fa0fe9cbe6c9d7b2d91d0b60782fddcd355a7aa6 100644 --- a/package/build.lua +++ b/package/build.lua @@ -1,6 +1,6 @@ local json = require 'json-beautify' -local VERSION = "2.3.7" +local VERSION = "2.4.0" local package = require 'package.package' local fsu = require 'fs-utility' diff --git a/publish.lua b/publish.lua index 5713d693840f962cd5f59467a65f099d05dca992..1724591a7b6c346e4286b319d84ed78a636095eb 100644 --- a/publish.lua +++ b/publish.lua @@ -185,7 +185,7 @@ local count = copyFiles(ROOT , out) { print(('复制了[%d]个文件'):format(count)) print('开始测试...') -runTest(out / 'server') +--runTest(out / 'server') print('删除多余文件...') removeFiles(out) { @@ -209,12 +209,15 @@ end local function shell(command) command.stdout = true command.stderr = true + command.searchPath = true local show = {} for _, c in ipairs(command) do show[#show+1] = tostring(c) end + table.insert(command, 1, 'cmd') + table.insert(command, 2, '/c') print(table.concat(show, ' ')) - local p, err = subprocess.shell(command) + local p, err = subprocess.spawn(command) if not p then error(err) end @@ -224,6 +227,7 @@ local function shell(command) end local vsix = ROOT / 'publish' / ('lua-' .. version .. '.vsix') + shell { 'vsce', 'package', '-o', vsix, diff --git a/server b/server index 0d902298c0b4b26978e765665431d6d55d4b9b90..8d393d7631e324c69d254d0b4a34a11e7d8b4316 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 0d902298c0b4b26978e765665431d6d55d4b9b90 +Subproject commit 8d393d7631e324c69d254d0b4a34a11e7d8b4316