Skip to content

Commit

Permalink
fix #536
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed May 13, 2021
1 parent f6cc09d commit fe5d329
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

## 1.21.1
`2021-5-8`
Expand Down
9 changes: 6 additions & 3 deletions script/core/signature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ local function makeOneSignature(source, oop, index)
label = label:gsub('%s*->.+', '')
local params = {}
local i = 0
for start, finish in label
local argStart, argLabel = label:match '()(%b())'
local converted = argLabel
: sub(2, -2)
: gsub('%b<>', function (str)
return ('_'):rep(#str)
end)
: gmatch '[%(%)%,]%s*().-()%s*%f[%(%)%,%[%]]' do
: gsub('[%[%]%(%)]', '_')
for start, finish in converted:gmatch '%s*()[^,]+()' do
i = i + 1
params[i] = {
label = {start, finish-1},
label = {start + argStart, finish - 1 + argStart},
}
end
-- 不定参数
Expand Down

0 comments on commit fe5d329

Please sign in to comment.