From 09578bf7b01b1f01b744fb12a2beb44273c26802 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Apr 2019 19:24:14 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/definition.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 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 07f0f3d8..e419b57e 100644 --- a/server/src/method/textDocument/definition.lua +++ b/server/src/method/textDocument/definition.lua @@ -38,7 +38,7 @@ local function findResult(lsp, params) if valueLines then local start_row, start_col = valueLines:rowcol(start) local finish_row, finish_col = valueLines:rowcol(finish) - locations[i] = { + locations[#locations+1] = { uri = valueUri, range = { start = { @@ -52,6 +52,20 @@ local function findResult(lsp, params) }, } } + else + locations[#locations+1] = { + uri = valueUri, + range = { + start = { + line = 0, + character = 0, + }, + ['end'] = { + line = 0, + character = 0, + }, + } + } end end -- cgit v1.2.3