From 696fae86c9175cfc1b210c964b8efda85ed6421f 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 15:18:43 +0800 Subject: =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= 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, 4 insertions(+), 6 deletions(-) (limited to 'server-beta/src/core') diff --git a/server-beta/src/core/definition.lua b/server-beta/src/core/definition.lua index c6596268..0647572e 100644 --- a/server-beta/src/core/definition.lua +++ b/server-beta/src/core/definition.lua @@ -1,11 +1,9 @@ local guide = require 'parser.guide' -local engineer = require 'core.engineer' -return function (ast, text, offset) +return function (file, offset) local results = {} - guide.eachSourceContain(ast.ast, offset, function (source) - local searcher = engineer(ast) - searcher:eachDef(source, function (src) + guide.eachSourceContain(file.ast.ast, offset, function (source) + file.searcher:eachDef(source, function (src) if src.type == 'setfield' or src.type == 'getfield' or src.type == 'tablefield' then @@ -19,7 +17,7 @@ return function (ast, text, offset) src = src.method end results[#results+1] = { - uri = ast.uri, + uri = file.uri, source = source, target = src, } -- cgit v1.2.3