Open myitcv opened 4 years ago
This is due to how the fuzzy scoring works. Non-initial, non-connected letters ("n" and "f" in "Prnf") get a big penalty. In your example, the penalized "n" and "f" outweigh the "Pr" causing the candidate not to match. Normally the user is not filtering using in-between letters.
"Printf" in particular is unlucky since "f" represents another word "Formatted", but "f" is lowercase so the fuzzy matcher doesn't know it is an important letter the user might want to use to filter results. If it was named "PrintF", for example, then it would work better.
This is due to how the fuzzy scoring works.
Can you provide a bit of background on the thought process? Because it's somewhat strange (to me at least) that this doesn't match at all: a lower score, maybe, but no match?
My perspective, FWIW, is shaped by other fuzzy finders, like fzf
Unfortunately I don't have any more background because I didn't write the gopls fuzzy matcher.
This is the check that counts a match with two short, non-initial matches as poor.
Our fuzzy matcher is adapted from a library used internally at Google, and it handles multiple languages, which may account for some of the cases that don't work as expected for Go. I don't think we will prioritize significant modifications / improvements to this library in the near future, so if anyone has a suggestion for an alternative well-supported fuzzy matching package, we can use that (much like we did for go-diff
). Otherwise, we can continue to use this package with small bug fixes as needed, until we have time to prioritize this.
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?
What did you expect to see?
Triggering completion at the end of
fmt.Prnf
to return a single result,fmt.Printf
What did you see instead?
Triggering completion at the end of
fmt.Prnf
did not return any results.See the following
gopls
log: bad.logcc @stamblerre @muirdm
FYI @leitzler