From a67da00e8e2b61a2fa197188b7ffb3e3b83a2a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 21 Mar 2019 15:41:59 +0800 Subject: =?UTF-8?q?=E6=9B=B4=E5=8A=A0=E5=87=86=E7=A1=AE=E7=9A=84=E5=88=86?= =?UTF-8?q?=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/definition.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server/src/method/textDocument/definition.lua') diff --git a/server/src/method/textDocument/definition.lua b/server/src/method/textDocument/definition.lua index a9c05752..e1c45317 100644 --- a/server/src/method/textDocument/definition.lua +++ b/server/src/method/textDocument/definition.lua @@ -17,7 +17,7 @@ return function (lsp, params) return nil end -- lua是从1开始的,因此都要+1 - local position = lines:position(params.position.line + 1, params.position.character + 1) + local position = lines:positionAsChar(params.position.line + 1, params.position.character) local source = core.findSource(vm, position) if not source then return nil -- cgit v1.2.3