Skip to content

Commit fe5d329

Browse files
committed
fix #536
1 parent f6cc09d commit fe5d329

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 1.21.2
44
* `FIX` loaded new file with ignored filename
5+
* `FIX` [#536](https://github.com/sumneko/lua-language-server/issues/536)
56

67
## 1.21.1
78
`2021-5-8`

script/core/signature.lua

+6-3
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ local function makeOneSignature(source, oop, index)
4141
label = label:gsub('%s*->.+', '')
4242
local params = {}
4343
local i = 0
44-
for start, finish in label
44+
local argStart, argLabel = label:match '()(%b())'
45+
local converted = argLabel
46+
: sub(2, -2)
4547
: gsub('%b<>', function (str)
4648
return ('_'):rep(#str)
4749
end)
48-
: gmatch '[%(%)%,]%s*().-()%s*%f[%(%)%,%[%]]' do
50+
: gsub('[%[%]%(%)]', '_')
51+
for start, finish in converted:gmatch '%s*()[^,]+()' do
4952
i = i + 1
5053
params[i] = {
51-
label = {start, finish-1},
54+
label = {start + argStart, finish - 1 + argStart},
5255
}
5356
end
5457
-- 不定参数

0 commit comments

Comments
 (0)