summaryrefslogtreecommitdiff
path: root/server/src/method/textDocument/references.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-11 16:27:03 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-11 16:27:03 +0800
commit5b6a3da07d96345073a275e5e298d83ab3b5ead9 (patch)
treedb995ed3369a250b458e1b2cd9c7bb0fd4c3752d /server/src/method/textDocument/references.lua
parentc89e12dc4282c942ea91edbdb7bcab0657fb1ad6 (diff)
downloadlua-language-server-5b6a3da07d96345073a275e5e298d83ab3b5ead9.zip
转到定义可以用了
Diffstat (limited to 'server/src/method/textDocument/references.lua')
-rw-r--r--server/src/method/textDocument/references.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/method/textDocument/references.lua b/server/src/method/textDocument/references.lua
index a4d8e6ab..22552fbd 100644
--- a/server/src/method/textDocument/references.lua
+++ b/server/src/method/textDocument/references.lua
@@ -3,13 +3,13 @@ local matcher = require 'matcher'
return function (lsp, params)
local uri = params.textDocument.uri
local declarat = params.context.includeDeclaration
- 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.references(results, position, declarat)
+ local positions = matcher.references(vm.results, position, declarat)
if not positions then
return {}
end