Allow an initial prompt to be associated with inline assist (#14816)
Release Notes:
- Added the ability to create custom inline assist bindings that
pre-fill a prompt from your keymap, e.g.:
```json
[
{
"context": "Editor && mode == full",
"bindings": {
"ctrl-shift-enter": [
"assistant::InlineAssist",
{ "prompt": "Build a snake game" }
]
}
}
]
```
---------
Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan
parent
d61eaea4b9
commit
4c7f1032a4
@@ -142,14 +142,14 @@ impl Render for QuickActionBar {
|
||||
"toggle inline assistant",
|
||||
IconName::MagicWand,
|
||||
false,
|
||||
Box::new(InlineAssist),
|
||||
Box::new(InlineAssist::default()),
|
||||
"Inline Assist",
|
||||
{
|
||||
let workspace = self.workspace.clone();
|
||||
move |_, cx| {
|
||||
if let Some(workspace) = workspace.upgrade() {
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
AssistantPanel::inline_assist(workspace, &InlineAssist, cx);
|
||||
AssistantPanel::inline_assist(workspace, &InlineAssist::default(), cx);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user