From 2a8a23aec9cceec42f288750b3ed19ec8bd23fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 8 Dec 2018 19:13:50 +0800 Subject: =?UTF-8?q?=E4=B8=8D=E7=94=A8=E6=AF=8F=E6=AC=A1=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/references.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/src/method/textDocument/references.lua') diff --git a/server/src/method/textDocument/references.lua b/server/src/method/textDocument/references.lua index 4b17700e..a4d8e6ab 100644 --- a/server/src/method/textDocument/references.lua +++ b/server/src/method/textDocument/references.lua @@ -8,7 +8,7 @@ return function (lsp, params) return {} end -- lua是从1开始的,因此都要+1 - local position = lines:position(params.position.line + 1, params.position.character + 1, 'utf8') + local position = lines:position(params.position.line + 1, params.position.character + 1) local positions = matcher.references(results, position, declarat) if not positions then return {} @@ -17,8 +17,8 @@ return function (lsp, params) local locations = {} for i, position in ipairs(positions) do local start, finish = position[1], position[2] - local start_row, start_col = lines:rowcol(start, 'utf8') - local finish_row, finish_col = lines:rowcol(finish, 'utf8') + local start_row, start_col = lines:rowcol(start) + local finish_row, finish_col = lines:rowcol(finish) locations[i] = { uri = uri, range = { -- cgit v1.2.3