summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-03-01 17:14:57 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-03-01 17:14:57 +0800
commitd6a09457eefdb44425f99ac4d5ffcaa2c1b7b685 (patch)
treed41ab233813660ff72d5ed9f0cde7d5e9254673f /script/provider
parentda4ddec0289d7d72ce53816259cbfb0069353ab1 (diff)
downloadlua-language-server-d6a09457eefdb44425f99ac4d5ffcaa2c1b7b685.zip
improve delay of completion
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/diagnostic.lua1
-rw-r--r--script/provider/provider.lua4
2 files changed, 2 insertions, 3 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 6f67d92c..883ae68c 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -246,6 +246,7 @@ function m.refresh(uri)
return
end
await.call(function ()
+ await.delay()
if uri then
m.doDiagnostic(uri)
end
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 58b7ddb8..12ddafa1 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -431,9 +431,6 @@ proto.on('textDocument/prepareRename', function (params)
end)
proto.on('textDocument/completion', function (params)
- await.close('completion')
- await.setID('completion')
- await.sleep(0.01)
workspace.awaitReady()
local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_COMPLETION, 0.5)
--log.info(util.dump(params))
@@ -827,6 +824,7 @@ do
files.watch(function (ev, uri)
if ev == 'update'
or ev == 'updateVisible' then
+ await.delay()
await.call(function ()
updateHint(uri)
end)