Skip to content

Commit 9ae4405

Browse files
committed
avoid sending empty results
empty results should convert to `clear diag`
1 parent c8ea575 commit 9ae4405

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# changelog
22

3+
## 3.2.3
4+
* `FIX` diagnostic: send empty results to every file after startup
5+
36
## 3.2.2
47
`2022-4-26`
58
* `FIX` diagnostic: `unused-function` cannot handle recursion correctly

script/provider/diagnostic.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ local function mergeDiags(a, b, c)
128128
merge(b)
129129
merge(c)
130130

131+
if #t == 0 then
132+
return nil
133+
end
134+
131135
return t
132136
end
133137

@@ -253,9 +257,7 @@ function m.doDiagnostic(uri, isScopeDiag)
253257
version = version,
254258
diagnostics = full,
255259
})
256-
if #full > 0 then
257-
log.debug('publishDiagnostics', uri, #full)
258-
end
260+
log.debug('publishDiagnostics', uri, #full)
259261
end
260262

261263
pushResult()

0 commit comments

Comments
 (0)