aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/diagnostics/missing_fields.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/diagnostics/missing_fields.rs')
-rw-r--r--crates/ide/src/diagnostics/missing_fields.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/ide/src/diagnostics/missing_fields.rs b/crates/ide/src/diagnostics/missing_fields.rs
index 95cd64956..c4b6a3679 100644
--- a/crates/ide/src/diagnostics/missing_fields.rs
+++ b/crates/ide/src/diagnostics/missing_fields.rs
@@ -94,6 +94,39 @@ fn baz(s: S) {
94 } 94 }
95 95
96 #[test] 96 #[test]
97 fn range_mapping_out_of_macros() {
98 // FIXME: this is very wrong, but somewhat tricky to fix.
99 check_fix(
100 r#"
101fn some() {}
102fn items() {}
103fn here() {}
104
105macro_rules! id { ($($tt:tt)*) => { $($tt)*}; }
106
107fn main() {
108 let _x = id![Foo { a: $042 }];
109}
110
111pub struct Foo { pub a: i32, pub b: i32 }
112"#,
113 r#"
114fn some(, b: () ) {}
115fn items() {}
116fn here() {}
117
118macro_rules! id { ($($tt:tt)*) => { $($tt)*}; }
119
120fn main() {
121 let _x = id![Foo { a: 42 }];
122}
123
124pub struct Foo { pub a: i32, pub b: i32 }
125"#,
126 );
127 }
128
129 #[test]
97 fn test_fill_struct_fields_empty() { 130 fn test_fill_struct_fields_empty() {
98 check_fix( 131 check_fix(
99 r#" 132 r#"