You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Word-start matches after /, \, -, . or a tab get no separator bonus, so "domain.cs" outranks "src/main.cs" for "main" #92
Fuzzy.cs:280 only treats _ and a space as separators:
prevSeparator=strCharis'_' or ' ';
So a match that starts a path segment, a kebab-case word or a dotted name gets no matchAfterSeparatorBonus (+10). It scores the same as a match buried in the middle of a word. File paths and command names are what fuzzy finders mostly rank, including TextFilter's Fuzzy filter and Rank, so this is where the ranking goes wrong. Tab is also excluded, even though TextFilter now treats all whitespace as a word separator (TextFilter #112).
The XML doc on matchAfterSeparatorBonus, CLAUDE.md and the README all describe the current _/space behaviour. So this is an enhancement request rather than a bug.
Repro
intS(strings,stringp){Fuzzy.Contains(s,p,outintsc);returnsc;}S("src/main.cs","main")// 8
S("domain.cs","main")// 10 <- mid-word match outranks the path-segment match
S("src_main.cs","main")// 18
S("src-main.cs","main")// 8 (same for "src.main.cs", "src\\main.cs", "src\tmain.cs")
S("get-list","list")// 11
S("getlist","list")// 12 <- outranks the hyphenated word
S("foo-bar","fb")==S("fxxxbxx","fb")// both 5, while "foo_bar" scores 15
Suggested change
Widen the separator test to whitespace plus the common identifier and path separators, for example:
prevSeparator=char.IsWhiteSpace(strChar)||strCharis'_' or '-' or '.' or '/' or '\\';
A small static set would also work. Then update the matchAfterSeparatorBonus XML doc, the README scoring table and CLAUDE.md.
Priority: Medium. It degrades ranking quality for file paths and kebab/dotted names, which is the library's main use case, and TextFilter's Fuzzy filter and Rank inherit it. It matches the documented behaviour, so it is not a bug.
Area / suggested owner:Fuzzy.cs:280 separator test, plus the XML doc, README scoring table and CLAUDE.md
Activity
matt-edmondson commentedon Sep 27, 2026
Triage
Rankinherit it. It matches the documented behaviour, so it is not a bug.Fuzzy.cs:280separator test, plus the XML doc, README scoring table andCLAUDE.mdGenerated by Claude Code