blob: 4d1d128808567cc5a90073d124e4928e8f830b41 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
local guide = require 'parser.guide'
local engineer = require 'core.engineer'
return function (ast, text, offset)
local results = {}
guide.eachSourceContain(ast.ast, offset, function (source)
local searcher = engineer(ast)
searcher:eachDef(source, function (src)
results[#results+1] = {
uri = ast.uri,
source = source,
target = src,
}
end)
end)
if #results == 0 then
return nil
end
return results
end
|