go/internal/lsp/fake
Rob Findley 6932d22acd internal/lsp/source: recursively search for qualified objects
When searching for references or renaming, we start from all packages
containing the current position. But as reported in golang/go#47564,
this fails if we're renaming an object in another package; we need to
start the search from the package containing the object definition.

This CL finds the missing packages by recursively searching all
locations we encounter. For now, this will cause us to consider the
object location, and may also help us behave correctly with respect to
build constraint variants in the future.

While at it, update the regtests to support renaming. This bug could
be exercised with marker tests, but it's good to have a regtest for
renaming anyway.

Fixes golang/go#47564

Change-Id: I5517e2aeaaa744fcc6b6b96ffbb0b2625b498ed5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/340472
Trust: Robert Findley <rfindley@google.com>
Trust: Suzy Mueller <suzmue@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2021-08-17 02:54:26 +00:00
..
client.go internal/lsp/source: recursively search for qualified objects 2021-08-17 02:54:26 +00:00
doc.go internal/lsp/fake: split up and rename the Workspace type 2020-05-06 18:17:57 +00:00
edit.go internal/lsp/cache: don't delete metadata until it's reloaded 2021-06-16 00:19:40 +00:00
edit_test.go internal/lsp/regtest: implement formatting and organizeImports 2020-03-02 19:16:53 +00:00
editor.go internal/lsp/source: recursively search for qualified objects 2021-08-17 02:54:26 +00:00
editor_test.go gopls/internal/regtest: add a failing regtest for vscode-go#1489 2021-05-13 13:20:04 +00:00
proxy.go gopls/internal/regtest: add a failing regtest for vscode-go#1489 2021-05-13 13:20:04 +00:00
sandbox.go gopls/internal/regtest: add a flag to profile didChange handling 2021-07-13 12:52:46 +00:00
workdir.go internal/lsp/cache: don't delete metadata until it's reloaded 2021-06-16 00:19:40 +00:00
workdir_test.go gopls/internal/regtest: add a failing regtest for vscode-go#1489 2021-05-13 13:20:04 +00:00