x/tools/gopls: support renaming an embedded field at its declaration #45199
Labels
FeatureRequest
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Follow up from #43616 (comment) (cc @mdempsky)
Relatively frequently I find myself in the following situation:
With the cursor on the embedded
T
inS
.I then initiate a rename, but get:
The fix in this instance is to jump to the definition of😄
T
, rename, then jump back. But obviouslygopls
can do thatTo my mind this case is distinct from the case of selector expressions mentioned in #43616 (comment): such a situation is more ambiguous because we can't be sure the user knows the field in question is an embedded field.
But in this case our cursor is on the declaration of the embedded field, so there can be no ambiguity.
cc @findleyr
FYI @leitzler
The text was updated successfully, but these errors were encountered: