summaryrefslogtreecommitdiff
path: root/server-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-15 15:18:43 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-15 15:18:43 +0800
commit932064c8d94e3eea98dd8fce046286f561d72ec5 (patch)
tree348f659ef5b1b3acbc2c6ebabae54d5c91bbc162 /server-beta
parent69522a194a1e0c9a8263a985782d48fe1cc8690b (diff)
downloadlua-language-server-932064c8d94e3eea98dd8fce046286f561d72ec5.zip
修正一个bug
Diffstat (limited to 'server-beta')
-rw-r--r--server-beta/src/searcher/eachRef.lua20
1 files changed, 12 insertions, 8 deletions
diff --git a/server-beta/src/searcher/eachRef.lua b/server-beta/src/searcher/eachRef.lua
index 82ed4269..1c607fec 100644
--- a/server-beta/src/searcher/eachRef.lua
+++ b/server-beta/src/searcher/eachRef.lua
@@ -52,14 +52,18 @@ local function ofReturn(rtn, index, callback)
return
end
-- 搜索函数调用的第 index 个接收值
- searcher.eachRef(func, function (info)
- local source = info.source
- local call = source.parent
- if not call or call.type ~= 'call' then
- return
- end
- ofCallSelect(call, index, callback)
- end)
+ if func.type == 'main' then
+ searcher.eachRef(func, callback)
+ else
+ searcher.eachRef(func, function (info)
+ local source = info.source
+ local call = source.parent
+ if not call or call.type ~= 'call' then
+ return
+ end
+ ofCallSelect(call, index, callback)
+ end)
+ end
end
local function ofSpecialCall(call, func, index, callback)