From c89e12dc4282c942ea91edbdb7bcab0657fb1ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 11 Dec 2018 16:11:46 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=BA=9BBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/definition.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/src/method') 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 -- cgit v1.2.3