summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/core/signature.lua3
-rw-r--r--test/signature/init.lua17
3 files changed, 21 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md
index 10861ec2..7221ba9f 100644
--- a/changelog.md
+++ b/changelog.md
@@ -2,6 +2,7 @@
## 2.3.1
* `FIX` [#606](https://github.com/sumneko/lua-language-server/issues/606)
+* `FIX` [#607](https://github.com/sumneko/lua-language-server/issues/607)
## 2.3.0
`2021-7-16`
diff --git a/script/core/signature.lua b/script/core/signature.lua
index 76189fb7..26d9867c 100644
--- a/script/core/signature.lua
+++ b/script/core/signature.lua
@@ -49,6 +49,9 @@ local function makeOneSignature(source, oop, index)
: gsub('%b<>', function (str)
return ('_'):rep(#str)
end)
+ : gsub('%b()', function (str)
+ return ('_'):rep(#str)
+ end)
: gsub('[%[%]%(%)]', '_')
for start, finish in converted:gmatch '%s*()[^,]+()' do
i = i + 1
diff --git a/test/signature/init.lua b/test/signature/init.lua
index 40fb33dc..27051310 100644
--- a/test/signature/init.lua
+++ b/test/signature/init.lua
@@ -287,3 +287,20 @@ x(aaaa , 2 $)
label = "function x(a: any, b: any)",
arg = {20, 25},
}
+
+TEST [[
+local fooC
+
+---test callback
+---@param callback fun(x:number, s:string):nil @callback
+---@param par number @par
+function fooC(callback, par) end
+
+fooC(function (x, s)
+
+end,$)
+]]
+{
+ label = 'function fooC(callback: fun(x: number, s: string):nil, par: number)',
+ arg = {56, 66},
+}