go/gopls/internal/lsp/regtest
Robert Findley 906c733cc2 gopls/internal/lsp/source: find references in test packages
When finding references or implementations, we must include objects
defined in intermediate test variants. However, as we have seen we
should be careful to avoid accidentally type-checking intermediate test
variants in ParseFull, which is not their workspace parse mode.
Therefore eliminate the problematic TypecheckAll type-check mode in
favor of special handling in this one case where it is necessary.

Along the way:
 - Simplify the mapping of protocol position->offset. This should not
   require getting a package, or even parsing a file. For isolation,
   just use the NewColumnMapper constructor, even though it may
   technically result in building a token.File multiple times.
 - Update package renaming logic to use TypecheckWorkspace, since we
   only need to rename within the workspace.
 - Add regtest support for Implementations requests.

Fixes golang/go#43144

Change-Id: I41f684ad766f5af805abbd7c5ee0a010ff9b9b8c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/438755
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2022-10-11 14:54:39 +00:00
..
doc.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
env.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
env_test.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
expectation.go gopls/internal/lsp: warn about Go versions that are too old 2022-10-07 17:55:15 +00:00
regtest.go internal/gocommand: add instrumentation for hanging go commands 2022-09-15 14:14:04 +00:00
runner.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
wrappers.go gopls/internal/lsp/source: find references in test packages 2022-10-11 14:54:39 +00:00