Unreviewed changes
6 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: gopls/internal/golang/rename.go
Insertions: 0, Deletions: 10.
@@ -1681,13 +1681,3 @@
}
return diff.Edit{Start: startOffset, End: endOffset, New: new}, nil
}
-
-// enclosingFile returns the CompiledGoFile of pkg that contains the specified position.
-func enclosingFile(pkg *cache.Package, pos token.Pos) (*parsego.File, bool) {
- for _, pgf := range pkg.CompiledGoFiles() {
- if pgf.File.FileStart <= pos && pos <= pgf.File.FileEnd {
- return pgf, true
- }
- }
- return nil, false
-}
```
Change information
Commit message:
gopls/internal/golang: allow rename of embedded fields at declaration
We previously disabled renaming embedded fields (golang/go#43616).
This makes sense when the cursor is at a use of the embedded field,
but if the cursor is at the declaration of the embedded field within the
struct type declaration we should allow this operation.
Fixes golang/go#45199
Change-Id: I1af78205d5f2c865400bea0df55899588c1e8c56
Files:
- M gopls/internal/golang/rename.go
- M gopls/internal/test/marker/testdata/rename/embed.txt
- M gopls/internal/test/marker/testdata/rename/issue43616.txt
Change size: M
Delta: 3 files changed, 101 insertions(+), 55 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Alan Donovan
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI