aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/hir_expand/src/db.rs1
-rw-r--r--crates/ide/src/completion/complete_dot.rs15
2 files changed, 16 insertions, 0 deletions
diff --git a/crates/hir_expand/src/db.rs b/crates/hir_expand/src/db.rs
index b591130ca..ade57ac1b 100644
--- a/crates/hir_expand/src/db.rs
+++ b/crates/hir_expand/src/db.rs
@@ -389,6 +389,7 @@ fn to_fragment_kind(db: &dyn AstDatabase, id: MacroCallId) -> FragmentKind {
389 CALL_EXPR => FragmentKind::Expr, 389 CALL_EXPR => FragmentKind::Expr,
390 INDEX_EXPR => FragmentKind::Expr, 390 INDEX_EXPR => FragmentKind::Expr,
391 METHOD_CALL_EXPR => FragmentKind::Expr, 391 METHOD_CALL_EXPR => FragmentKind::Expr,
392 FIELD_EXPR => FragmentKind::Expr,
392 AWAIT_EXPR => FragmentKind::Expr, 393 AWAIT_EXPR => FragmentKind::Expr,
393 CAST_EXPR => FragmentKind::Expr, 394 CAST_EXPR => FragmentKind::Expr,
394 REF_EXPR => FragmentKind::Expr, 395 REF_EXPR => FragmentKind::Expr,
diff --git a/crates/ide/src/completion/complete_dot.rs b/crates/ide/src/completion/complete_dot.rs
index 0b9f1798a..f0f9a7f1d 100644
--- a/crates/ide/src/completion/complete_dot.rs
+++ b/crates/ide/src/completion/complete_dot.rs
@@ -413,4 +413,19 @@ fn foo() {
413 "#]], 413 "#]],
414 ); 414 );
415 } 415 }
416
417 #[test]
418 fn completes_method_call_when_receiver_is_a_macro_call() {
419 check(
420 r#"
421struct S;
422impl S { fn foo(&self) {} }
423macro_rules! make_s { () => { S }; }
424fn main() { make_s!().f<|>; }
425"#,
426 expect![[r#"
427 me foo() fn foo(&self)
428 "#]],
429 )
430 }
416} 431}