Skip to content

search: Support brace syntax in project search include/exclude patterns #47860

Merged
SomeoneToIgnore merged 2 commits intozed-industries:mainfrom
eureka928:fix-glob-brace-syntax-project-search
Feb 12, 2026
Merged

search: Support brace syntax in project search include/exclude patterns #47860
SomeoneToIgnore merged 2 commits intozed-industries:mainfrom
eureka928:fix-glob-brace-syntax-project-search

Conversation

@eureka928
Copy link
Contributor

@eureka928 eureka928 commented Jan 28, 2026

Closes #47527

Summary

The include/exclude filters in Project Search now support standard glob brace syntax like {a,b}.

Before: crates/{search,project}/**/file.rs would error with "unclosed alternate group"

After: Pattern correctly matches files in both crates/search/ and crates/project/

Implementation

Added split_glob_patterns() function that splits by comma only when not inside braces, preserving the {a,b} syntax that globset natively supports.

Release Notes:

  • Added support for {a,b} glob syntax in project search include/exclude filters

Here is the screenshot of before and after.

Before:
{0233D673-E876-4CFC-81BC-E0DE778CA382}

After:
{321F7C80-13A0-4478-BCE9-530F1824A9E2}

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 28, 2026
@eureka928 eureka928 force-pushed the fix-glob-brace-syntax-project-search branch from 0dc6ec3 to 86fc3c9 Compare January 28, 2026 14:25
@eureka928
Copy link
Contributor Author

Hi @MrSubidubi how are you today?
Could you review this PR?
I think this is fair PR to fix a critical issue


for (index, char) in text.char_indices() {
match char {
'{' => brace_depth += 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, escaping should be taken into account, for {, } and ,

See bash documentation:

A ‘{’ or ‘,’ may be quoted with a backslash to prevent its being considered part of a brace expression.

Source: https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And so escaping of \ too ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated, please review again

@eureka928 eureka928 requested a review from KuSh January 28, 2026 22:29
@eureka928

This comment was marked as spam.

Copy link
Contributor

@KuSh KuSh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eureka928
Copy link
Contributor Author

LGTM!

Thank you, is this good to merge?

@KuSh
Copy link
Contributor

KuSh commented Feb 5, 2026

LGTM!

Thank you, is this good to merge?

I'm not part of the project. You'll need an approve from a reviewer

@SomeoneToIgnore SomeoneToIgnore self-assigned this Feb 12, 2026
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you a lot both of you for the cooperation, this looks very finished now, happy to merge.

@SomeoneToIgnore SomeoneToIgnore merged commit 015913a into zed-industries:main Feb 12, 2026
27 checks passed
@eureka928
Copy link
Contributor Author

Thank you for merging, @SomeoneToIgnore
Would you assign me another issue if you don't mind?
Happy to contribute as I am the happy user of Zed IDE

@SomeoneToIgnore
Copy link
Contributor

Feel free to work on anything you want to change, without the assignment, that's also perfectly fine.

morgankrey added a commit that referenced this pull request Feb 19, 2026
Auto-applied queued documentation suggestions from:
- PR #48908
- PR #48909
- PR #48910
- PR #48912
- PR #48930
- PR #44794
- PR #48763
- PR #45073
- PR #48495
- PR #49374
- PR #49139
- PR #48780
- PR #48619
- PR #48978
- PR #48962
- PR #48988
- PR #47860
- PR #49015
- PR #47095
- PR #47475
- PR #48542
- PR #46766
- PR #47754
- PR #48807
- PR #44506
- PR #49051
- PR #49069
- PR #48842
- PR #48851
- PR #48736
- PR #47673
- PR #49094
- PR #49098
- PR #49622

Generated with script/docs-suggest-publish for human review in draft PR.
morgankrey added a commit that referenced this pull request Feb 25, 2026
Auto-applied queued documentation suggestions from:
- PR #48908
- PR #48909
- PR #48910
- PR #48912
- PR #48930
- PR #44794
- PR #48763
- PR #45073
- PR #48495
- PR #49374
- PR #49139
- PR #48780
- PR #48619
- PR #48978
- PR #48962
- PR #48988
- PR #47860
- PR #49015
- PR #47095
- PR #47475
- PR #48542
- PR #46766
- PR #47754
- PR #48807
- PR #44506
- PR #49051
- PR #49069
- PR #48842
- PR #48851
- PR #48736
- PR #47673
- PR #49094
- PR #49098
- PR #49622
- PR #49554
- PR #49710
- PR #49716
- PR #49732
- PR #49788
- PR #49876
- PR #49902
- PR #49910
- PR #49390
- PR #50027

Generated with script/docs-suggest-publish for human review in draft PR.
morgankrey added a commit that referenced this pull request Feb 25, 2026
Auto-applied documentation from:
- PR #48619: agent single_file_review default change
- PR #48978: enriched symbol names in outline
- PR #49015: audio device selection for collab
- PR #47095: MCP error handling
- PR #47475: OpenRouter default model requirement

Skipped (already documented):
- PR #49139, PR #48780, PR #48988, PR #47860
morgankrey added a commit that referenced this pull request Feb 25, 2026
Auto-applied queued documentation suggestions from:
- PR #48908
- PR #48909
- PR #48910
- PR #48912
- PR #48930
- PR #44794
- PR #48763
- PR #45073
- PR #48495
- PR #49374
- PR #49139
- PR #48780
- PR #48619
- PR #48978
- PR #48962
- PR #48988
- PR #47860
- PR #49015
- PR #47095
- PR #47475
- PR #48542
- PR #46766
- PR #47754
- PR #48807
- PR #44506
- PR #49051
- PR #49069
- PR #48842
- PR #48851
- PR #48736
- PR #47673
- PR #49094
- PR #49098
- PR #49622
- PR #49554
- PR #49710
- PR #49716
- PR #49732
- PR #49788
- PR #49876
- PR #49902
- PR #49910
- PR #49390
- PR #50027

Generated with script/docs-suggest-publish for human review in draft PR.
morgankrey added a commit that referenced this pull request Feb 25, 2026
Auto-applied documentation from:
- PR #48619: agent single_file_review default change
- PR #48978: enriched symbol names in outline
- PR #49015: audio device selection for collab
- PR #47095: MCP error handling
- PR #47475: OpenRouter default model requirement

Skipped (already documented):
- PR #49139, PR #48780, PR #48988, PR #47860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't use {a,b} standard glob syntax in include/exclude files in Project Search

3 participants