@@ -32,6 +32,7 @@ mod fn_lifetime_fn;
32
32
mod implicit_static;
33
33
mod param_name;
34
34
mod implicit_drop;
35
+ mod range_exclusive;
35
36
36
37
#[ derive( Clone , Debug , PartialEq , Eq ) ]
37
38
pub struct InlayHintsConfig {
@@ -51,6 +52,7 @@ pub struct InlayHintsConfig {
51
52
pub param_names_for_lifetime_elision_hints : bool ,
52
53
pub hide_named_constructor_hints : bool ,
53
54
pub hide_closure_initialization_hints : bool ,
55
+ pub range_exclusive_hints : bool ,
54
56
pub closure_style : ClosureStyle ,
55
57
pub max_length : Option < usize > ,
56
58
pub closing_brace_hints_min_lines : Option < usize > ,
@@ -127,6 +129,7 @@ pub enum InlayKind {
127
129
Parameter ,
128
130
Type ,
129
131
Drop ,
132
+ RangeExclusive ,
130
133
}
131
134
132
135
#[ derive( Debug ) ]
@@ -517,13 +520,20 @@ fn hints(
517
520
closure_captures:: hints( hints, famous_defs, config, file_id, it. clone( ) ) ;
518
521
closure_ret:: hints( hints, famous_defs, config, file_id, it)
519
522
} ,
523
+ ast:: Expr :: RangeExpr ( it) => range_exclusive:: hints( hints, config, it) ,
520
524
_ => None ,
521
525
}
522
526
} ,
523
527
ast:: Pat ( it) => {
524
528
binding_mode:: hints( hints, sema, config, & it) ;
525
- if let ast:: Pat :: IdentPat ( it) = it {
526
- bind_pat:: hints( hints, famous_defs, config, file_id, & it) ;
529
+ match it {
530
+ ast:: Pat :: IdentPat ( it) => {
531
+ bind_pat:: hints( hints, famous_defs, config, file_id, & it) ;
532
+ }
533
+ ast:: Pat :: RangePat ( it) => {
534
+ range_exclusive:: hints( hints, config, it) ;
535
+ }
536
+ _ => { }
527
537
}
528
538
Some ( ( ) )
529
539
} ,
@@ -621,6 +631,7 @@ mod tests {
621
631
closing_brace_hints_min_lines : None ,
622
632
fields_to_resolve : InlayFieldsToResolve :: empty ( ) ,
623
633
implicit_drop_hints : false ,
634
+ range_exclusive_hints : false ,
624
635
} ;
625
636
pub ( super ) const TEST_CONFIG : InlayHintsConfig = InlayHintsConfig {
626
637
type_hints : true ,
0 commit comments