mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-25 14:44:28 +00:00
Document task filtering based on variables (#38642)
Closes: https://github.com/zed-industries/zed/issues/38525 Documentation follow up for #38614 Task filtering behavior is currently undocumented. Release Notes: - N/A --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
This commit is contained in:
parent
831de8e48f
commit
52c467ea3a
1 changed files with 21 additions and 0 deletions
|
|
@ -132,6 +132,27 @@ Or explicitly include escaped quotes like so:
|
|||
}
|
||||
```
|
||||
|
||||
### Task filtering based on variables
|
||||
|
||||
Task definitions with variables which are not present at the moment the task list is determined are filtered out.
|
||||
For example, the following task will appear in the spawn modal only if there is a text selection:
|
||||
|
||||
```json
|
||||
{
|
||||
"label": "selected text",
|
||||
"command": "echo \"$ZED_SELECTED_TEXT\""
|
||||
}
|
||||
```
|
||||
|
||||
Set default values to such variables to have such tasks always displayed:
|
||||
|
||||
```json
|
||||
{
|
||||
"label": "selected text with default",
|
||||
"command": "echo \"${ZED_SELECTED_TEXT:no text selected}\""
|
||||
}
|
||||
```
|
||||
|
||||
## Oneshot tasks
|
||||
|
||||
The same task modal opened via `task: spawn` supports arbitrary bash-like command execution: type a command inside the modal text field, and use `opt-enter` to spawn it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue