@@ -557,6 +557,84 @@ pub fn dap_edit_condition(cx: &mut Context) {
560+pub fn dap_edit_log(cx: &mut Context) {
561+ if let Some((pos, mut bp)) = commands::cmd::get_breakpoint_at_current_line(cx.editor) {
562+ let callback = Box::pin(async move {
563+ let call: Callback =
564+ Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
565+ let log_message = bp.log_message.clone();
566+ let prompt = Prompt::new(
567+ "log message: ".into(),
569+ |_input: &str| Vec::new(),
570+ move |cx: &mut crate::compositor::Context,
572+ event: PromptEvent| {
573+ if event != PromptEvent::Validate {
577+ let (_, doc) = current!(cx.editor);
578+ let path = match doc.path() {
579+ Some(path) => path.to_path_buf(),
581+ cx.editor.set_status(
582+ "Can't edit breakpoint: document has no path".to_owned(),
589+ cx.editor.breakpoints.entry(path.clone()).or_default();
590+ breakpoints.remove(pos);
591+ bp.log_message = match input {
593+ input => Some(input.to_owned()),
595+ breakpoints.push(bp.clone());
597+ if let Some(debugger) = &mut cx.editor.debugger {
598+ // TODO: handle capabilities correctly again, by filterin breakpoints when emitting
599+ // if breakpoint.condition.is_some()
604+ // .supports_conditional_breakpoints
605+ // .unwrap_or_default()
608+ // "Can't edit breakpoint: debugger does not support conditional breakpoints"
611+ // if breakpoint.log_message.is_some()
616+ // .supports_log_points
617+ // .unwrap_or_default()
619+ // bail!("Can't edit breakpoint: debugger does not support logpoints")
621+ let request = debugger.set_breakpoints(path, breakpoints.clone());
622+ if let Err(e) = block_on(request) {
624+ .set_status(format!("Failed to set breakpoints: {:?}", e))
630+ compositor.push(Box::new(prompt));
634+ cx.jobs.callback(callback);
560pub fn dap_switch_thread(cx: &mut Context) {
638pub fn dap_switch_thread(cx: &mut Context) {
561 thread_picker(cx, |editor, thread| {
639 thread_picker(cx, |editor, thread| {
562 block_on(select_thread_id(editor, thread.id, true));
640 block_on(select_thread_id(editor, thread.id, true));