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:
parent
bf4478703b
commit
ba4d4c8e1c
4 changed files with 35 additions and 28 deletions
25
crates/assistant/src/ambient_context/recent_buffers.rs
Normal file
25
crates/assistant/src/ambient_context/recent_buffers.rs
Normal 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,
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue