summaryrefslogtreecommitdiff
path: root/script-beta/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-07-21 22:16:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-07-21 22:16:18 +0800
commit050b7262a4019a1ecafac0acdc5bd9a1b0ca0bf4 (patch)
tree508723afe0c2d322582cf8116b21e3625e9f681d /script-beta/parser
parentde8ca882f4b50b667c6f4c647d26937a869f8546 (diff)
downloadlua-language-server-050b7262a4019a1ecafac0acdc5bd9a1b0ca0bf4.zip
支持单对象跨文件
Diffstat (limited to 'script-beta/parser')
-rw-r--r--script-beta/parser/guide.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 22e49c90..5eff3e1d 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -936,6 +936,19 @@ function m.getCallAndArgIndex(callarg)
return call, index
end
+-- 根据函数调用的返回值,获取:调用的函数,参数列表,自己是第几个返回值
+function m.getCallValue(source)
+ local value = source.value
+ if not value or value.type ~= 'select' then
+ return
+ end
+ local call = value.vararg
+ if call.type ~= 'call' then
+ return
+ end
+ return call.node, call.args, value.index
+end
+
function m.getNextRef(ref)
local nextRef = ref.next
if nextRef then