go/gopls/internal/regtest
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
..
bench internal/lsp/cache: invalidate metadata when parsing issues resolve 2022-05-23 18:14:40 +00:00
codelens internal/lsp/cache: invalidate metadata when parsing issues resolve 2022-05-23 18:14:40 +00:00
completion internal/lsp/cache: invalidate metadata when parsing issues resolve 2022-05-23 18:14:40 +00:00
debug internal/lsp: add an option to get notified of bug reports 2022-05-18 01:40:46 +00:00
diagnostics internal/lsp/progress: detach context for all progress notifications 2022-06-02 20:26:04 +00:00
misc internal/lsp/cache: invalidate metadata when parsing issues resolve 2022-05-23 18:14:40 +00:00
modfile internal/lsp/cache: invalidate metadata when parsing issues resolve 2022-05-23 18:14:40 +00:00
template internal/lsp/cache: invalidate metadata when parsing issues resolve 2022-05-23 18:14:40 +00:00
watch internal/lsp/cache: invalidate metadata when parsing issues resolve 2022-05-23 18:14:40 +00:00
workspace internal/lsp/cache: invalidate metadata when parsing issues resolve 2022-05-23 18:14:40 +00:00