1
0
mirror of https://github.com/golang/go synced 2024-10-01 10:38:33 -06:00
go/internal/lsp/regtest
Rebecca Stambler 9c79f685b7 internal/lsp: fix view rebuilding when go mod init runs
https://github.com/microsoft/vscode-go/issues/3076#issuecomment-605062933
inspired me to write a regression test for this case. Turns out we
weren't handling it correctly after all...

This change makes sure that we only rebuild the view once a new go.mod
file is saved, not just created. It also preserves the snapshot ID
number when the view is recreated so that diagnostic caching continues
to work as expected.

Change-Id: I63bd559c3bd33b91828171cd7ddb3d099c31cddb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/226017
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2020-03-30 17:42:33 +00:00
..
definition_test.go internal/lsp/regtest: remove redundant T and ctx params from regtest funcs 2020-03-24 20:18:24 +00:00
diagnostics_test.go internal/lsp: fix view rebuilding when go mod init runs 2020-03-30 17:42:33 +00:00
env.go internal/lsp/regtest: remove redundant T and ctx params from regtest funcs 2020-03-24 20:18:24 +00:00
formatting_test.go internal/lsp/regtest: remove redundant T and ctx params from regtest funcs 2020-03-24 20:18:24 +00:00
reg_test.go internal/lsp/regtest: clean-up and more error handling 2020-02-25 19:00:36 +00:00
serialization_test.go internal/lsp/regtest: remove redundant T and ctx params from regtest funcs 2020-03-24 20:18:24 +00:00
shared_test.go internal/lsp/regtest: remove redundant T and ctx params from regtest funcs 2020-03-24 20:18:24 +00:00
wrappers.go internal/lsp: remove command-line-arguments as a workspace package 2020-03-25 20:31:30 +00:00