From 57030f587bb0bbe4dea9a97016b4e0f49a7ef5f3 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 31 Dec 2018 19:19:50 +0300 Subject: use macros database in analysis --- crates/ra_analysis/src/syntax_highlighting.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_analysis/src/syntax_highlighting.rs') diff --git a/crates/ra_analysis/src/syntax_highlighting.rs b/crates/ra_analysis/src/syntax_highlighting.rs index 7e9139a74..35a4630e9 100644 --- a/crates/ra_analysis/src/syntax_highlighting.rs +++ b/crates/ra_analysis/src/syntax_highlighting.rs @@ -15,13 +15,13 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable Date: Tue, 1 Jan 2019 18:11:04 +0300 Subject: move more macros to hir --- crates/ra_analysis/src/syntax_highlighting.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_analysis/src/syntax_highlighting.rs') diff --git a/crates/ra_analysis/src/syntax_highlighting.rs b/crates/ra_analysis/src/syntax_highlighting.rs index 35a4630e9..a644b3fe0 100644 --- a/crates/ra_analysis/src/syntax_highlighting.rs +++ b/crates/ra_analysis/src/syntax_highlighting.rs @@ -15,7 +15,7 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable 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/src/syntax_highlighting.rs') 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