hard-code expansion of query_group

This commit is contained in:
Aleksey Kladov 2019-01-01 19:23:03 +03:00
parent 832bae8e28
commit e5b2fd6771
2 changed files with 60 additions and 8 deletions

View file

@ -44,7 +44,7 @@ mod tests {
fn main() {
ctry!({ let x = 92; x});
}
",
",
);
let highlights = analysis.highlight(file_id).unwrap();
assert_eq_dbg(
@ -60,4 +60,26 @@ mod tests {
&highlights,
)
}
// FIXME: this test is not really necessary: artifact of the inital hacky
// macros implementation.
#[test]
fn highlight_query_group_macro() {
let (analysis, file_id) = single_file(
"
salsa::query_group! {
pub trait HirDatabase: SyntaxDatabase {}
}
",
);
let highlights = analysis.highlight(file_id).unwrap();
assert_eq_dbg(
r#"[HighlightedRange { range: [20; 32), tag: "macro" },
HighlightedRange { range: [13; 18), tag: "text" },
HighlightedRange { range: [51; 54), tag: "keyword" },
HighlightedRange { range: [55; 60), tag: "keyword" },
HighlightedRange { range: [61; 72), tag: "function" }]"#,
&highlights,
)
}
}