Skip to content

Commit e81ffc1

Browse files
kevinhwang91sumneko
authored andcommitted
perf(diagnostic): avoid first send
If the cache is equal to the full result, we should avoid to notify client during first stage.
1 parent 809fe8d commit e81ffc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script/provider/diagnostic.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,13 @@ function m.doDiagnostic(uri, isScopeDiag)
256256
end
257257
end
258258

259+
pushResult()
260+
259261
-- always re-sent diagnostics of current file
260262
if not isScopeDiag then
261263
m.cache[uri] = nil
262264
end
263265

264-
pushResult()
265-
266266
local lastPushClock = time.time()
267267
---@async
268268
xpcall(core, log.error, uri, isScopeDiag, function (result)

0 commit comments

Comments
 (0)