Skip to content

Commit

Permalink
refactor(lsp_server): invert logic for clearing diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
nedpals committed Mar 13, 2024
1 parent 14fdc2b commit a86387d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/lsp_server/lsp_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,13 @@ func newDaemonClientForServer(ctx context.Context, lspServer *LspServer) *daemon
}

uri := uri.File(report.Location.DocumentPath)
if report.ErrorCode < 1 {
// clear the diagnostics
lspServer.unpublishedDiagnostics[uri] = []daemonTypes.ErrorReport{}
} else {
if report.ErrorCode >= 1 {
lspServer.unpublishedDiagnostics[uri] = []daemonTypes.ErrorReport{
report,
}
} else {
// clear the diagnostics
lspServer.unpublishedDiagnostics[uri] = []daemonTypes.ErrorReport{}
}

lspServer.publishChan <- len(lspServer.unpublishedDiagnostics)
Expand Down

0 comments on commit a86387d

Please sign in to comment.