mirror of
https://github.com/golang/go
synced 2024-11-18 20:14:43 -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:
parent
634482edb0
commit
4191b8cbba
7
internal/lsp/testdata/rename/crosspkg/crosspkg.go
vendored
Normal file
7
internal/lsp/testdata/rename/crosspkg/crosspkg.go
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
package crosspkg
|
||||||
|
|
||||||
|
func Foo() { //@rename("Foo", "Dolphin")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var Bar int //@rename("Bar", "Tomato")
|
40
internal/lsp/testdata/rename/crosspkg/crosspkg.go.golden
vendored
Normal file
40
internal/lsp/testdata/rename/crosspkg/crosspkg.go.golden
vendored
Normal 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()
|
||||||
|
}
|
||||||
|
|
8
internal/lsp/testdata/rename/crosspkg/other/other.go
vendored
Normal file
8
internal/lsp/testdata/rename/crosspkg/other/other.go
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package other
|
||||||
|
|
||||||
|
import "golang.org/x/tools/internal/lsp/rename/crosspkg"
|
||||||
|
|
||||||
|
func Other() {
|
||||||
|
crosspkg.Bar
|
||||||
|
crosspkg.Foo()
|
||||||
|
}
|
2
internal/lsp/testdata/summary.txt.golden
vendored
2
internal/lsp/testdata/summary.txt.golden
vendored
@ -15,7 +15,7 @@ DefinitionsCount = 38
|
|||||||
TypeDefinitionsCount = 2
|
TypeDefinitionsCount = 2
|
||||||
HighlightsCount = 2
|
HighlightsCount = 2
|
||||||
ReferencesCount = 7
|
ReferencesCount = 7
|
||||||
RenamesCount = 20
|
RenamesCount = 22
|
||||||
PrepareRenamesCount = 8
|
PrepareRenamesCount = 8
|
||||||
SymbolsCount = 1
|
SymbolsCount = 1
|
||||||
SignaturesCount = 21
|
SignaturesCount = 21
|
||||||
|
Loading…
Reference in New Issue
Block a user