diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-10-19 15:18:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-10-19 15:18:43 +0800 |
commit | 696fae86c9175cfc1b210c964b8efda85ed6421f (patch) | |
tree | dd79a633233ff409ef5f54195e4c29fb60246c78 /server-beta/src/core | |
parent | 5bcb7bdf0ae97c59172289b1919e0a5451fba03e (diff) | |
download | lua-language-server-696fae86c9175cfc1b210c964b8efda85ed6421f.zip |
整理代码
Diffstat (limited to 'server-beta/src/core')
-rw-r--r-- | server-beta/src/core/definition.lua | 10 |
1 files changed, 4 insertions, 6 deletions
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, } |