From e5b2fd67711eeab6146021542937028dff3bf8a7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 1 Jan 2019 19:23:03 +0300 Subject: hard-code expansion of query_group --- crates/ra_analysis/src/syntax_highlighting.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'crates/ra_analysis') diff --git a/crates/ra_analysis/src/syntax_highlighting.rs b/crates/ra_analysis/src/syntax_highlighting.rs index a644b3fe0..ccea4aee3 100644 --- a/crates/ra_analysis/src/syntax_highlighting.rs +++ b/crates/ra_analysis/src/syntax_highlighting.rs @@ -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, + ) + } } -- cgit v1.2.3