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

Breakpoint prompt editor #44

Merged
67 changes: 34 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions crates/debugger_ui/src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ impl Console {
}

fn evaluate(&mut self, _: &Confirm, cx: &mut ViewContext<Self>) {
let expession = self.query_bar.update(cx, |editor, cx| {
let expession = editor.text(cx);
let expression = self.query_bar.update(cx, |editor, cx| {
let expression = editor.text(cx);

editor.clear(cx);

expession
expression
});

let evaluate_task = self.dap_store.update(cx, |store, cx| {
store.evaluate(
&self.client_id,
self.current_stack_frame_id,
expession,
expression,
dap::EvaluateArgumentsContext::Variables,
cx,
)
Expand Down
1 change: 1 addition & 0 deletions crates/editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ linkify.workspace = true
log.workspace = true
lsp.workspace = true
markdown.workspace = true
menu.workspace = true
multi_buffer.workspace = true
ordered-float.workspace = true
parking_lot.workspace = true
Expand Down
11 changes: 11 additions & 0 deletions crates/editor/src/display_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,17 @@ impl DisplaySnapshot {
.anchor_at(point.to_offset(self, bias), bias)
}

pub fn display_point_to_breakpoint_anchor(&self, point: DisplayPoint) -> Anchor {
let bias = if point.is_zero() {
Bias::Right
} else {
Bias::Left
};

self.buffer_snapshot
.anchor_at(point.to_offset(self, bias), bias)
}

fn display_point_to_inlay_point(&self, point: DisplayPoint, bias: Bias) -> InlayPoint {
let block_point = point.0;
let wrap_point = self.block_snapshot.to_wrap_point(block_point);
Expand Down
Loading
Loading