mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 05:53:45 +00:00
add test case with marco reference
This commit is contained in:
parent
bd26403130
commit
0bf986d718
1 changed files with 39 additions and 0 deletions
|
@ -440,6 +440,45 @@ mod tests {
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_with_marco() {
|
||||||
|
check_assist(
|
||||||
|
extract_struct_from_enum_variant,
|
||||||
|
r#"
|
||||||
|
macro_rules! foo {
|
||||||
|
($x:expr) => {
|
||||||
|
$x
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
enum TheEnum {
|
||||||
|
TheVariant$0 { the_field: u8 },
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
foo![TheEnum::TheVariant { the_field: 42 }];
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
r#"
|
||||||
|
macro_rules! foo {
|
||||||
|
($x:expr) => {
|
||||||
|
$x
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
struct TheVariant{ the_field: u8 }
|
||||||
|
|
||||||
|
enum TheEnum {
|
||||||
|
TheVariant(TheVariant),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
foo![TheEnum::TheVariant { the_field: 42 }];
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn issue_16197() {
|
fn issue_16197() {
|
||||||
check_assist(
|
check_assist(
|
||||||
|
|
Loading…
Reference in a new issue