Skip to content

Commit 65d80d3

Browse files
committed
fix #483
1 parent dec0117 commit 65d80d3

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# changelog
22

3+
## 1.20.3
4+
`FIX` [#479](https://github.com./sumneko/lua-language-server/issues/479)
5+
`FIX` [#483](https://github.com./sumneko/lua-language-server/issues/483)
6+
37
## 1.20.2
48
`2021-4-2`
59
* `CHG` `LuaDoc`: supports `---@param self TYPE`

script/core/signature.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ local function makeOneSignature(source, oop, index)
4141
label = label:gsub('%s*->.+', '')
4242
local params = {}
4343
local i = 0
44-
for start, finish in label:gmatch '[%(%)%,]%s*().-()%s*%f[%(%)%,%[%]]' do
44+
for start, finish in label
45+
: gsub('%b<>', function (str)
46+
return ('_'):rep(#str)
47+
end)
48+
: gmatch '[%(%)%,]%s*().-()%s*%f[%(%)%,%[%]]' do
4549
i = i + 1
4650
params[i] = {
4751
label = {start, finish-1},

test/signature/init.lua

+15
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,18 @@ function m.f(self: table)
227227
]],
228228
arg = {14, 24},
229229
}
230+
231+
TEST [[
232+
---@alias nnn table<number, string>
233+
234+
---@param x nnn
235+
local function f(x, y, z) end
236+
237+
f($)
238+
]]
239+
{
240+
label = [[
241+
function f(x: table<number, string>, y: any, z: any)
242+
]],
243+
arg = {12, 35},
244+
}

0 commit comments

Comments
 (0)