summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/method/textDocument/definition.lua4
-rw-r--r--server/src/method/textDocument/implementation.lua4
2 files changed, 6 insertions, 2 deletions
diff --git a/server/src/method/textDocument/definition.lua b/server/src/method/textDocument/definition.lua
index 0334bef0..fe8d38a5 100644
--- a/server/src/method/textDocument/definition.lua
+++ b/server/src/method/textDocument/definition.lua
@@ -88,6 +88,7 @@ return function (lsp, params)
return result
end
return function (response)
+ local count = 0
LastTask = ac.loop(0.1, function ()
local result = findResult(lsp, params)
if result then
@@ -96,7 +97,8 @@ return function (lsp, params)
LastTask = nil
return
end
- if lsp:isWaitingCompile() then
+ count = count + 1
+ if lsp:isWaitingCompile() and count < 10 then
return
end
response(nil)
diff --git a/server/src/method/textDocument/implementation.lua b/server/src/method/textDocument/implementation.lua
index 68643e7c..14e2f24c 100644
--- a/server/src/method/textDocument/implementation.lua
+++ b/server/src/method/textDocument/implementation.lua
@@ -87,6 +87,7 @@ return function (lsp, params)
return result
end
return function (response)
+ local count = 0
LastTask = ac.loop(0.1, function ()
local result = findResult(lsp, params)
if result then
@@ -95,7 +96,8 @@ return function (lsp, params)
response(result)
return
end
- if lsp:isWaitingCompile() then
+ count = count + 1
+ if lsp:isWaitingCompile() and count < 10 then
return
end
LastTask:remove()