Repository navigation
Match NFD text with NFC glob and regex filters, and the reverse [patch] - #199
matt-edmondson wants to merge 4 commits into
Conversation
Glob and regex filters compared raw strings, while fuzzy compares in Unicode normal form C, so a macOS-style decomposed name vanished in Glob and Regex mode but showed up in Fuzzy. Both sides are now brought to NFC before glob and regex matching; NFC text is returned as is, and the glob filter is normalized before its cache key is taken. Fixes #197 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3WKJyQMZaWCcyzKVK
…patch] The README API test required every overload's same-named parameter to carry the documented default. The binary-compatibility overloads from #166 have no defaults by design, so main has been red since #178. They are marked [EditorBrowsable(Never)] and are not what the README documents, so the default check now skips them. A wrong default on a visible overload still fails. Fixes #183 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW6FzBtSrY5LKUuDYce (cherry picked from commit 9328e00)
|
CI on 0143ded failed A fix already exists on open branch Generated by Claude Code |
|
The SonarCloud quality gate (Maintainability C on new code) isn't caused by this PR. SonarCloud last analysed What clears it is a green Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5jpiuVuBRXSgitSY1
# Conflicts: # TextFilter.Test/TextFilterTests.cs
|



Fixes #197
What changed
Fuzzy filtering compares in Unicode normal form C because it goes through ktsu.FuzzySearch, but glob and regex filtering compared raw strings. A name stored decomposed (NFD), the way macOS writes file names, disappeared in Glob and Regex mode and reappeared in Fuzzy mode.
ToNormalizationFormChelper returns a string that is already NFC unchanged, so ASCII and NFC text cost no extra allocation. A string that can't be normalized, such as one with a lone surrogate, is matched as it is instead of throwing.ResolveGlobbefore the cache key is taken, so the NFC and NFD spellings of one filter share a cache entry. The text token is normalized inIsGlobMatch. Normalization happens beforeExpandGlobClasses, soCaf[éè]*works with either spelling inside the class. It also covers the publicAnyTokenMatchesGlobFilter/AllTokensMatchGlobFilterentry points.DoesMatchRegex.Tests
*,?and[...], under both case sensitivities and the default match option.Filterover mixed NFC/NFD items returns the same items for Glob, Regex and Fuzzy.With normalization stubbed out, 13 of the new cases fail. With the fix, every new test passes.
dotnet testgives 282/283. The one failure,ReadmeTests.EveryMethodInTheReadmeApiReferenceExistsWithItsDocumentedDefaults, also fails onmain(5f420d9) without this change. Branchfix/183-readme-api-test-compat-overloadsappears to cover it.Generated by Claude Code