x/tools/gopls: "Go to definition" goes to the object after the period when the cursor is at the end of a variable #47408
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Describe the bug
The Go to Definition (F12) will go to the definition of the object after the period when the cursor is located at the end of the first variable. Same thing happens when the word itself is selected.
Steps to reproduce the behavior:
Paste the following:
Put your cursor before the "." (period), after the second instance of
myVariable
.Press F12. You will end up at
MyField
, I would have expected to go tomyVariable
.Same thing happens if you double click on the second instance of
myVariable
, then F12.Same thing happens if you Right click at the end of the variable then Go to definition.
The text was updated successfully, but these errors were encountered: