diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-18 02:09:44 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-18 02:09:44 +0800 |
commit | c0b4b0299dc7b7efc667ef7fb0957e079ad8a411 (patch) | |
tree | d8c9219275f0ab6c85643a2f93571824023e1b9e /script/vm | |
parent | 53d376ce281906fd856fac42073a072906b2628e (diff) | |
download | lua-language-server-c0b4b0299dc7b7efc667ef7fb0957e079ad8a411.zip |
update
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/compiler.lua | 5 |
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) |