summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-18 02:09:44 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-18 02:09:44 +0800
commitc0b4b0299dc7b7efc667ef7fb0957e079ad8a411 (patch)
treed8c9219275f0ab6c85643a2f93571824023e1b9e /script
parent53d376ce281906fd856fac42073a072906b2628e (diff)
downloadlua-language-server-c0b4b0299dc7b7efc667ef7fb0957e079ad8a411.zip
update
Diffstat (limited to 'script')
-rw-r--r--script/vm/compiler.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 12ef2a7c..e33ec234 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1418,11 +1418,12 @@ local compilerSwitch = util.switch()
end
end
if lastReturn and not hasMarkDoc and lastReturn.types[1][1] == '...' then
+ hasMarkDoc = true
vm.setNode(source, vm.getGlobal('type', 'unknown'))
end
end
+ local hasReturn
if func.returns and not hasMarkDoc then
- local hasReturn
for _, rtn in ipairs(func.returns) do
if selectNode(source, rtn, index) then
hasReturn = true
@@ -1454,7 +1455,7 @@ local compilerSwitch = util.switch()
end
end
end
- if vm.getNode(source):isEmpty() then
+ if not hasMarkDoc and not hasReturn then
vm.setNode(source, vm.getGlobal('type', 'nil'))
end
end)