assistant2: Add create buffer tool (#11219)

This PR adds a new tool to the `assistant2` crate that allows the
assistant to create a new buffer with some content.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Marshall Bowers 2024-04-30 13:43:25 -04:00 committed by GitHub
parent ada2791fa3
commit d01428e69c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 173 additions and 27 deletions

View file

@ -1,3 +1,4 @@
use crate::Empty;
use crate::{
seal::Sealed, AnyElement, AnyModel, AnyWeakModel, AppContext, Bounds, ContentMask, Element,
ElementId, Entity, EntityId, Flatten, FocusHandle, FocusableView, GlobalElementId, IntoElement,
@ -457,3 +458,12 @@ mod any_view {
view.update(cx, |view, cx| view.render(cx).into_any_element())
}
}
/// A view that renders nothing
pub struct EmptyView;
impl Render for EmptyView {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
Empty
}
}