Skip to content

Commit

Permalink
perf(diagnostic): avoid first send
Browse files Browse the repository at this point in the history
If the cache is equal to the full result, we should avoid to notify
client during first stage.
  • Loading branch information
kevinhwang91 authored and sumneko committed Apr 19, 2022
1 parent 809fe8d commit e81ffc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script/provider/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e81ffc1

Please sign in to comment.