Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer project (worktree) tasks to language/global tasks in task::Spawn #21706

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

IViktorov
Copy link
Contributor

Inventory::list_tasks() in project crate now is ordered by task types. Worktree tasks comes first, language tasks second and global tasks last.
That leads to spawn_task_with_name() from task_ui crate will find worktree task first, so it's possible to override global tasks at project level.

  • Inventory::templates_from_settings() splitted to Inventory::global_templates_from_settings() and Inventory::worktree_templates_from_settings().

  • In tests function list_tasks() renamed to list_tasks_sorted_by_last_used(), because it call's Inventory::used_and_current_resolved_tasks(). Also added list_tasks() which calls Inventory::list_tasks().

Closes #20987

Release Notes:

  • Fix task::Spawn to search for task name in project tasks first.

Copy link

cla-bot bot commented Dec 8, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Викторов Иван Михайлович.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

* Inventory::templates_from_settings() splitted to
  Inventory::global_templates_from_settings()
  and Inventory::worktree_templates_from_settings().
* list_tasks() now first collect tasks from worktree, second from
  language and lastly collects global tasks.
* Tests for Inventory::list_tasks().
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 8, 2024
@maxdeviant maxdeviant changed the title Prefer project (worktree) tasks to language/global tasks in task::Spawn (#20987) Prefer project (worktree) tasks to language/global tasks in task::Spawn Dec 9, 2024
@mikayla-maki
Copy link
Member

This seems like a pretty solid change. cc: @SomeoneToIgnore, you've been working on this recently right? What do you think :)

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!

@SomeoneToIgnore SomeoneToIgnore merged commit cbc2265 into zed-industries:main Dec 14, 2024
13 checks passed
SomeoneToIgnore added a commit that referenced this pull request Dec 14, 2024
#21706 was merged after
#22004 and the CI missed that.

Release Notes:

- N/A
lino-levan pushed a commit to the-code-editor-company/editor that referenced this pull request Dec 16, 2024
…wn (zed-industries#21706)

`Inventory::list_tasks()` in `project` crate now is ordered by task
types. Worktree tasks comes first, language tasks second and global
tasks last.
That leads to `spawn_task_with_name()` from `task_ui` crate will find
worktree task first, so it's possible to override global tasks at
project level.

* `Inventory::templates_from_settings()` splitted to
`Inventory::global_templates_from_settings()` and
`Inventory::worktree_templates_from_settings()`.

* In tests function `list_tasks()` renamed to
`list_tasks_sorted_by_last_used()`, because it call's
`Inventory::used_and_current_resolved_tasks()`. Also added
`list_tasks()` which calls `Inventory::list_tasks()`.

Closes zed-industries#20987 

Release Notes:

- Fix task::Spawn to search for task name in project tasks first.
lino-levan pushed a commit to the-code-editor-company/editor that referenced this pull request Dec 16, 2024
zed-industries#21706 was merged after
zed-industries#22004 and the CI missed that.

Release Notes:

- N/A
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.

Prefer project tasks over global tasks in keymappings ("task::Spawn").
3 participants