Skip to content

Commit

Permalink
Add basic notification event to dap_store
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony-Eid committed Oct 23, 2024
1 parent d28c6d2 commit 203ccb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions crates/project/src/dap_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub enum DapStoreEvent {
client_id: DebugAdapterClientId,
message: Message,
},
Notification(String),
}

pub enum DebugAdapterClientState {
Expand Down
7 changes: 5 additions & 2 deletions crates/project/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ impl Project {
cx,
)
});
cx.subscribe(&dap_store, Self::on_dap_store_event).detach();

let buffer_store = cx
.new_model(|cx| BufferStore::local(worktree_store.clone(), dap_store.clone(), cx));
Expand Down Expand Up @@ -663,8 +664,6 @@ impl Project {
cx.subscribe(&settings_observer, Self::on_settings_observer_event)
.detach();

cx.subscribe(&dap_store, Self::on_dap_store_event).detach();

let lsp_store = cx.new_model(|cx| {
LspStore::new_local(
buffer_store.clone(),
Expand Down Expand Up @@ -2354,6 +2353,10 @@ impl Project {
message: message.clone(),
});
}
DapStoreEvent::Notification(message) => cx.emit(Event::Toast {
notification_id: "dap".into(),
message: message.clone(),
}),
}
}

Expand Down

0 comments on commit 203ccb2

Please sign in to comment.