File tree 1 file changed +16
-0
lines changed
crates/ide-assists/src/handlers
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,8 @@ pub(super) fn find_importable_node(
156
156
{
157
157
ImportAssets :: for_method_call ( & method_under_caret, & ctx. sema )
158
158
. zip ( Some ( method_under_caret. syntax ( ) . clone ( ) . into ( ) ) )
159
+ } else if let Some ( _) = ctx. find_node_at_offset_with_descend :: < ast:: Param > ( ) {
160
+ None
159
161
} else if let Some ( pat) = ctx
160
162
. find_node_at_offset_with_descend :: < ast:: IdentPat > ( )
161
163
. filter ( ast:: IdentPat :: is_simple_ident)
@@ -268,6 +270,20 @@ mod tests {
268
270
assert_eq ! ( labels, order) ;
269
271
}
270
272
273
+ #[ test]
274
+ fn ignore_parameter_name ( ) {
275
+ check_assist_not_applicable (
276
+ auto_import,
277
+ r"
278
+ mod foo {
279
+ pub mod bar {}
280
+ }
281
+
282
+ fn foo(bar$0: &str) {}
283
+ " ,
284
+ ) ;
285
+ }
286
+
271
287
#[ test]
272
288
fn prefer_shorter_paths ( ) {
273
289
let before = r"
You can’t perform that action at this time.
0 commit comments