| 1 |
Test renaming a parameter to the name of an imported package |
| 2 |
referenced by one of the function parameters. |
| 3 |
|
| 4 |
See golang/go#57479 |
| 5 |
|
| 6 |
-- go.mod -- |
| 7 |
module golang.org/lsptests/rename |
| 8 |
|
| 9 |
go 1.18 |
| 10 |
-- a/a.go -- |
| 11 |
package a |
| 12 |
|
| 13 |
import ( |
| 14 |
"fmt" |
| 15 |
"math" |
| 16 |
) |
| 17 |
|
| 18 |
func _(x fmt.Stringer) {} //@rename("x", "fmt", xToFmt) |
| 19 |
|
| 20 |
func _(x int, y fmt.Stringer) {} //@rename("x", "fmt", xyToFmt) |
| 21 |
|
| 22 |
func _(x [math.MaxInt]bool) {} //@rename("x", "math", xToMath) |
| 23 |
-- @xToFmt/a/a.go -- |
| 24 |
@@ -8 +8 @@ |
| 25 |
-func _(x fmt.Stringer) {} //@rename("x", "fmt", xToFmt) |
| 26 |
+func _(fmt fmt.Stringer) {} //@rename("x", "fmt", xToFmt) |
| 27 |
-- @xToMath/a/a.go -- |
| 28 |
@@ -12 +12 @@ |
| 29 |
-func _(x [math.MaxInt]bool) {} //@rename("x", "math", xToMath) |
| 30 |
+func _(math [math.MaxInt]bool) {} //@rename("x", "math", xToMath) |
| 31 |
-- @xyToFmt/a/a.go -- |
| 32 |
@@ -10 +10 @@ |
| 33 |
-func _(x int, y fmt.Stringer) {} //@rename("x", "fmt", xyToFmt) |
| 34 |
+func _(fmt int, y fmt.Stringer) {} //@rename("x", "fmt", xyToFmt) |