diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-01-31 02:14:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-01-31 02:14:43 +0800 |
commit | 7b3aafb37ba7db4f32a010d2c8914690aedf457d (patch) | |
tree | 49531a043f0f84c132d05c8b137301d0383830ef /script | |
parent | ffeed6eacdb8ad69c7b5f2294c0c12b402de89d5 (diff) | |
download | lua-language-server-7b3aafb37ba7db4f32a010d2c8914690aedf457d.zip |
hint wait workspace ready
Diffstat (limited to 'script')
-rw-r--r-- | script/provider/provider.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua index a6430515..c5680466 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -734,15 +734,17 @@ end) -- Hint do local function updateHint(uri) + local awaitID = 'hint:' .. uri + await.close(awaitID) if not config.config.hint.enable then return end + await.setID(awaitID) + workspace.awaitReady() local visibles = files.getVisibles(uri) if not visibles then return end - await.close('hint') - await.setID('hint') local edits = {} local hint = require 'core.hint' local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_HINT, 0.5) @@ -765,8 +767,7 @@ do end files.watch(function (ev, uri) - if ev == 'create' - or ev == 'update' + if ev == 'update' or ev == 'updateVisible' then await.call(function () updateHint(uri) |