1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:54:42 -07:00

internal/lsp/testadata/rename: add a test case for renames across packages

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>
This commit is contained in:
Michael Matloob 2019-11-14 15:40:29 -05:00
parent 634482edb0
commit 4191b8cbba
4 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,7 @@
package crosspkg
func Foo() { //@rename("Foo", "Dolphin")
}
var Bar int //@rename("Bar", "Tomato")

View File

@ -0,0 +1,40 @@
-- 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()
}

View File

@ -0,0 +1,8 @@
package other
import "golang.org/x/tools/internal/lsp/rename/crosspkg"
func Other() {
crosspkg.Bar
crosspkg.Foo()
}

View File

@ -15,7 +15,7 @@ DefinitionsCount = 38
TypeDefinitionsCount = 2
HighlightsCount = 2
ReferencesCount = 7
RenamesCount = 20
RenamesCount = 22
PrepareRenamesCount = 8
SymbolsCount = 1
SignaturesCount = 21