@@ -1383,14 +1383,28 @@ impl PickerDelegate for DebugDelegate {
13831383 . border_color ( cx. theme ( ) . colors ( ) . border_variant )
13841384 . children ( {
13851385 let action = menu:: SecondaryConfirm . boxed_clone ( ) ;
1386- KeyBinding :: for_action ( & * action, window, cx) . map ( |keybind| {
1387- Button :: new ( "edit-debug-task" , "Edit in debug.json" )
1388- . label_size ( LabelSize :: Small )
1389- . key_binding ( keybind)
1390- . on_click ( move |_, window, cx| {
1391- window. dispatch_action ( action. boxed_clone ( ) , cx)
1392- } )
1393- } )
1386+ if self . matches . is_empty ( ) {
1387+ Some (
1388+ Button :: new ( "edit-debug-json" , "Edit debug.json" )
1389+ . label_size ( LabelSize :: Small )
1390+ . on_click ( cx. listener ( |_picker, _, window, cx| {
1391+ window. dispatch_action (
1392+ zed_actions:: OpenProjectDebugTasks . boxed_clone ( ) ,
1393+ cx,
1394+ ) ;
1395+ cx. emit ( DismissEvent ) ;
1396+ } ) ) ,
1397+ )
1398+ } else {
1399+ KeyBinding :: for_action ( & * action, window, cx) . map ( |keybind| {
1400+ Button :: new ( "edit-debug-task" , "Edit in debug.json" )
1401+ . label_size ( LabelSize :: Small )
1402+ . key_binding ( keybind)
1403+ . on_click ( move |_, window, cx| {
1404+ window. dispatch_action ( action. boxed_clone ( ) , cx)
1405+ } )
1406+ } )
1407+ }
13941408 } )
13951409 . map ( |this| {
13961410 if ( current_modifiers. alt || self . matches . is_empty ( ) ) && !self . prompt . is_empty ( ) {
0 commit comments