summaryrefslogtreecommitdiff
path: root/script/provider/diagnostic.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-18 05:39:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-18 05:39:08 +0800
commitefffa22c25f713f8e37bb22e891319076f5b759d (patch)
tree9a571dce8b88fa9a149dea5fd81f03e2ab3a57ee /script/provider/diagnostic.lua
parente136cf1b368268ddd44b85b1c5a3dabffb8fb1c8 (diff)
downloadlua-language-server-efffa22c25f713f8e37bb22e891319076f5b759d.zip
check client ability before `diagnostic/refresh`
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r--script/provider/diagnostic.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 90c5a81c..ebbe3e36 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -642,6 +642,12 @@ function m.pullDiagnosticScope(callback)
end
function m.refreshClient()
+ if not client.isReady() then
+ return
+ end
+ if not client.getAbility 'workspace.diagnostics.refreshSupport' then
+ return
+ end
log.debug('Refresh client diagnostics')
proto.request('workspace/diagnostic/refresh', json.null)
end