fix: treat unrecognized @-prefixed text as regular filter in test explorer#307555
Merged
connor4312 merged 1 commit intoApr 3, 2026
Merged
Conversation
…lorer When typing text like "@smoke" in the test explorer filter, the @-prefix was consumed by the tag regex but did not match any known filter term or tag syntax. This caused the text to silently disappear from the filter, making it impossible to search for tests with "@" in their names. Now, @-prefixed text that is neither a known filter term (@failed, @doc, etc.) nor a tag (@ctrlId:tagId) is preserved as regular glob filter text. Closes microsoft#159708
TylerLeonhardt
approved these changes
Apr 3, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
When typing text containing
@in the test explorer filter (e.g.,@smoketo find a test named "my @smoke test"), the@-prefixed text is consumed by the tag/filter-term regex but doesn't match any known filter term (@failed,@doc, etc.) or tag syntax (@ctrlId:tagId). This causes the text to silently disappear from the glob filter, making it impossible to search for tests with@in their names.For example, typing
@smokein the filter produces an empty glob list instead of filtering for tests matching "@smoke".Closes #159708
What is the new behavior?
Unrecognized
@-prefixed text that is neither a known filter term nor a tag is now preserved as regular glob filter text. This means:@smoke→ filters for tests matching "@smoke" (previously produced no filter)@smoke @doc hello→ filters for "@smoke hello" with the@docterm active (previously only@docwas active)!@smoke→ excludes tests matching "@smoke" (previously had no effect)Known filter terms (
@failed,@doc,@executed,@openedFiles,@hidden) and tag syntax (@ctrlId:tagId) continue to work exactly as before.Additional context
The fix adds tracking variables (
isFilterTerm,isTag) to determine whether a regex match was actually consumed as a special filter construct. If not, the loopcontinues without advancinglastIndex, so the@-prefixed text naturally flows intoglobText.Three test cases are added covering the plain, mixed, and negated scenarios.