From c5f24b97a38c2c34b9ab5c182f19f5a02260dc74 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Apr 2019 19:31:34 +0800 Subject: =?UTF-8?q?=E8=BF=98=E6=98=AF=E6=89=BE=E5=88=B0=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E5=B0=B1=E8=BF=94=E5=9B=9E=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/references.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 017999df..d969e919 100644 --- a/server/src/method/textDocument/references.lua +++ b/server/src/method/textDocument/references.lua @@ -16,7 +16,7 @@ local function findReferences(lsp, uri, position, declarat) if valueLines then local start_row, start_col = valueLines:rowcol(start) local finish_row, finish_col = valueLines:rowcol(finish) - locations[#locations] = { + locations[#locations+1] = { uri = valueUri, range = { start = { @@ -31,7 +31,7 @@ local function findReferences(lsp, uri, position, declarat) } } else - locations[#locations] = { + locations[#locations+1] = { uri = valueUri, range = { start = { @@ -75,15 +75,16 @@ return function (lsp, params) local positions = findReferences(lsp, uri, position, declarat) if positions then response(positions) + t:remove() + LastTask = nil + return end if lsp:isWaitingCompile() then return end + response(nil) t:remove() LastTask = nil - if not positions then - response(nil) - end end) end end -- cgit v1.2.3