diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-11 16:11:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-11 16:11:46 +0800 |
commit | c89e12dc4282c942ea91edbdb7bcab0657fb1ad6 (patch) | |
tree | 114a6bbf553f79b46fe08fec87d55959278d49f9 /server/src/method/textDocument/definition.lua | |
parent | b33b2bf3a6dcf37b507a93b11acbbb85bc8c49b4 (diff) | |
download | lua-language-server-c89e12dc4282c942ea91edbdb7bcab0657fb1ad6.zip |
修正一些BUG
Diffstat (limited to 'server/src/method/textDocument/definition.lua')
-rw-r--r-- | server/src/method/textDocument/definition.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/method/textDocument/definition.lua b/server/src/method/textDocument/definition.lua index d44ec1f6..a40c1832 100644 --- a/server/src/method/textDocument/definition.lua +++ b/server/src/method/textDocument/definition.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.definition(results, position) + local positions = matcher.definition(vm, position) if not positions then return {} end |