task: Allow Rerun action to override properties of task being reran (#10468)
For example: ``` "alt-t": [ "task::Rerun", { "reevaluate_context": true, "allow_concurrent_runs": true } ], ``` Overriding `allow_concurrent_runs` to `true` by itself should terminate current instance of the task, if there's any. This PR also fixes task deduplication in terminal panel to use expanded label and not the id, which depends on task context. It kinda aligns with how task rerun worked prior to #10341 . That's omitted in the release notes though, as it's not in Preview yet. Release Notes: - `Task::Rerun` action can now override `allow_concurrent_runs` and `use_new_terminal` properties of the task that is being reran.
This commit is contained in:
parent
6e1ba7e936
commit
298e9c9387
4 changed files with 31 additions and 7 deletions
|
@ -38,12 +38,20 @@ impl Spawn {
|
|||
/// Rerun last task
|
||||
#[derive(PartialEq, Clone, Deserialize, Default)]
|
||||
pub struct Rerun {
|
||||
#[serde(default)]
|
||||
/// Controls whether the task context is reevaluated prior to execution of a task.
|
||||
/// If it is not, environment variables such as ZED_COLUMN, ZED_FILE are gonna be the same as in the last execution of a task
|
||||
/// If it is, these variables will be updated to reflect current state of editor at the time task::Rerun is executed.
|
||||
/// default: false
|
||||
#[serde(default)]
|
||||
pub reevaluate_context: bool,
|
||||
/// Overrides `allow_concurrent_runs` property of the task being reran.
|
||||
/// Default: null
|
||||
#[serde(default)]
|
||||
pub allow_concurrent_runs: Option<bool>,
|
||||
/// Overrides `use_new_terminal` property of the task being reran.
|
||||
/// Default: null
|
||||
#[serde(default)]
|
||||
pub use_new_terminal: Option<bool>,
|
||||
}
|
||||
|
||||
impl_actions!(task, [Rerun, Spawn]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue