diff options
-rw-r--r-- | server/src/matcher/hover.lua | 6 | ||||
-rw-r--r-- | server/test/signature/init.lua | 22 |
2 files changed, 28 insertions, 0 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua index 0caaa47a..dc7d40de 100644 --- a/server/src/matcher/hover.lua +++ b/server/src/matcher/hover.lua @@ -20,6 +20,9 @@ local function buildLibArgs(lib, oo, select) local start if oo then start = 2 + if select then + select = select + 1 + end else start = 1 end @@ -231,6 +234,9 @@ local function buildValueArgs(result, source, select) local start = 1 if source.object then start = 2 + if select then + select = select + 1 + end end local max if func.built then diff --git a/server/test/signature/init.lua b/server/test/signature/init.lua index 0c343384..bc3713d7 100644 --- a/server/test/signature/init.lua +++ b/server/test/signature/init.lua @@ -44,3 +44,25 @@ x(@) label = "function x(a: any, b: any)", arg = 'a: any' } + +TEST [[ +function mt:f(a) +end + +mt:f(@ +]] +{ + label = 'function mt:f(a: any)', + arg = 'a: any' +} + +TEST [[ +(''):sub(@ +]] +{ + label = [[ +function *string:sub(i: integer [, j: integer(-1)]) + -> string +]], + arg = 'i: integer' +} |