internal/lsp: log errors when diagnostics fail
This will allow us to better track the errors that might cause golang/go#30786. Change-Id: I310ad0fd0eda3102d5763e28fc383a4994ef0ff3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/172280 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
parent
9c9e1878f4
commit
3e7148b2fa
|
@ -22,11 +22,13 @@ func (s *Server) cacheAndDiagnose(ctx context.Context, uri span.URI, content str
|
|||
go func() {
|
||||
ctx := view.BackgroundContext()
|
||||
if ctx.Err() != nil {
|
||||
s.log.Errorf(ctx, "canceling diagnostics for %s: %v", uri, ctx.Err())
|
||||
return
|
||||
}
|
||||
reports, err := source.Diagnostics(ctx, view, uri)
|
||||
if err != nil {
|
||||
return // handle error?
|
||||
s.log.Errorf(ctx, "failed to compute diagnostics for %s: %v", uri, err)
|
||||
return
|
||||
}
|
||||
|
||||
s.undeliveredMu.Lock()
|
||||
|
|
Loading…
Reference in New Issue