summaryrefslogtreecommitdiff
path: root/script/core/completion.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-16 16:27:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-16 16:27:49 +0800
commit025c4c5fb2ced70e448716391be70fc47e82b1fb (patch)
treed5acdab607e63e80b9eb046d3b588168e187aa32 /script/core/completion.lua
parent05c0b9a8894bb1c24a24e2ed26e61a3b47d12d89 (diff)
downloadlua-language-server-025c4c5fb2ced70e448716391be70fc47e82b1fb.zip
completion: supports enums in `fun()`
Diffstat (limited to 'script/core/completion.lua')
-rw-r--r--script/core/completion.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index f7f1e2c7..7e95d663 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -1327,6 +1327,12 @@ local function getCallEnumsAndFuncs(source, index)
end
end
end
+ if source.type == 'doc.type.function' then
+ local arg = source.args[index]
+ if arg then
+ return pushCallEnumsAndFuncs(vm.getDefs(arg.extends))
+ end
+ end
end
local function findCall(ast, text, offset)