mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
hard-code expansion of query_group
This commit is contained in:
parent
832bae8e28
commit
e5b2fd6771
2 changed files with 60 additions and 8 deletions
|
@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue