@@ -42,9 +42,9 @@ use gpui::{
42
42
action, actions, div, point, px, relative, rems, size, uniform_list, AnyElement , AppContext ,
43
43
AsyncWindowContext , BackgroundExecutor , Bounds , ClipboardItem , Component , Context ,
44
44
DispatchContext , EventEmitter , FocusHandle , FontFeatures , FontStyle , FontWeight ,
45
- HighlightStyle , Hsla , InputHandler , Model , ParentElement , Pixels , Render , StatelessInteractive ,
46
- Styled , Subscription , Task , TextStyle , UniformListScrollHandle , View , ViewContext ,
47
- VisualContext , WeakView , WindowContext ,
45
+ HighlightStyle , Hsla , InputHandler , Model , MouseButton , ParentElement , Pixels , Render ,
46
+ StatelessInteractive , Styled , Subscription , Task , TextStyle , UniformListScrollHandle , View ,
47
+ ViewContext , VisualContext , WeakView , WindowContext ,
48
48
} ;
49
49
use highlight_matching_bracket:: refresh_matching_bracket_highlights;
50
50
use hover_popover:: { hide_hover, HoverState } ;
@@ -1586,6 +1586,17 @@ impl CodeActionsMenu {
1586
1586
. bg ( colors. element_hover )
1587
1587
. text_color ( colors. text_accent )
1588
1588
} )
1589
+ . on_mouse_down ( MouseButton :: Left , move |editor : & mut Editor , _, cx| {
1590
+ cx. stop_propagation ( ) ;
1591
+ editor
1592
+ . confirm_code_action (
1593
+ & ConfirmCodeAction {
1594
+ item_ix : Some ( item_ix) ,
1595
+ } ,
1596
+ cx,
1597
+ )
1598
+ . map ( |task| task. detach_and_log_err ( cx) ) ;
1599
+ } )
1589
1600
. child ( action. lsp_action . title . clone ( ) )
1590
1601
} )
1591
1602
. collect ( )
@@ -4429,7 +4440,7 @@ impl Editor {
4429
4440
) -> Option < AnyElement < Self > > {
4430
4441
if self . available_code_actions . is_some ( ) {
4431
4442
Some (
4432
- IconButton :: new ( "code_actions_indicator" , ui2 :: Icon :: Bolt )
4443
+ IconButton :: new ( "code_actions_indicator" , ui :: Icon :: Bolt )
4433
4444
. on_click ( |editor : & mut Editor , cx| {
4434
4445
editor. toggle_code_actions (
4435
4446
& ToggleCodeActions {
0 commit comments