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
|
@ -1,3 +1,4 @@
|
|||
use crate::ambient_context::{AmbientContext, RecentBuffer};
|
||||
use crate::{
|
||||
assistant_settings::{AssistantDockPosition, AssistantSettings, ZedDotDevModel},
|
||||
codegen::{self, Codegen, CodegenKind},
|
||||
|
@ -1367,34 +1368,6 @@ pub struct Conversation {
|
|||
telemetry: Option<Arc<Telemetry>>,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct AmbientContext {
|
||||
recent_buffers: RecentBuffersContext,
|
||||
}
|
||||
|
||||
struct RecentBuffersContext {
|
||||
enabled: bool,
|
||||
buffers: Vec<RecentBuffer>,
|
||||
message: String,
|
||||
pending_message: Option<Task<()>>,
|
||||
}
|
||||
|
||||
struct RecentBuffer {
|
||||
buffer: WeakModel<Buffer>,
|
||||
_subscription: Subscription,
|
||||
}
|
||||
|
||||
impl Default for RecentBuffersContext {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: true,
|
||||
buffers: Vec::new(),
|
||||
message: String::new(),
|
||||
pending_message: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl EventEmitter<ConversationEvent> for Conversation {}
|
||||
|
||||
impl Conversation {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue