Skip to content
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

Merged
merged 1 commit into from
Apr 17, 2023
Merged

Fix unwrap bug in DAP #6786

merged 1 commit into from
Apr 17, 2023

Conversation

A-Walrus
Copy link
Contributor

Fixes #6782

Comment on lines -65 to +68
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))),
Copy link
Contributor Author

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.

Copy link
Member

@pascalkuthe pascalkuthe left a 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;
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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 :)

@pascalkuthe pascalkuthe added C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer. labels Apr 17, 2023
@the-mikedavis the-mikedavis merged commit 8839eb0 into helix-editor:master Apr 17, 2023
@sbromberger
Copy link
Contributor

Thanks for the quick fix! I'll give it a try today.

Triton171 pushed a commit to Triton171/helix that referenced this pull request Jun 18, 2023
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go debug (delve) causing Helix to panic
4 participants