diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-10-19 17:30:51 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-10-19 17:30:51 +0800 |
commit | d9b4f493f08d55f479cebfcc6f16130ba0d6b35f (patch) | |
tree | 75fbf25231cac4e688e8a3b5dce9b67c119629ea /server-beta/src/core | |
parent | c1e44ccc9fed6166b52d08c6e48d1c21f27f5f6a (diff) | |
download | lua-language-server-d9b4f493f08d55f479cebfcc6f16130ba0d6b35f.zip |
在主线程用时编译
Diffstat (limited to 'server-beta/src/core')
-rw-r--r-- | server-beta/src/core/definition.lua | 10 |
1 files changed, 6 insertions, 4 deletions
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, } |