diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-11 16:27:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-11 16:27:03 +0800 |
commit | 5b6a3da07d96345073a275e5e298d83ab3b5ead9 (patch) | |
tree | db995ed3369a250b458e1b2cd9c7bb0fd4c3752d /server/src/method/textDocument/implementation.lua | |
parent | c89e12dc4282c942ea91edbdb7bcab0657fb1ad6 (diff) | |
download | lua-language-server-5b6a3da07d96345073a275e5e298d83ab3b5ead9.zip |
转到定义可以用了
Diffstat (limited to 'server/src/method/textDocument/implementation.lua')
-rw-r--r-- | server/src/method/textDocument/implementation.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/method/textDocument/implementation.lua b/server/src/method/textDocument/implementation.lua index 07d48870..4d77882d 100644 --- a/server/src/method/textDocument/implementation.lua +++ b/server/src/method/textDocument/implementation.lua @@ -2,13 +2,13 @@ local matcher = require 'matcher' return function (lsp, params) local uri = params.textDocument.uri - local results, lines = lsp:loadText(uri) - if not results then + local vm, lines = lsp:loadText(uri) + if not vm then return {} end -- lua是从1开始的,因此都要+1 local position = lines:position(params.position.line + 1, params.position.character + 1) - local positions = matcher.implementation(results, position) + local positions = matcher.implementation(vm.results, position) if not positions then return {} end |