diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-02 17:35:18 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-02 17:35:18 +0800 |
commit | d2d26defedebff9f036ef37c198bd27ceadbb9e9 (patch) | |
tree | 65eb1e351f877d25ca03f7afe877c7260a6fca6b /server-beta/src/searcher/eachRef.lua | |
parent | 7528dc53b863c91d3a022e09bc7824b54d030b33 (diff) | |
download | lua-language-server-d2d26defedebff9f036ef37c198bd27ceadbb9e9.zip |
暂存
Diffstat (limited to 'server-beta/src/searcher/eachRef.lua')
-rw-r--r-- | server-beta/src/searcher/eachRef.lua | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/server-beta/src/searcher/eachRef.lua b/server-beta/src/searcher/eachRef.lua index 10f43765..6e5703a7 100644 --- a/server-beta/src/searcher/eachRef.lua +++ b/server-beta/src/searcher/eachRef.lua @@ -93,8 +93,17 @@ end local function getCallRecvs(call) local parent = call.parent if parent.type ~= 'select' then - return + return nil + end + local exParent = call.exParent + local recvs = {} + recvs[1] = parent.parent + if exParent then + for _, p in ipairs(exParent) do + recvs[#recvs+1] = p.parent + end end + return recvs end --- 自己作为函数的参数 @@ -117,7 +126,10 @@ local function asArg(searcher, source, callback) end) end end - getCallRecvs(call) + local recvs = getCallRecvs(call) + if recvs and recvs[1] then + searcher:eachRef(recvs[1], callback) + end end end end |