Skip to content

Add query and search options to pane::DeploySearch action#47331

Merged
SomeoneToIgnore merged 12 commits intozed-industries:mainfrom
joelazar:main
Apr 7, 2026
Merged

Add query and search options to pane::DeploySearch action#47331
SomeoneToIgnore merged 12 commits intozed-industries:mainfrom
joelazar:main

Conversation

@joelazar
Copy link
Copy Markdown
Contributor

@joelazar joelazar commented Jan 22, 2026

Extend the DeploySearch action to accept additional parameters for configuring the project search from keymaps:

  • query: prefilled search query string
  • regex: enable regex search mode
  • case_sensitive: match case exactly
  • whole_word: match whole words only
  • include_ignored: search in gitignored files

With this change, the following keymap becomes possible:

["pane::DeploySearch", { "query": "TODO|FIXME|NOTE|BUG|HACK|XXX|WARN", "regex": true }],

Release Notes:

  • Added options to pane::DeploySearch for keymap-driven search initiation

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Jan 22, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @joelazar on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jan 22, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c53aedf433

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/search/src/project_search.rs
@joelazar
Copy link
Copy Markdown
Contributor Author

joelazar commented Feb 2, 2026

@cla-bot check

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 2, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @joelazar on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 2, 2026

The cla-bot has been summoned, and re-checked this pull request!

@joelazar
Copy link
Copy Markdown
Contributor Author

joelazar commented Feb 2, 2026

@cla-bot check

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 2, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @joelazar on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 2, 2026

The cla-bot has been summoned, and re-checked this pull request!

@joelazar
Copy link
Copy Markdown
Contributor Author

joelazar commented Feb 2, 2026

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Feb 2, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Feb 2, 2026

The cla-bot has been summoned, and re-checked this pull request!

Copilot AI review requested due to automatic review settings February 8, 2026 09:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Extends the pane::DeploySearch action so keymap bindings can preconfigure the Project Search UI (prefilled query + common search toggles like regex/case-sensitive/whole-word/include-ignored).

Changes:

  • Added query, regex, case_sensitive, whole_word, and include_ignored fields to workspace::DeploySearch.
  • Updated ProjectSearchView::existing_or_new_search to apply these options when deploying/opening project search.
  • Switched the tab bar “Search Project” menu action to use DeploySearch::find() instead of an inline struct literal.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
crates/workspace/src/pane.rs Extends DeploySearch action schema/fields and updates the “Search Project” action construction.
crates/search/src/project_search.rs Applies new DeploySearch parameters to project search view state during deploy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/search/src/project_search.rs
Comment thread crates/search/src/project_search.rs Outdated
Comment thread crates/workspace/src/pane.rs Outdated
@SomeoneToIgnore SomeoneToIgnore self-assigned this Mar 24, 2026
Copy link
Copy Markdown
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.

Sorry for the late review: looks nice overall, a few small changes and we can merge it.

Comment thread crates/search/src/project_search.rs Outdated
Comment thread crates/search/src/project_search.rs Outdated
Comment thread crates/workspace/src/pane.rs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/search/src/project_search.rs
Comment thread crates/search/src/project_search.rs
Comment thread crates/search/src/project_search.rs Outdated
Copy link
Copy Markdown
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, this looks better but after playing with the test I think there are 2 more things to cover better:

  • smart case mode

with it enabled

cx.update_global::<SettingsStore, _>(|store, cx| {
    store.update_default_settings(cx, |settings| {
        settings.editor.use_smartcase_search = Some(true);
    });
});

we seem to always react to the editor listener and toggle the case search off, even if the new action tries to set it on.
This does not look necessarily wrong to me, but we should have a test on it.

  • it seems that consequent search deploys with different parameters do not change a thing?
    For instance, taking the new, test_deploy_search_with_options, scenario in: if we then do cx.dispatch_action(menu::Cancel); and redeploy the search with e.g. onlyregex enabled, won't turn off the rest of the pre-enabled search options.

That does not seem right, does it?

