mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Add vis matcher
This commit is contained in:
parent
c5983b85fc
commit
87ff908135
6 changed files with 33 additions and 1 deletions
|
@ -809,4 +809,16 @@ MACRO_ITEMS@[0; 40)
|
|||
);
|
||||
assert_expansion(&rules, r#"foo!(u8 0)"#, r#"const VALUE: u8 = 0;"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_vis() {
|
||||
let rules = create_rules(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($ vis:vis $ name:ident) => { $ vis fn $ name() {}};
|
||||
}
|
||||
"#,
|
||||
);
|
||||
assert_expansion(&rules, r#"foo!(pub foo);"#, r#"pub fn foo() {}"#);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue