summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-08-10 17:04:20 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-08-10 17:04:20 +0800
commit63211177f8f3ad2a50dca3ab2ccaae737486813c (patch)
treefa13aaf9674258efc6a4625650dfe7572988b7e8 /script/vm
parentc3c73efb8fbb3e37d0191d3f924283861218a358 (diff)
downloadlua-language-server-63211177f8f3ad2a50dca3ab2ccaae737486813c.zip
support `@type` for `return`
#2144
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index a4147d70..543ee0d4 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -766,6 +766,11 @@ function vm.selectNode(list, index)
if not exp then
return vm.createNode(vm.declareGlobal('type', 'nil')), nil
end
+
+ if vm.bindDocs(list) then
+ return vm.compileNode(list), exp
+ end
+
---@type vm.node?
local result
if exp.type == 'call' then