summaryrefslogtreecommitdiff
path: root/script/core/completion/completion.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-16 23:47:40 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-16 23:47:40 +0800
commit04c671114d1d4c4bcfbad74c8341b24844552865 (patch)
tree5179418d409f223a0fa8fd02e9bd44464e559683 /script/core/completion/completion.lua
parent697c9359636a639f044192fd81e3f4374488192c (diff)
downloadlua-language-server-04c671114d1d4c4bcfbad74c8341b24844552865.zip
doc.enum
Diffstat (limited to 'script/core/completion/completion.lua')
-rw-r--r--script/core/completion/completion.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index 908398e7..01b5fcfe 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -1648,6 +1648,7 @@ local function tryluaDocBySource(state, position, source, results)
for _, doc in ipairs(vm.getDocSets(state.uri)) do
local name = (doc.type == 'doc.class' and doc.class[1])
or (doc.type == 'doc.alias' and doc.alias[1])
+ or (doc.type == 'doc.enum' and doc.enum[1])
if name
and not used[name]
and matchKey(source[1], name) then
@@ -1803,6 +1804,14 @@ local function tryluaDocByErr(state, position, err, docState, results)
kind = define.CompletionItemKind.Class,
}
end
+ if doc.type == 'doc.enum'
+ and not used[doc.enum[1]] then
+ used[doc.enum[1]] = true
+ results[#results+1] = {
+ label = doc.enum[1],
+ kind = define.CompletionItemKind.Enum,
+ }
+ end
end
elseif err.type == 'LUADOC_MISS_PARAM_NAME' then
local funcs = {}