Skip to content

Commit 033e345

Browse files
authored
LSP skip checks on build errors (#4133)
1 parent 6f5aa39 commit 033e345

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

private/buf/buflsp/file.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,16 @@ func (f *file) RunChecks(ctx context.Context) {
683683
}
684684
f.CancelChecks(ctx)
685685

686+
for _, diagnostic := range f.diagnostics {
687+
if diagnostic.Severity == protocol.DiagnosticSeverityError {
688+
f.lsp.logger.DebugContext(
689+
ctx, "checks skipped on diagnostic severity",
690+
slog.String("severity", diagnostic.Severity.String()),
691+
)
692+
return // Skip on not buildable images.
693+
}
694+
}
695+
686696
workspace := f.workspace.Workspace()
687697
module := f.workspace.GetModule(f.uri)
688698
checkClient := f.workspace.CheckClient()

0 commit comments

Comments
 (0)