summaryrefslogtreecommitdiff
path: root/server/src/method/textDocument/implementation.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/method/textDocument/implementation.lua')
-rw-r--r--server/src/method/textDocument/implementation.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/server/src/method/textDocument/implementation.lua b/server/src/method/textDocument/implementation.lua
index 8f878850..68643e7c 100644
--- a/server/src/method/textDocument/implementation.lua
+++ b/server/src/method/textDocument/implementation.lua
@@ -37,7 +37,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[#locations] = {
+ locations[#locations+1] = {
uri = valueUri,
range = {
start = {
@@ -52,7 +52,7 @@ local function findResult(lsp, params)
}
}
else
- locations[#locations] = {
+ locations[#locations+1] = {
uri = valueUri,
range = {
start = {
@@ -90,16 +90,17 @@ return function (lsp, params)
LastTask = ac.loop(0.1, function ()
local result = findResult(lsp, params)
if result then
+ LastTask:remove()
+ LastTask = nil
response(result)
+ return
end
if lsp:isWaitingCompile() then
return
end
LastTask:remove()
LastTask = nil
- if not result then
- response(nil)
- end
+ response(nil)
end)
end
end