@@ -24,7 +24,7 @@ impl<'db> InlayHint<'db> {
24
24
#[ derive( Debug , Clone , Eq , PartialEq ) ]
25
25
pub enum InlayHintContent < ' db > {
26
26
Type ( Type < ' db > ) ,
27
- FunctionArgumentName ( String ) ,
27
+ CallArgumentName ( String ) ,
28
28
}
29
29
30
30
impl < ' db > InlayHintContent < ' db > {
@@ -44,7 +44,7 @@ impl fmt::Display for DisplayInlayHint<'_, '_> {
44
44
InlayHintContent :: Type ( ty) => {
45
45
write ! ( f, ": {}" , ty. display( self . db) )
46
46
}
47
- InlayHintContent :: FunctionArgumentName ( name) => {
47
+ InlayHintContent :: CallArgumentName ( name) => {
48
48
write ! ( f, "{name}=" )
49
49
}
50
50
}
@@ -77,21 +77,21 @@ pub struct InlayHintSettings {
77
77
/// ```
78
78
pub variable_types : bool ,
79
79
80
- /// Whether to show function argument names.
80
+ /// Whether to show call argument names.
81
81
///
82
82
/// For example, this would enable / disable hints like the ones quoted below:
83
83
/// ```python
84
84
/// def foo(x: int): pass
85
85
/// foo("x="1)
86
86
/// ```
87
- pub function_argument_names : bool ,
87
+ pub call_argument_names : bool ,
88
88
}
89
89
90
90
impl Default for InlayHintSettings {
91
91
fn default ( ) -> Self {
92
92
Self {
93
93
variable_types : true ,
94
- function_argument_names : true ,
94
+ call_argument_names : true ,
95
95
}
96
96
}
97
97
}
@@ -127,8 +127,8 @@ impl<'a, 'db> InlayHintVisitor<'a, 'db> {
127
127
} ) ;
128
128
}
129
129
130
- fn add_function_argument_name ( & mut self , position : TextSize , name : String ) {
131
- if !self . settings . function_argument_names {
130
+ fn add_call_argument_name ( & mut self , position : TextSize , name : String ) {
131
+ if !self . settings . call_argument_names {
132
132
return ;
133
133
}
134
134
@@ -138,7 +138,7 @@ impl<'a, 'db> InlayHintVisitor<'a, 'db> {
138
138
139
139
self . hints . push ( InlayHint {
140
140
position,
141
- content : InlayHintContent :: FunctionArgumentName ( name) ,
141
+ content : InlayHintContent :: CallArgumentName ( name) ,
142
142
} ) ;
143
143
}
144
144
}
@@ -205,7 +205,7 @@ impl SourceOrderVisitor<'_> for InlayHintVisitor<'_, '_> {
205
205
206
206
for ( index, arg_or_keyword) in call. arguments . arguments_source_order ( ) . enumerate ( ) {
207
207
if let Some ( name) = argument_names. get ( & index) {
208
- self . add_function_argument_name (
208
+ self . add_call_argument_name (
209
209
arg_or_keyword. range ( ) . start ( ) ,
210
210
name. to_string ( ) ,
211
211
) ;
@@ -301,7 +301,7 @@ mod tests {
301
301
fn inlay_hints ( & self ) -> String {
302
302
self . inlay_hints_with_settings ( & InlayHintSettings {
303
303
variable_types : true ,
304
- function_argument_names : true ,
304
+ call_argument_names : true ,
305
305
} )
306
306
}
307
307
@@ -857,7 +857,7 @@ mod tests {
857
857
) ;
858
858
859
859
assert_snapshot ! ( test. inlay_hints_with_settings( & InlayHintSettings {
860
- function_argument_names : false ,
860
+ call_argument_names : false ,
861
861
..Default :: default ( )
862
862
} ) , @r"
863
863
def foo(x: int): pass
0 commit comments