-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Join project during debug session #81
base: debugger
Are you sure you want to change the base?
Join project during debug session #81
Conversation
crates/project/src/dap_store.rs
Outdated
mut cx: AsyncAppContext, | ||
) -> Result<()> { | ||
this.update(&mut cx, |dap_store, cx| { | ||
if let Some((_, _)) = dap_store.downstream_client { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to check here if we have a downstream client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a sanity check. I don’t think it will ever fail but just in guess theirs a future regression or something we don’t think about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm but this code is never hit inside the if statement right? Because we should only end up inside this method on the non host clients, so there will never be a downstream client. Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot you’re right!! I should’ve use upstream_client instead. I was up late last night and didn’t realize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, I believe this is already covered by the collab code that it's only called when you are actually inside a shared collab channel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check was supposed to ensure that only the host would respond to a GetDebuggerSessions message. I wasn't sure if a message is propagated to all clients or just the host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and the original downstream_client was correct. We only want to send active sessions if we have downstream clients
crates/project/src/dap_store.rs
Outdated
this.update(&mut cx, |dap_store, cx| { | ||
if let Some((_, _)) = dap_store.downstream_client { | ||
cx.emit(DapStoreEvent::SendDebuggerSessions(ProjectId( | ||
_envelope.payload.project_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this event SendDebuggerSessions
do? No one is acting on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug panel is supposed to act on it to send active sessions. Im planning on adding a client handler directly to the debug panel to clean this up
crates/project/src/dap_store.rs
Outdated
@@ -170,6 +173,10 @@ impl DapStore { | |||
upstream_client: AnyProtoClient, | |||
_: &mut ModelContext<Self>, | |||
) -> Self { | |||
upstream_client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to the shared
method? This feels a bit hacky solution. So we also don't try to send a proto message when you are not event sharing a project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
|
||
#[gpui::test] | ||
async fn test_active_debug_panel_item_set_on_join_project( | ||
cx_a: &mut TestAppContext, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see more tests😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least one test per new feature!
This is an almost completed proof of concept version of setting active debug sessions when joining a project. I'll update this description tomorrow mid day (est) to expand on this more.
After this I'm either going to create a proof of concept of the dap proxy or update the documentation on how to configure the debugger.
P.S. Sorry this took me longer than expected, I ended up spending a lot of time with friends and family over the holidays, but I'm getting back in the grove of contributing at least every other day now.