assistant: Restructure ambient context in preparation for adding more (#11822)

This PR restructures the ambient context in the `assistant` crate to
make it more amenable to adding more kinds of ambient context.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-05-14 17:03:39 -04:00 committed by GitHub
parent bf4478703b
commit ba4d4c8e1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 28 deletions

View file

@ -0,0 +1,25 @@
use gpui::{Subscription, Task, WeakModel};
use language::Buffer;
pub struct RecentBuffersContext {
pub enabled: bool,
pub buffers: Vec<RecentBuffer>,
pub message: String,
pub pending_message: Option<Task<()>>,
}
pub struct RecentBuffer {
pub buffer: WeakModel<Buffer>,
pub _subscription: Subscription,
}
impl Default for RecentBuffersContext {
fn default() -> Self {
Self {
enabled: true,
buffers: Vec::new(),
message: String::new(),
pending_message: None,
}
}
}