summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-04-25 16:57:52 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-04-25 16:57:52 +0800
commit71885b139cdae9f3d65268278882bd4793f4fe24 (patch)
treecf629bf48b8dfcf5652f1cbc150f1c5c50689011 /script/vm
parent1c2ea3463e3dc07a9cf43947677169aaeada164e (diff)
downloadlua-language-server-71885b139cdae9f3d65268278882bd4793f4fe24.zip
export name and comment in returns
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 8487ec56..d4309cc9 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -478,6 +478,7 @@ function vm.getReturnOfFunction(func, index)
parent = func,
returnIndex = index,
}
+ vm.compileNode(func._returns[index])
end
return func._returns[index]
end
@@ -1382,6 +1383,10 @@ local compilerSwitch = util.switch()
lastReturn = rtn
if rtn.returnIndex == index then
hasMarkDoc = true
+ source.comment = doc.comment
+ if rtn.name then
+ source.name = rtn.name[1]
+ end
local hasGeneric
if sign then
guide.eachSourceType(rtn, 'doc.generic.name', function (src)