diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-04-06 11:42:08 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-04-06 11:42:08 +0800 |
commit | 65d80d31d4b679bb95eed8f002be7cf82ca18c94 (patch) | |
tree | 86afb8b50a114476782fbc99d657a376b9a50811 | |
parent | dec0117d74e7856fa9950aba7d3fb6647be29079 (diff) | |
download | lua-language-server-65d80d31d4b679bb95eed8f002be7cf82ca18c94.zip |
fix #483
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | script/core/signature.lua | 6 | ||||
-rw-r--r-- | test/signature/init.lua | 15 |
3 files changed, 24 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md index 61c60ecc..005cf51a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # changelog +## 1.20.3 +`FIX` [#479](https://github.com/sumneko/lua-language-server/issues/479) +`FIX` [#483](https://github.com/sumneko/lua-language-server/issues/483) + ## 1.20.2 `2021-4-2` * `CHG` `LuaDoc`: supports `---@param self TYPE` diff --git a/script/core/signature.lua b/script/core/signature.lua index 61234fd4..a35f3593 100644 --- a/script/core/signature.lua +++ b/script/core/signature.lua @@ -41,7 +41,11 @@ local function makeOneSignature(source, oop, index) label = label:gsub('%s*->.+', '') local params = {} local i = 0 - for start, finish in label:gmatch '[%(%)%,]%s*().-()%s*%f[%(%)%,%[%]]' do + for start, finish in label + : gsub('%b<>', function (str) + return ('_'):rep(#str) + end) + : gmatch '[%(%)%,]%s*().-()%s*%f[%(%)%,%[%]]' do i = i + 1 params[i] = { label = {start, finish-1}, diff --git a/test/signature/init.lua b/test/signature/init.lua index 372709e3..931a8d73 100644 --- a/test/signature/init.lua +++ b/test/signature/init.lua @@ -227,3 +227,18 @@ function m.f(self: table) ]], arg = {14, 24}, } + +TEST [[ +---@alias nnn table<number, string> + +---@param x nnn +local function f(x, y, z) end + +f($) +]] +{ + label = [[ +function f(x: table<number, string>, y: any, z: any) +]], + arg = {12, 35}, +} |