What's wrong
The fix for #106 turns a glob that won't parse (such as file[0-) into a match-anything glob (TextFilter/TextFilter.cs, ~lines 415-423). That works for plain and required (+) tokens: the token is effectively ignored while the user finishes typing.
For an excluded token (-, ! or ^ prefix, checked at ~line 337), match-anything means "exclude everything". So the list empties while the user is still typing -readme[a-z]. The #106 regression test (GlobWithAHalfTypedRangeDoesNotThrow) only covers unprefixed tokens.
Repro
TextFilter.Filter(["file1.txt", "file2.txt", "readme.md"], f) with the default Glob / ByWordAny options:
'-readme[a-' -> [] <- expected all three items
'+file[0-' -> [file1.txt, file2.txt, readme.md]
'file[0-' -> [file1.txt, file2.txt, readme.md]
Reproduced against the current main build.
Why it matters
This is the type-ahead scenario #106 was fixed for. With an exclusion, every keystroke between [ and ] blanks the whole list, then it reappears when the range is closed. The flicker makes exclusion filters look broken.
Suggested fix
Have ResolveGlob return null (or a sentinel) for a token that won't parse, and skip such tokens in the optional, required and excluded checks alike. Alternatively, use a match-nothing fallback for excluded tokens.
Acceptance criteria
What's wrong
The fix for #106 turns a glob that won't parse (such as
file[0-) into a match-anything glob (TextFilter/TextFilter.cs, ~lines 415-423). That works for plain and required (+) tokens: the token is effectively ignored while the user finishes typing.For an excluded token (
-,!or^prefix, checked at ~line 337), match-anything means "exclude everything". So the list empties while the user is still typing-readme[a-z]. The #106 regression test (GlobWithAHalfTypedRangeDoesNotThrow) only covers unprefixed tokens.Repro
TextFilter.Filter(["file1.txt", "file2.txt", "readme.md"], f)with the default Glob / ByWordAny options:Reproduced against the current
mainbuild.Why it matters
This is the type-ahead scenario #106 was fixed for. With an exclusion, every keystroke between
[and]blanks the whole list, then it reappears when the range is closed. The flicker makes exclusion filters look broken.Suggested fix
Have
ResolveGlobreturnnull(or a sentinel) for a token that won't parse, and skip such tokens in the optional, required and excluded checks alike. Alternatively, use a match-nothing fallback for excluded tokens.Acceptance criteria
-readme[a-returns all three items in the repro.-file[0-row (and!/^variants) to the Glob filter throws IndexOutOfRangeException on half-typed ranges like "file[0-", crashing type-ahead filters #106 regression test.