Skip to content

Commit

Permalink
rename attachment_store -> attachment_registry (zed-industries#11501)
Browse files Browse the repository at this point in the history
Minor touch up from zed-industries#11471

Release Notes:

- N/A
  • Loading branch information
rgbkrk authored May 7, 2024
1 parent 4eedbde commit b038fb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions crates/assistant2/src/assistant2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,14 @@ impl AssistantPanel {
.context("failed to register CreateBufferTool")
.log_err();

let mut attachment_store = AttachmentRegistry::new();
attachment_store.register(ActiveEditorAttachmentTool::new(workspace.clone(), cx));
let mut attachment_registry = AttachmentRegistry::new();
attachment_registry
.register(ActiveEditorAttachmentTool::new(workspace.clone(), cx));

Self::new(
app_state.languages.clone(),
Arc::new(tool_registry),
Arc::new(attachment_store),
Arc::new(attachment_registry),
app_state.user_store.clone(),
project_index,
workspace,
Expand All @@ -154,7 +155,7 @@ impl AssistantPanel {
pub fn new(
language_registry: Arc<LanguageRegistry>,
tool_registry: Arc<ToolRegistry>,
attachment_store: Arc<AttachmentRegistry>,
attachment_registry: Arc<AttachmentRegistry>,
user_store: Model<UserStore>,
project_index: Model<ProjectIndex>,
workspace: WeakView<Workspace>,
Expand All @@ -164,7 +165,7 @@ impl AssistantPanel {
AssistantChat::new(
language_registry,
tool_registry.clone(),
attachment_store,
attachment_registry,
user_store,
project_index,
workspace,
Expand Down Expand Up @@ -394,8 +395,8 @@ impl AssistantChat {
let mode = *mode;
self.pending_completion = Some(cx.spawn(move |this, mut cx| async move {
let attachments_task = this.update(&mut cx, |this, cx| {
let attachment_store = this.attachment_registry.clone();
attachment_store.call_all_attachment_tools(cx)
let attachment_registry = this.attachment_registry.clone();
attachment_registry.call_all_attachment_tools(cx)
});

let attachments = maybe!(async {
Expand Down
4 changes: 2 additions & 2 deletions crates/assistant2/src/ui/active_file_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct ActiveFileButton {

impl ActiveFileButton {
pub fn new(
attachment_store: Arc<AttachmentRegistry>,
attachment_registry: Arc<AttachmentRegistry>,
workspace: View<Workspace>,
cx: &mut ViewContext<Self>,
) -> Self {
Expand All @@ -31,7 +31,7 @@ impl ActiveFileButton {
cx.defer(move |this, cx| this.update_active_buffer(workspace.clone(), cx));

Self {
attachment_registry: attachment_store,
attachment_registry,
status: Status::NoFile,
workspace_subscription,
}
Expand Down

0 comments on commit b038fb3

Please sign in to comment.