summaryrefslogtreecommitdiff
path: root/script-beta/vm/eachRef.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-30 00:52:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-30 00:52:49 +0800
commit27a141bb779c3e048b17b2d49071ac1f072662af (patch)
tree8354d44d13b51737b02105006cf36ece569d5d8f /script-beta/vm/eachRef.lua
parentb5d452f3cc7315940e860a21c9bb15673e544d9c (diff)
downloadlua-language-server-27a141bb779c3e048b17b2d49071ac1f072662af.zip
暂存
Diffstat (limited to 'script-beta/vm/eachRef.lua')
-rw-r--r--script-beta/vm/eachRef.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/script-beta/vm/eachRef.lua b/script-beta/vm/eachRef.lua
index d0ba1ade..0d772209 100644
--- a/script-beta/vm/eachRef.lua
+++ b/script-beta/vm/eachRef.lua
@@ -245,6 +245,21 @@ local function asArg(source, callback)
end
end
+--- 自己作为函数的返回值
+local function asReturn(source, callback)
+ local parent = source.parent
+ if parent.type ~= 'return' then
+ return
+ end
+ local func = guide.getParentFunction(source)
+ if func.type == 'main' then
+ else
+ vm.eachRef(func, function (info)
+
+ end)
+ end
+end
+
local function ofLocal(loc, callback)
-- 方法中的 self 使用了一个虚拟的定义位置
if loc.tag ~= 'self' then
@@ -444,6 +459,7 @@ local function eachRef(source, callback)
ofMain(source, callback)
end
asArg(source, callback)
+ asReturn(source, callback)
end
--- 判断2个对象是否拥有相同的引用