go/gopls/internal
Robert Findley 76325da620 internal/lsp/progress: detach context for all progress notifications
Use a detached Context for all progress notifications. In particular,
using a detached Context for the window/workDoneProgress/create
notification avoids races where the $/cancelRequest notification and
create response cross paths, such that the client has created a progress
dialog but the server thinks that starting progress failed.

Also, as a matter of best practice don't store a context on the WorkDone
type, despite the fact that this Context is detached. Instead, only
close over a Context in the WorkDoneWriter, which requires a Context in
order to function but which implements the io.Writer interface.

The TestProgressBarErrors test should now pass reliably.

Fixes golang/go#46930

Change-Id: I0d115ed3a62de97fe545c8dc0403e7bb55f6e481
Reviewed-on: https://go-review.googlesource.com/c/tools/+/409936
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-06-02 20:26:04 +00:00
..
coverage gopls/internal/coverage: apply gofmt to the build tag syntax 2021-04-08 20:55:59 +00:00
govulncheck gopls/internal/vulncheck: use internal/govulncheck 2022-05-31 21:46:24 +00:00
hooks gopls: upgrade staticcheck to v0.3.0 2022-04-07 14:59:24 +00:00
regtest internal/lsp/progress: detach context for all progress notifications 2022-06-02 20:26:04 +00:00
vulncheck gopls/internal/vulncheck: use internal/govulncheck 2022-05-31 21:46:24 +00:00