Comment thread crates/workspace/src/pane.rs Outdated
@joelazar joelazar force-pushed the main branch 6 times, most recently from cf01d26 to b36c724 Compare April 3, 2026 17:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joelazar
Copy link
Copy Markdown
Contributor Author

joelazar commented Apr 4, 2026

Thank you, this looks better but after playing with the test I think there are 2 more things to cover better:

* `smart case mode`

with it enabled

cx.update_global::<SettingsStore, _>(|store, cx| {
    store.update_default_settings(cx, |settings| {
        settings.editor.use_smartcase_search = Some(true);
    });
});

we seem to always react to the editor listener and toggle the case search off, even if the new action tries to set it on. This does not look necessarily wrong to me, but we should have a test on it.

* it seems that consequent search deploys with different parameters do not change a thing?
  For instance, taking the new, `test_deploy_search_with_options`, scenario in: if we then do `cx.dispatch_action(menu::Cancel);` and redeploy the search with e.g. only`regex` enabled, won't turn off the rest of the pre-enabled search options.

That does not seem right, does it?

Thank you very much for another round of review. In this round, I changed the following:

  • Added a test case that covers smart case handling in test_smartcase_overrides_explicit_case_sensitive
  • Regarding your second point, I converted the options fields to Option<bool> now. None leaves the current setting unchanged, Some(true) turns it on, and Some(false) turns it off. I also extended the test_deploy_search_applies_and_resets_options test case, which covers these scenarios as well now.

Furthermore:

  • Addressed all path-related comments
  • Calling DeploySearch::default() consistently everywhere and removed the impl DeploySearch

Let me know if there is anything else which might be missing from this. 🙏

Copy link
Copy Markdown
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.

Looks great, thank you for improving the usability!

I have two concerns left, but those can be followed-up later when we get more feedback:

  • the feature is not really visible; we usually try and specify the parameters in the default keybindings like
    // "alt-cmd-o": ["projects::OpenRecent", {"create_new_window": true }],
    "alt-cmd-o": ["projects::OpenRecent", { "create_new_window": false }],
    "ctrl-r": ["projects::OpenRecent", { "create_new_window": false }],
    "ctrl-cmd-o": ["projects::OpenRemote", { "from_existing_connection": false, "create_new_window": false }],
    "ctrl-cmd-shift-o": ["projects::OpenRemote", { "from_existing_connection": true, "create_new_window": false }],

and maybe this is what we could do here

  • replace_enabled being non-optional seems not consistent, but changing it into Option might break existing set-ups, so not sure what to do there right away

@SomeoneToIgnore SomeoneToIgnore merged commit 4386766 into zed-industries:main Apr 7, 2026
30 checks passed
MasoudAlali pushed a commit to MasoudAlali/zed-ide that referenced this pull request Apr 7, 2026
…ries#47331)

Extend the DeploySearch action to accept additional parameters for
configuring the project search from keymaps:

- query: prefilled search query string
- regex: enable regex search mode
- case_sensitive: match case exactly
- whole_word: match whole words only
- include_ignored: search in gitignored files

With this change, the following keymap becomes possible:

```json
["pane::DeploySearch", { "query": "TODO|FIXME|NOTE|BUG|HACK|XXX|WARN", "regex": true }],
```

Release Notes:

- Added options to `pane::DeploySearch` for keymap-driven search
initiation
@diogox
Copy link
Copy Markdown

diogox commented Apr 9, 2026

Does this apply to workspace::NewSearch?

piper-of-dawn pushed a commit to piper-of-dawn/zed that referenced this pull request Apr 25, 2026
…ries#47331)

Extend the DeploySearch action to accept additional parameters for
configuring the project search from keymaps:

- query: prefilled search query string
- regex: enable regex search mode
- case_sensitive: match case exactly
- whole_word: match whole words only
- include_ignored: search in gitignored files

With this change, the following keymap becomes possible:

```json
["pane::DeploySearch", { "query": "TODO|FIXME|NOTE|BUG|HACK|XXX|WARN", "regex": true }],
```

Release Notes:

- Added options to `pane::DeploySearch` for keymap-driven search
initiation
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 first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants