@@ -1367,7 +1367,7 @@ pub struct AnnotateTopLevelDefinitions<'a> {
13671367 module : & ' a Module ,
13681368 params : & ' a CodeActionParams ,
13691369 edits : TextEdits < ' a > ,
1370- is_hovering_definition : bool ,
1370+ is_hovering_definition_requiring_annotations : bool ,
13711371}
13721372
13731373impl < ' a > AnnotateTopLevelDefinitions < ' a > {
@@ -1380,7 +1380,7 @@ impl<'a> AnnotateTopLevelDefinitions<'a> {
13801380 module,
13811381 params,
13821382 edits : TextEdits :: new ( line_numbers) ,
1383- is_hovering_definition : false ,
1383+ is_hovering_definition_requiring_annotations : false ,
13841384 }
13851385 }
13861386
@@ -1389,7 +1389,7 @@ impl<'a> AnnotateTopLevelDefinitions<'a> {
13891389
13901390 // We only want to trigger the action if we're over one of the definition
13911391 // which is lacking some annotations in the module
1392- if !self . is_hovering_definition || self . edits . edits . is_empty ( ) {
1392+ if !self . is_hovering_definition_requiring_annotations {
13931393 return vec ! [ ] ;
13941394 } ;
13951395
@@ -1414,7 +1414,7 @@ impl<'ast> ast::visit::Visit<'ast> for AnnotateTopLevelDefinitions<'_> {
14141414
14151415 // We're hovering definition which needs some annotations
14161416 if overlaps ( code_action_range, self . params . range ) {
1417- self . is_hovering_definition = true ;
1417+ self . is_hovering_definition_requiring_annotations = true ;
14181418 }
14191419
14201420 self . edits . insert (
@@ -1441,16 +1441,15 @@ impl<'ast> ast::visit::Visit<'ast> for AnnotateTopLevelDefinitions<'_> {
14411441 return ;
14421442 }
14431443
1444- // Create new printer to ignore type variables from other definitions
1445- let mut printer = Printer :: new_without_type_variables ( & self . module . ast . names ) ;
1446- collect_type_variables ( & mut printer, fun) ;
1447-
14481444 let code_action_range = self . edits . src_span_to_lsp_range ( fun. location ) ;
1449-
14501445 if overlaps ( code_action_range, self . params . range ) {
1451- self . is_hovering_definition = true ;
1446+ self . is_hovering_definition_requiring_annotations = true ;
14521447 }
14531448
1449+ // Create new printer to ignore type variables from other definitions
1450+ let mut printer = Printer :: new_without_type_variables ( & self . module . ast . names ) ;
1451+ collect_type_variables ( & mut printer, fun) ;
1452+
14541453 // Annotate each argument separately
14551454 for argument in arguments_to_annotate {
14561455 self . edits . insert (
0 commit comments