summaryrefslogtreecommitdiff
path: root/server/src/matcher
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-21 17:16:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-21 17:16:30 +0800
commitaeac4c08a5a6ed1c832ca62aad0190e660887abe (patch)
treece90e38b7cb4c3ebb244eed2382f5c58a7165b19 /server/src/matcher
parent6dca52b18108d11ab08a8b951eb98115c06b5640 (diff)
downloadlua-language-server-aeac4c08a5a6ed1c832ca62aad0190e660887abe.zip
因为自动配对括号,正常语法也要尝试参数提示
Diffstat (limited to 'server/src/matcher')
-rw-r--r--server/src/matcher/signature.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/server/src/matcher/signature.lua b/server/src/matcher/signature.lua
index 60316a5f..159fde80 100644
--- a/server/src/matcher/signature.lua
+++ b/server/src/matcher/signature.lua
@@ -20,7 +20,7 @@ end
local function findDirtyCall(vm, pos)
local results = {}
for _, call in ipairs(vm.results.calls) do
- if call.args.dirty and isContainPos(call.args, pos) then
+ if isContainPos(call.args, pos) then
local n = findArgCount(call.args, pos)
results[#results+1] = {
func = call.func,
@@ -45,8 +45,12 @@ return function (vm, pos)
end
local hovers = {}
- for i, call in ipairs(calls) do
- hovers[i] = hover(call.var, call.source, nil, call.select)
+ for _, call in ipairs(calls) do
+ hovers[#hovers+1] = hover(call.var, call.source, nil, call.select)
+ end
+
+ if #hovers == 0 then
+ return nil
end
return hovers