File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
crates/ide-completion/src Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,7 @@ fn render_pat(
163
163
PatternContext {
164
164
param_ctx: Some ( ParamContext { kind: ParamKind :: Function ( _) , .. } ) ,
165
165
has_type_ascription: false ,
166
+ parent_pat: None ,
166
167
..
167
168
}
168
169
) ;
Original file line number Diff line number Diff line change @@ -398,6 +398,25 @@ fn foo($0) {}
398
398
)
399
399
}
400
400
401
+ #[ test]
402
+ fn completes_in_fn_param_in_nested_pattern ( ) {
403
+ check (
404
+ r#"
405
+ struct Foo { bar: Bar }
406
+ struct Bar(u32);
407
+ fn foo(Bar($0)) {}
408
+ "# ,
409
+ expect ! [ [ r#"
410
+ st Bar
411
+ st Foo
412
+ bn Bar(…) Bar($1)$0
413
+ bn Foo {…} Foo { bar$1 }$0
414
+ kw mut
415
+ kw ref
416
+ "# ] ] ,
417
+ )
418
+ }
419
+
401
420
#[ test]
402
421
fn completes_in_closure_param ( ) {
403
422
check (
You can’t perform that action at this time.
0 commit comments