@@ -57,9 +57,7 @@ pub(super) fn complete_qualified_path(acc: &mut Completions, ctx: &CompletionCon
57
57
}
58
58
match item {
59
59
hir:: AssocItem :: Function ( func) => {
60
- if !func. has_self_param ( ctx. db ) {
61
- acc. add_function ( ctx, func, None ) ;
62
- }
60
+ acc. add_function ( ctx, func, None ) ;
63
61
}
64
62
hir:: AssocItem :: Const ( ct) => acc. add_const ( ctx, ct) ,
65
63
hir:: AssocItem :: TypeAlias ( ty) => acc. add_type_alias ( ctx, ty) ,
@@ -86,9 +84,7 @@ pub(super) fn complete_qualified_path(acc: &mut Completions, ctx: &CompletionCon
86
84
}
87
85
match item {
88
86
hir:: AssocItem :: Function ( func) => {
89
- if !func. has_self_param ( ctx. db ) {
90
- acc. add_function ( ctx, func, None ) ;
91
- }
87
+ acc. add_function ( ctx, func, None ) ;
92
88
}
93
89
hir:: AssocItem :: Const ( ct) => acc. add_const ( ctx, ct) ,
94
90
hir:: AssocItem :: TypeAlias ( ty) => acc. add_type_alias ( ctx, ty) ,
@@ -482,6 +478,42 @@ mod tests {
482
478
) ;
483
479
}
484
480
481
+ #[ test]
482
+ fn completes_struct_associated_method_with_self ( ) {
483
+ assert_debug_snapshot ! (
484
+ do_reference_completion(
485
+ "
486
+ //- /lib.rs
487
+ /// A Struct
488
+ struct S;
489
+
490
+ impl S {
491
+ /// An associated method
492
+ fn m(&self) { }
493
+ }
494
+
495
+ fn foo() { let _ = S::<|> }
496
+ "
497
+ ) ,
498
+ @r###"
499
+ [
500
+ CompletionItem {
501
+ label: "m()",
502
+ source_range: [105; 105),
503
+ delete: [105; 105),
504
+ insert: "m()$0",
505
+ kind: Method,
506
+ lookup: "m",
507
+ detail: "fn m(&self)",
508
+ documentation: Documentation(
509
+ "An associated method",
510
+ ),
511
+ },
512
+ ]
513
+ "###
514
+ ) ;
515
+ }
516
+
485
517
#[ test]
486
518
fn completes_struct_associated_const ( ) {
487
519
assert_debug_snapshot ! (
0 commit comments