-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix unwrap bug in DAP #6786
Fix unwrap bug in DAP #6786
Conversation
if transport == "tcp" && port_arg.is_some() { | ||
Self::tcp_process(command, args, port_arg.unwrap(), id).await | ||
} else if transport == "stdio" { | ||
Self::stdio(command, args, id) | ||
} else { | ||
Result::Err(Error::Other(anyhow!("Incorrect transport {}", transport))) | ||
match (transport, port_arg) { | ||
("tcp", Some(port_arg)) => Self::tcp_process(command, args, port_arg, id).await, | ||
("stdio", _) => Self::stdio(command, args, id), | ||
_ => Result::Err(Error::Other(anyhow!("Incorrect transport {}", transport))), |
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.
This isn't directly related, but I just wanted to get rid of an unnecessary unwrap. If you want I can separate this to a different PR.
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.
good catch, thanks! The CI seems to have failed for unrelated reasons lets hope it passes on a second try
@@ -321,6 +321,7 @@ impl Editor { | |||
} | |||
} | |||
None => { | |||
self.debugger = None; |
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.
This seems like a seperate bug fix to me. I think this is correct and needed to ensure that the debugger is actually removed once it terminates, right? This seems like the right fix to me and I ran into this bug before so it's great to see this fixed too
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.
Yeah it's separate, but related. Without this trying to add a breakpoint after the debugger terminated would show an error, better than crashing but still not great.
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.
yeah this is what I ran into too in the past, good catch :)
Thanks for the quick fix! I'll give it a try today. |
Fixes #6782