go/internal/lsp/regtest
Robert Findley 25d2ab26ce internal/lsp/cache: fixes for workspace invalidation
This CL fixes a several bugs in workspace invalidation:
 - When invalidating the workspace due to a change in gopls.mod or
   go.work files, we should not update the workspace if the change does
   not parse. There was a comment to this effect, but it was not
   properly implemented.
 - Check go.work before gopls.mod, consistent with our intitial
   workspace load.
 - If we get an 'unchanged' change (such as a save) to go.work, don't
   continue looking for gopls.mod.

A regression test that inadvertently relied on our mishandling of broken
go.work files is updated to have the correct syntax. A new regtest
expectation is added to assert on a clean workspace.

For golang/go#44696

Change-Id: I2b7e739573e225cadfbf8cc892a0b5daf0191e40
Reviewed-on: https://go-review.googlesource.com/c/tools/+/382115
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-04 14:02:15 +00:00
..
doc.go internal/lsp: move gopls/internal/regtest -> internal/lsp/regtest 2021-04-23 16:19:37 +00:00
env.go internal/lsp/regtest: add a benchmark for didChange 2021-05-06 02:57:18 +00:00
env_test.go internal/lsp/regtest: add a benchmark for didChange 2021-05-06 02:57:18 +00:00
expectation.go internal/lsp/cache: fixes for workspace invalidation 2022-02-04 14:02:15 +00:00
regtest.go internal/lsp/regtest: eliminate arbitrary timeouts 2022-01-25 21:51:33 +00:00
runner.go internal/lsp/regtest: eliminate arbitrary timeouts 2022-01-25 21:51:33 +00:00
wrappers.go /internal/lsp/source: apply directory filters to workspace symbols 2021-10-30 12:32:06 +00:00