Skip to content

Commit 63510ae

Browse files
committed
fix diag results remains
1 parent 9e57cf3 commit 63510ae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

script/provider/diagnostic.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ function m.doDiagnostic(uri, isScopeDiag)
303303
end
304304
m.cache[uri] = full
305305

306+
if not files.exists(uri) then
307+
m.clear(uri)
308+
return
309+
end
310+
306311
proto.notify('textDocument/publishDiagnostics', {
307312
uri = uri,
308313
version = version,
@@ -345,6 +350,11 @@ function m.resendDiagnostic(uri)
345350
return
346351
end
347352

353+
if not files.exists(uri) then
354+
m.clear(uri)
355+
return
356+
end
357+
348358
local version = files.getVersion(uri)
349359

350360
proto.notify('textDocument/publishDiagnostics', {

0 commit comments

Comments
 (0)