mirror of
https://github.com/golang/go
synced 2024-11-19 07:34:44 -07:00
4191b8cbba
Renames across packages works as of https://golang.org/cl/206883. Add a test for it. Fixes golang/go#32877 Change-Id: I234fafe95a1060c0ca8d03462bf7b2c241d59e4a Reviewed-on: https://go-review.googlesource.com/c/tools/+/207264 Run-TryBot: Michael Matloob <matloob@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
41 lines
549 B
Plaintext
41 lines
549 B
Plaintext
-- Dolphin-rename --
|
|
crosspkg.go:
|
|
package crosspkg
|
|
|
|
func Dolphin() { //@rename("Foo", "Dolphin")
|
|
|
|
}
|
|
|
|
var Bar int //@rename("Bar", "Tomato")
|
|
|
|
other.go:
|
|
package other
|
|
|
|
import "golang.org/x/tools/internal/lsp/rename/crosspkg"
|
|
|
|
func Other() {
|
|
crosspkg.Bar
|
|
crosspkg.Dolphin()
|
|
}
|
|
|
|
-- Tomato-rename --
|
|
crosspkg.go:
|
|
package crosspkg
|
|
|
|
func Foo() { //@rename("Foo", "Dolphin")
|
|
|
|
}
|
|
|
|
var Tomato int //@rename("Bar", "Tomato")
|
|
|
|
other.go:
|
|
package other
|
|
|
|
import "golang.org/x/tools/internal/lsp/rename/crosspkg"
|
|
|
|
func Other() {
|
|
crosspkg.Tomato
|
|
crosspkg.Foo()
|
|
}
|
|
|