Add query and search options to pane::DeploySearch action#47331
Add query and search options to pane::DeploySearch action#47331SomeoneToIgnore merged 12 commits intozed-industries:mainfrom
Conversation
|
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'. |
There was a problem hiding this comment.
💡 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".
|
@cla-bot check |
|
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'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
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'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
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, andinclude_ignoredfields toworkspace::DeploySearch. - Updated
ProjectSearchView::existing_or_new_searchto 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.
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Sorry for the late review: looks nice overall, a few small changes and we can merge it.
There was a problem hiding this comment.
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.
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
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 docx.dispatch_action(menu::Cancel);and redeploy the search with e.g. onlyregexenabled, won't turn off the rest of the pre-enabled search options.
That does not seem right, does it?
cf01d26 to
b36c724
Compare
There was a problem hiding this comment.
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.
Thank you very much for another round of review. In this round, I changed the following:
Furthermore:
Let me know if there is anything else which might be missing from this. 🙏 |
- Change regex, case_sensitive, whole_word, and include_ignored fields to Option<bool> to distinguish between "not specified" and "explicitly set to false" - Update deploy_search to apply only explicitly provided options, preserving existing search settings when options are unspecified - Consolidate tests into one that verifies applying new options, preserving unspecified ones, and explicitly resetting options
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
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
zed/assets/keymaps/default-macos.json
Lines 669 to 673 in d3a9d5f
and maybe this is what we could do here
replace_enabledbeing non-optional seems not consistent, but changing it intoOptionmight break existing set-ups, so not sure what to do there right away
…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
|
Does this apply to |
…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
Extend the DeploySearch action to accept additional parameters for configuring the project search from keymaps:
With this change, the following keymap becomes possible:
Release Notes:
pane::DeploySearchfor keymap-driven search initiation