diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-01-18 05:39:08 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-01-18 05:39:08 +0800 |
commit | efffa22c25f713f8e37bb22e891319076f5b759d (patch) | |
tree | 9a571dce8b88fa9a149dea5fd81f03e2ab3a57ee /script/provider/diagnostic.lua | |
parent | e136cf1b368268ddd44b85b1c5a3dabffb8fb1c8 (diff) | |
download | lua-language-server-efffa22c25f713f8e37bb22e891319076f5b759d.zip |
check client ability before `diagnostic/refresh`
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r-- | script/provider/diagnostic.lua | 6 |
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 |