Documentation
¶
Overview ¶
Package fuzzy ranks completion candidates against a typed pattern. The matcher is the subsequence kind every editor's file picker uses: the pattern's characters must appear in the candidate in order, and the score prefers matches at path-segment and word starts, consecutive runs, and short candidates, so "sre" finds "screen/render.go" ahead of an accidental scatter of the same letters. Matching is case-insensitive; an exact-case hit earns a small bonus.
Everything here is pure and deterministic: same inputs, same order, no clock, no randomness. Ties in Rank break by shorter candidate, then lexically, so the menu never reshuffles between keystrokes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Rank ¶
Rank returns the best matches for pattern among candidates, best first, at most limit long. An optional bonus hook adds candidate-specific score (recent picks, pinned entries); nil adds nothing. Order is deterministic: score descending, then shorter candidate, then lexical.
Types ¶
This section is empty.