mirror of https://github.com/golang/go.git
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> |
||
|---|---|---|
| .. | ||
| doc.go | ||
| env.go | ||
| env_test.go | ||
| expectation.go | ||
| regtest.go | ||
| runner.go | ||
| wrappers.go | ||