summaryrefslogtreecommitdiff
path: root/server-beta/src/searcher
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-01 17:50:41 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-01 17:50:41 +0800
commit7528dc53b863c91d3a022e09bc7824b54d030b33 (patch)
treec0a17358fb40546b36e4b7ec63b80677417e5d91 /server-beta/src/searcher
parente4d073d7f3b31ce413027a992cb3af90765c7480 (diff)
downloadlua-language-server-7528dc53b863c91d3a022e09bc7824b54d030b33.zip
暂存
Diffstat (limited to 'server-beta/src/searcher')
-rw-r--r--server-beta/src/searcher/eachRef.lua28
1 files changed, 26 insertions, 2 deletions
diff --git a/server-beta/src/searcher/eachRef.lua b/server-beta/src/searcher/eachRef.lua
index 2d9d64b6..10f43765 100644
--- a/server-beta/src/searcher/eachRef.lua
+++ b/server-beta/src/searcher/eachRef.lua
@@ -90,11 +90,35 @@ local function asValue(searcher, source, callback)
end
end
+local function getCallRecvs(call)
+ local parent = call.parent
+ if parent.type ~= 'select' then
+ return
+ end
+end
+
--- 自己作为函数的参数
local function asArg(searcher, source, callback)
local parent = source.parent
- if parent == 'callargs' then
- print(parent)
+ if parent.type == 'callargs' then
+ local call = parent.parent
+ local func = call.node
+ local name = searcher:getSpecialName(func)
+ if name == 'setmetatable' then
+ if parent[1] == source then
+ if parent[2] then
+ searcher:eachField(parent[2], function (info)
+ if info.key == 's|__index' then
+ info.searcher:eachRef(info.source, callback)
+ if info.value then
+ info.searcher:eachRef(info.value, callback)
+ end
+ end
+ end)
+ end
+ end
+ getCallRecvs(call)
+ end
end
end