Complete methods when receiver is a macro

This commit is contained in:
Aleksey Kladov 2020-10-17 23:43:13 +02:00
parent 4fe4c30436
commit 13451d3dc4
2 changed files with 16 additions and 0 deletions

View File

@ -389,6 +389,7 @@ fn to_fragment_kind(db: &dyn AstDatabase, id: MacroCallId) -> FragmentKind {
CALL_EXPR => FragmentKind::Expr,
INDEX_EXPR => FragmentKind::Expr,
METHOD_CALL_EXPR => FragmentKind::Expr,
FIELD_EXPR => FragmentKind::Expr,
AWAIT_EXPR => FragmentKind::Expr,
CAST_EXPR => FragmentKind::Expr,
REF_EXPR => FragmentKind::Expr,

View File

@ -413,4 +413,19 @@ fn foo() {
"#]],
);
}
#[test]
fn completes_method_call_when_receiver_is_a_macro_call() {
check(
r#"
struct S;
impl S { fn foo(&self) {} }
macro_rules! make_s { () => { S }; }
fn main() { make_s!().f<|>; }
"#,
expect![[r#"
me foo() fn foo(&self)
"#]],
)
}
}