| 1 |
This test checks that rename fails in the presence of errors. |
| 2 |
|
| 3 |
-- go.mod -- |
| 4 |
module golang.org/lsptests/bad |
| 5 |
|
| 6 |
go 1.18 |
| 7 |
|
| 8 |
-- bad.go -- |
| 9 |
package bad |
| 10 |
|
| 11 |
type myStruct struct { |
| 12 |
} |
| 13 |
|
| 14 |
func (s *myStruct) sFunc() bool { //@renameerr("sFunc", "rFunc", "not possible because \"bad.go\" in \"golang.org/lsptests/bad\" has errors") |
| 15 |
return s.Bad //@diag("Bad", re"no field or method") |
| 16 |
} |
| 17 |
|
| 18 |
-- bad_test.go -- |
| 19 |
package bad |
| 20 |
|
| 21 |
|
| 22 |
-- badsyntax/badsyntax.go -- |
| 23 |
package badsyntax |
| 24 |
|
| 25 |
type S struct {} |
| 26 |
|
| 27 |
func (s *S) sFunc() bool { //@renameerr("sFunc", "rFunc", "not possible because \"badsyntax.go\" in \"golang.org/lsptests/bad/badsyntax\" has errors") |
| 28 |
# //@diag("#", re"expected statement, found") |
| 29 |
} |