From d9b4f493f08d55f479cebfcc6f16130ba0d6b35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 19 Oct 2019 17:30:51 +0800 Subject: =?UTF-8?q?=E5=9C=A8=E4=B8=BB=E7=BA=BF=E7=A8=8B=E7=94=A8=E6=97=B6?= =?UTF-8?q?=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/core/definition.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'server-beta/src/core') diff --git a/server-beta/src/core/definition.lua b/server-beta/src/core/definition.lua index 0647572e..b3ec7cf8 100644 --- a/server-beta/src/core/definition.lua +++ b/server-beta/src/core/definition.lua @@ -1,9 +1,11 @@ local guide = require 'parser.guide' +local engineer = require 'core.engineer' -return function (file, offset) +return function (ast, text, offset) local results = {} - guide.eachSourceContain(file.ast.ast, offset, function (source) - file.searcher:eachDef(source, function (src) + local searcher = engineer(ast) + guide.eachSourceContain(ast.ast, offset, function (source) + searcher:eachDef(source, function (src) if src.type == 'setfield' or src.type == 'getfield' or src.type == 'tablefield' then @@ -17,7 +19,7 @@ return function (file, offset) src = src.method end results[#results+1] = { - uri = file.uri, + uri = ast.uri, source = source, target = src, } -- cgit v1.2.3