Stop a half-typed excluded glob token hiding every item - #111
Merged
matt-edmondson merged 2 commits intoSep 26, 2026
Merged
Conversation
A glob token that cannot be parsed (such as "file[0-") became a
match-anything glob. That ignores plain and required tokens, but for an
excluded token ("-readme[a-") it excluded everything, so the list
emptied while the user typed a range. ResolveGlob now caches an
unparseable token as null. Excluded tokens skip it; the other checks
still treat it as matching anything.
Fixes #110
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Hhb8knddbu4LRSs2uu9jR
Resolve the conflict in TextFilterTests.cs by keeping both the excluded half-typed glob tests from this branch and the ByWordAll blank-text tests from #109. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZB6C9rAp2hA5WQDcw2NDp
|
matt-edmondson
deleted the
claude/textfilter-110-excluded-halftyped-glob
branch
September 26, 2026 11:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #110
Problem
The fix for #106 turned a glob token that won't parse (such as
file[0-) into a match-anything glob. For plain and+tokens, that makes the token neutral. For an excluded token (-,!or^), "match anything" meant "exclude everything". SoFilter(["file1.txt", "file2.txt", "readme.md"], "-readme[a-")returned[]on every keystroke until the range was closed.Fix
ResolveGlobnow returnsnullfor a token that won't parse. It caches thatnullso the parse is still not retried on every keystroke.GlobCacheis nowConcurrentDictionary<string, Glob?>.DoesMatchGlobskips anullglob, so the token excludes nothing.AnyTokenMatchesGlobFilterandAllTokensMatchGlobFiltertreatnullas matching anything, so optional and required tokens behave as before.GlobMatchAnythinghelper is removed, and theDoesMatchGlobremarks describe the new rule.Tests
GlobWithAHalfTypedRangeDoesNotThrow(the Glob filter throws IndexOutOfRangeException on half-typed ranges like "file[0-", crashing type-ahead filters #106 test) gains-file[0-,!file[0-and^file[0-rows.ExcludedGlobWithAHalfTypedRangeExcludesNothingis new. It runs the repro from the issue with each exclusion prefix, case-sensitive and case-insensitive.With the fix reverted, those 6 cases fail. With it, the full suite passes (101/101,
dotnet test -c Release). The library also builds cleanly in Release for all of its target frameworks.This PR is independent of #109; both branch from
main. They touch different methods inTextFilter.cs.🤖 Generated with Claude Code
https://claude.ai/code/session_012Hhb8knddbu4LRSs2uu9jR
Generated by Claude Code