diff --git a/internal/lsp/source/rename.go b/internal/lsp/source/rename.go index 70489620fd..7164f81d71 100644 --- a/internal/lsp/source/rename.go +++ b/internal/lsp/source/rename.go @@ -78,6 +78,9 @@ func (i *IdentifierInfo) Rename(ctx context.Context, newName string) (map[span.U // Check that the renaming of the identifier is ok. for _, ref := range refs { r.check(ref.obj) + if r.hadConflicts { // one error is enough. + break + } } if r.hadConflicts { return nil, errors.Errorf(r.errors) diff --git a/internal/lsp/testdata/rename/bad/bad_test.go.in b/internal/lsp/testdata/rename/bad/bad_test.go.in new file mode 100644 index 0000000000..e695db14be --- /dev/null +++ b/internal/lsp/testdata/rename/bad/bad_test.go.in @@ -0,0 +1 @@ +package bad \ No newline at end of file