summaryrefslogtreecommitdiff
path: root/script/core/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-09-09 11:39:31 +0800
committerGitHub <noreply@github.com>2024-09-09 11:39:31 +0800
commita126e9c4850726f86d8480aacbb8ec23c1b158ef (patch)
tree4d10fc7ce75ff7ea13f46a90608574e66fed121c /script/core/completion
parentd1320ae5e41086fd9f569c2504a88130447444b8 (diff)
parent7784a06294c4ced20444ab258ca09833bb6b0f7e (diff)
downloadlua-language-server-master.zip
Merge pull request #2840 from NeOzay/fix-autocompletion-arg-for-func-overloadHEADmaster
Fix correctly display enums for function overload arguments
Diffstat (limited to 'script/core/completion')
-rw-r--r--script/core/completion/completion.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index 866d6590..43b5d5ce 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -78,7 +78,9 @@ local function findNearestSource(state, position)
---@type parser.object
local source
guide.eachSourceContain(state.ast, position, function (src)
- source = src
+ if not source or source.start <= src.start then
+ source = src
+ end
end)
return source
end