summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorkevinhwang91 <kevin.hwang@live.com>2022-04-20 00:23:47 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-20 00:55:19 +0800
commite81ffc189a1976adf2998f15cae0bd5b141435e2 (patch)
treed0f670816cfc9119185b0a506f5dd64206507406 /script
parent809fe8d082cc8a9231db16cc0a7c0382532115bc (diff)
downloadlua-language-server-e81ffc189a1976adf2998f15cae0bd5b141435e2.zip
perf(diagnostic): avoid first send
If the cache is equal to the full result, we should avoid to notify client during first stage.
Diffstat (limited to 'script')
-rw-r--r--script/provider/diagnostic.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index b359c21c..7a237700 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -256,13 +256,13 @@ function m.doDiagnostic(uri, isScopeDiag)
end
end
+ pushResult()
+
-- always re-sent diagnostics of current file
if not isScopeDiag then
m.cache[uri] = nil
end
- pushResult()
-
local lastPushClock = time.time()
---@async
xpcall(core, log.error, uri, isScopeDiag, function (result)