diff options
Diffstat (limited to 'server/src/matcher/references.lua')
-rw-r--r-- | server/src/matcher/references.lua | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/server/src/matcher/references.lua b/server/src/matcher/references.lua index c0a98fe3..f5b72c55 100644 --- a/server/src/matcher/references.lua +++ b/server/src/matcher/references.lua @@ -1,41 +1,4 @@ - -local function isContainPos(obj, pos) - return obj.start <= pos and obj.finish + 1 >= pos -end - -local function findResult(results, pos) - for _, var in ipairs(results.vars) do - for _, info in ipairs(var) do - if isContainPos(info.source, pos) then - return { - type = 'var', - var = var, - } - end - end - end - for _, dots in ipairs(results.dots) do - for _, info in ipairs(dots) do - if isContainPos(info.source, pos) then - return { - type = 'dots', - dots = dots, - } - end - end - end - for _, label in ipairs(results.labels) do - for _, info in ipairs(label) do - if isContainPos(info.source, pos) then - return { - type = 'label', - label = label, - } - end - end - end - return nil -end +local findResult = require 'matcher.find_result' local function tryMeta(var) local keys = {} |