Add gutter runnable edit buttons

Julia Ryan created

Change summary

crates/editor/src/code_context_menus.rs | 23 +++++++++++++++++++++++
crates/editor/src/element.rs            |  1 -
2 files changed, 23 insertions(+), 1 deletion(-)

Detailed changes

crates/editor/src/code_context_menus.rs 🔗

@@ -1438,6 +1438,29 @@ impl CodeActionsMenu {
                                             .overflow_hidden()
                                             .child("debug: ")
                                             .child(scenario.label.clone())
+                                            .child(
+                                                IconButton::new(
+                                                    SharedString::new(format!("edit-{ix}")),
+                                                    IconName::Pencil,
+                                                )
+                                                .on_click(cx.listener(
+                                                    move |editor, _, window, cx| {
+                                                        cx.stop_propagation();
+                                                        if let Some(workspace) = editor.workspace()
+                                                        {
+                                                            workspace.update(cx, |this, cx| {
+                                                                // if let Some(panel) = this.panel::<DebugPanel>(cx) {
+                                                                //     let kind = todo!();
+                                                                //     let id = todo!();
+                                                                //     panel.update_in(cx, |panel, window, cx| {
+                                                                //         panel.go_to_scenario_definition(kind, scenario, id, window, cx)
+                                                                //     })?
+                                                                // }
+                                                            })
+                                                        }
+                                                    },
+                                                )),
+                                            )
                                             .when(selected, |this| {
                                                 this.text_color(colors.text_accent)
                                             }),

crates/editor/src/element.rs 🔗

@@ -2836,7 +2836,6 @@ impl EditorElement {
     ) -> Vec<AnyElement> {
         self.editor.update(cx, |editor, cx| {
             let active_task_indicator_row =
-                // TODO: add edit button on the right side of each row in the context menu
                 if let Some(crate::CodeContextMenu::CodeActions(CodeActionsMenu {
                     deployed_from,
                     actions,