mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Complete methods when receiver is a macro
This commit is contained in:
parent
4fe4c30436
commit
13451d3dc4
@ -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,
|
||||
|
@ -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)
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user