summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-06-11 21:05:43 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-06-11 21:05:43 +0800
commit6b0c48293cfbaebb375975897b59f67e1fa1df31 (patch)
treec2a8dab5324b8212e21b1ad763fba932e3ff3078 /script
parent3101cfb948694389cf1cc9cdbba99267f6290508 (diff)
downloadlua-language-server-6b0c48293cfbaebb375975897b59f67e1fa1df31.zip
改用更好的判断方式
Diffstat (limited to 'script')
-rw-r--r--script/core/completion/completion.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index cff9c385..3a76472a 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -1588,18 +1588,12 @@ end
local function findCall(state, position)
local call
guide.eachSourceContain(state.ast, position, function (src)
- if src.type == 'call' then
- if not call or call.start < src.start then
+ if src.type == 'call' and src.node.finish <= position then
+ if not call or call.start < src.start then
call = src
end
end
end)
- if not call then
- return nil
- end
- if call.node.finish > position then
- return nil
- end
return call
end