x/tools/gopls: DocumentSymbol returns incorrect selectionRange #73521
Labels
BugReport
Issues describing a possible bug in the Go implementation.
Documentation
Issues describing a change to documentation.
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
Go version
go version go1.24.2 linux/amd64
Output of
go env
in your module/workspace:What did you do?
This issue is about gopls. The selectionRange attribute of a symbol coincides with range, but it shouldn't. This means it becomes impossible to reference a symbol (e.g., find references to it programatically) from the info retrieved through the language server, as one would need the selectionRange for it (specifically, the character).
What did you see happen?
For example, for something like this
the
document_symbol
request will return a selectionRange with starting character 0.What did you expect to see?
It should return the starting character 5 in the selection range.
The text was updated successfully, but these errors were encountered: