summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-23 17:50:11 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-23 17:50:11 +0800
commit2bcd7495aad00ffc47fc96e8cf801e52e7452a83 (patch)
treed362bdcb50f065d9bf0df84d2d985b6c8ef85289 /script/provider
parent61d9a99cb32487defbf72486d079e9c7324e4e51 (diff)
downloadlua-language-server-2bcd7495aad00ffc47fc96e8cf801e52e7452a83.zip
fix workspace diags
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/diagnostic.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 713d4f48..a5a1b527 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -378,20 +378,25 @@ function m.pullDiagnostic(uri, isScopeDiag)
return full
end
+---@param uri uri
function m.refresh(uri)
if not ws.isReady(uri) then
return
end
+
+ await.close('diag:' .. uri)
+ ---@async
+ await.call(function ()
+ await.setID('diag:' .. uri)
+ await.sleep(0.1)
+ xpcall(m.doDiagnostic, log.error, uri)
+ end)
+
local scp = scope.getScope(uri)
local scopeID = 'diagnosticsScope:' .. scp:getName()
- await.close('diag:' .. uri)
await.close(scopeID)
- await.call(function () ---@async
- if uri then
- await.setID('diag:' .. uri)
- await.sleep(0.1)
- xpcall(m.doDiagnostic, log.error, uri)
- end
+ ---@async
+ await.call(function ()
local delay = config.get(uri, 'Lua.diagnostics.workspaceDelay') / 1000
if delay < 0 then
return