mirror of https://github.com/golang/go.git
internal/lsp/cache: keep going on failed analyzers
A single failed analyzer should not prevent others from reporting their diagnostics. This is especially relevant as we work on updating analyzers to support generic code. Change-Id: If1d958347649a99df92701fc4a4574cb7020596b Reviewed-on: https://go-review.googlesource.com/c/tools/+/351550 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
284795867f
commit
c8db761657
|
|
@ -46,7 +46,9 @@ func (s *snapshot) Analyze(ctx context.Context, id string, analyzers []*source.A
|
|||
for _, ah := range roots {
|
||||
diagnostics, _, err := ah.analyze(ctx, s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// Keep going if a single analyzer failed.
|
||||
event.Error(ctx, fmt.Sprintf("analyzer %q failed", ah.analyzer.Name), err)
|
||||
continue
|
||||
}
|
||||
results = append(results, diagnostics...)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue