diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-30 00:52:49 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-30 00:52:49 +0800 |
commit | 27a141bb779c3e048b17b2d49071ac1f072662af (patch) | |
tree | 8354d44d13b51737b02105006cf36ece569d5d8f /script-beta/vm | |
parent | b5d452f3cc7315940e860a21c9bb15673e544d9c (diff) | |
download | lua-language-server-27a141bb779c3e048b17b2d49071ac1f072662af.zip |
暂存
Diffstat (limited to 'script-beta/vm')
-rw-r--r-- | script-beta/vm/eachRef.lua | 16 |
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个对象是否拥有相同的引用 |