mirror of
https://github.com/golang/go
synced 2024-11-18 16:14:46 -07:00
internal/lsp: log snapshot IDs, don't log context cancellation
Updates golang/go#36772 Change-Id: Id6f1be9511f37865d5c6efcff10230e03724b27d Reviewed-on: https://go-review.googlesource.com/c/tools/+/216497 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
This commit is contained in:
parent
f3a16861ae
commit
0576458154
@ -36,6 +36,8 @@ func (s *Server) diagnose(ctx context.Context, snapshot source.Snapshot) {
|
||||
ctx, done := trace.StartSpan(ctx, "lsp:background-worker")
|
||||
defer done()
|
||||
|
||||
ctx = telemetry.Snapshot.With(ctx, snapshot.ID())
|
||||
|
||||
// Diagnose all of the packages in the workspace.
|
||||
go func() {
|
||||
wsPackages, err := snapshot.WorkspacePackages(ctx)
|
||||
@ -148,7 +150,9 @@ func (s *Server) publishReports(ctx context.Context, snapshot source.Snapshot, r
|
||||
URI: protocol.NewURI(fileID.URI),
|
||||
Version: fileID.Version,
|
||||
}); err != nil {
|
||||
if ctx.Err() == nil {
|
||||
log.Error(ctx, "publishReports: failed to deliver diagnostic", err, telemetry.File)
|
||||
}
|
||||
continue
|
||||
}
|
||||
// Update the delivered map.
|
||||
|
@ -25,6 +25,7 @@ const (
|
||||
Package = tag.Key("package")
|
||||
PackagePath = tag.Key("package_path")
|
||||
Query = tag.Key("query")
|
||||
Snapshot = tag.Key("snapshot")
|
||||
)
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user