-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Remove unwrap on line option, preventing DAP crash #9632
Conversation
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 fine fix to me but in the long-run I believe we will want to make Breakpoint.line
an Option<usize>
(in helix-view/src/editor.rs
)
I think if it is none we shouldn't be changing the line, instead we should check if it is some and then set the line, as from what I remember change doesn't necessarily have to update everything/send back the old values |
yeah I need to look at the DAP stnardard again but I also think that if line number is null it does not mean 0 |
Looked into this for #8625 which this partially fixes though we should fix the resetting of everything else as well, what I found is at least lldb sends the change event just to change verified to true and only sends along the id of the breakpoint nothing else so by setting the info without checking if it's None we are losing some of the breakpoint information |
if let Some(line) = breakpoint.line {
breakpoints[i].line = line.saturating_sub(1);
} I'm starting to feel like this would be a better solution at the moment |
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, we should fall back to the existing values for these Option
fields:
breakpoints[i].message = breakpoint
.message
.clone()
.or_else(|| breakpoints[i].message.take());
breakpoints[i].line = breakpoint
.line
.map_or(breakpoints[i].line, |line| line.saturating_sub(1));
breakpoints[i].column =
breakpoint.column.or(breakpoints[i].column);
Thanks for fixing this! |
* Remove unwrap on line option, preventing DAP crash, ref helix-editor#4683 * Update to fall back to existing values for option fields
* Remove unwrap on line option, preventing DAP crash, ref helix-editor#4683 * Update to fall back to existing values for option fields
* Remove unwrap on line option, preventing DAP crash, ref helix-editor#4683 * Update to fall back to existing values for option fields
* Remove unwrap on line option, preventing DAP crash, ref helix-editor#4683 * Update to fall back to existing values for option fields
* Remove unwrap on line option, preventing DAP crash, ref helix-editor#4683 * Update to fall back to existing values for option fields
* Remove unwrap on line option, preventing DAP crash, ref helix-editor#4683 * Update to fall back to existing values for option fields
Fix #4683.
xdebug.php-debug-1.34.0 does not provide a line value for this event, this change fixes the issue for me