summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-29 15:10:44 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-29 15:10:48 +0800
commit317727b36088b97c4e46e573c4ed673ae44ffc26 (patch)
tree75573d1e73c509c5d3996731f704fc61c28dccb4 /script/parser
parent94bd343b1850dab6e91e9bbb928f82ef08c2f836 (diff)
downloadlua-language-server-317727b36088b97c4e46e573c4ed673ae44ffc26.zip
clean up code
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 31bc1a30..bdcec0c2 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -1815,6 +1815,7 @@ function m.searchSameFieldsCrossMethod(status, ref, start, pushQueue)
end
local function checkSameSimpleAndMergeFunctionReturnsByDoc(status, results, source, index, args)
+ source = m.getObjectValue(source) or source
if not source or source.type ~= 'function' then
return
end
@@ -2243,6 +2244,7 @@ function m.pushResult(status, mode, ref, simple)
results[#results+1] = ref
elseif ref.type == 'doc.type.function'
or ref.type == 'doc.class.name'
+ or ref.type == 'doc.alias.name'
or ref.type == 'doc.field' then
results[#results+1] = ref
end
@@ -2285,6 +2287,7 @@ function m.pushResult(status, mode, ref, simple)
end
elseif ref.type == 'doc.type.function'
or ref.type == 'doc.class.name'
+ or ref.type == 'doc.alias.name'
or ref.type == 'doc.field' then
results[#results+1] = ref
end
@@ -3156,6 +3159,13 @@ function m.inferCheckDoc(status, source)
end
return true
end
+ if source.type == 'doc.alias.name' then
+ local results = m.getDocTypeNames(status, m.getDocState(source).extends)
+ for _, res in ipairs(results) do
+ status.results[#status.results+1] = res
+ end
+ return true
+ end
end
function m.getVarargDocType(status, source)