x/tools/gopls: WorkspaceSymbol returns strange results in strange order #60027
Labels
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?
Then perform a symbol search for
rune
, in an attempt to locate the symbolmvdan.cc/sh/v3/syntax.Parser.rune
.The results are ordered as follows (best match first):
I've included ~20% of the results returned. Notice that I performed this search when in the context of the
syntax
package.The one row (in the first 20% of results) where there is a full match on the last element (i.e. the symbol itself), the row I actually want, is at position 11. There are less good matches in the first 10 rows, some of which are in test packages. None of those first 10 are in the package of interest (given the current file cursor position in
syntax/parser.go
).This problem is related to #37237. That said, #37236 (comment) makes clear that there are currently no plans to implement such an approach.
Therefore I think the current matching logic should be better here.
I've not looked at this part of the code recently, but it seems like the scoring of perfect matches for the symbol itself could/should score much higher?
What did you expect to see?
mvdan.cc/sh/v3/syntax.Parser.rune
returned as the first result.What did you see instead?
As above.
The text was updated successfully, but these errors were encountered: