Skip to content

Commit 872a348

Browse files
committed
internal/lsp: don't log context.Cancelation in diagnostics
Fixes #34103. Change-Id: I76e713d54422d31b587cedd0e4359c8b3bc7845e Reviewed-on: https://go-review.googlesource.com/c/tools/+/215019 Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]>
1 parent 0508ad4 commit 872a348

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/lsp/diagnostics.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ func (s *Server) diagnose(ctx context.Context, snapshot source.Snapshot) {
3939
// Diagnose all of the packages in the workspace.
4040
go func() {
4141
wsPackages, err := snapshot.WorkspacePackages(ctx)
42+
if ctx.Err() != nil {
43+
return
44+
}
4245
if err != nil {
4346
log.Error(ctx, "diagnose: no workspace packages", err, telemetry.Directory.Of(snapshot.View().Folder))
4447
return

0 commit comments

Comments
 (0)