From eb1fffc9ddfaa804973b1e05c7001d84194ce5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 4 Nov 2019 16:31:51 +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-beta/src/proto/provider.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server-beta/src/proto') diff --git a/server-beta/src/proto/provider.lua b/server-beta/src/proto/provider.lua index 1799a284..9f3b5697 100644 --- a/server-beta/src/proto/provider.lua +++ b/server-beta/src/proto/provider.lua @@ -163,10 +163,11 @@ proto.on('textDocument/definition', function (params) for i, info in ipairs(result) do local targetUri = info.uri local targetLines = files.getLines(targetUri) + local targetText = files.getText(targetUri) response[i] = interface.locationLink(targetUri - , interface.range(targetLines, text, info.target.start - 1, info.target.finish) - , interface.range(targetLines, text, info.target.start - 1, info.target.finish) - , interface.range(lines , text, info.source.start - 1, info.source.finish) + , interface.range(targetLines, targetText, info.target.start - 1, info.target.finish) + , interface.range(targetLines, targetText, info.target.start - 1, info.target.finish) + , interface.range(lines, text, info.source.start - 1, info.source.finish) ) end return response -- cgit v1.2.3