diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-01-21 17:34:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-01-21 17:34:46 +0800 |
commit | 4d538055a120ff39fe40e9c73bb40df5645c50e4 (patch) | |
tree | 3ac853dbc3924f0096381b9495a2695a763ac4d7 /script/provider/diagnostic.lua | |
parent | 3778e5eeb3ffe35e5a5f70700635a90970a2ee40 (diff) | |
download | lua-language-server-4d538055a120ff39fe40e9c73bb40df5645c50e4.zip |
update
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r-- | script/provider/diagnostic.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 3152c332..0a3c4384 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -10,6 +10,7 @@ local ws = require 'workspace' local progress = require "progress" local client = require 'client' local converter = require 'proto.converter' +local loading = require 'workspace.loading' ---@class diagnosticProvider local m = {} @@ -364,8 +365,13 @@ function m.diagnosticsScope(uri, force) askForDisable(uri) end) end) - local uris = files.getAllUris() + local scp = ws.getScope(uri) + local uris = files.getAllUris(scp) + log.info(('diagnostics scope [%s], files count:[%d]'):format(scp, #uris)) for i, uri in ipairs(uris) do + while loading.count() > 0 do + await.sleep(1.0) + end bar:setMessage(('%d/%d'):format(i, #uris)) bar:setPercentage(i / #uris * 100) xpcall(m.doDiagnostic, log.error, uri, true) |