diff options
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r-- | crates/ra_analysis/src/syntax_highlighting.rs | 24 |
1 files changed, 23 insertions, 1 deletions
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 { | |||
44 | fn main() { | 44 | fn main() { |
45 | ctry!({ let x = 92; x}); | 45 | ctry!({ let x = 92; x}); |
46 | } | 46 | } |
47 | ", | 47 | ", |
48 | ); | 48 | ); |
49 | let highlights = analysis.highlight(file_id).unwrap(); | 49 | let highlights = analysis.highlight(file_id).unwrap(); |
50 | assert_eq_dbg( | 50 | assert_eq_dbg( |
@@ -60,4 +60,26 @@ mod tests { | |||
60 | &highlights, | 60 | &highlights, |
61 | ) | 61 | ) |
62 | } | 62 | } |
63 | |||
64 | // FIXME: this test is not really necessary: artifact of the inital hacky | ||
65 | // macros implementation. | ||
66 | #[test] | ||
67 | fn highlight_query_group_macro() { | ||
68 | let (analysis, file_id) = single_file( | ||
69 | " | ||
70 | salsa::query_group! { | ||
71 | pub trait HirDatabase: SyntaxDatabase {} | ||
72 | } | ||
73 | ", | ||
74 | ); | ||
75 | let highlights = analysis.highlight(file_id).unwrap(); | ||
76 | assert_eq_dbg( | ||
77 | r#"[HighlightedRange { range: [20; 32), tag: "macro" }, | ||
78 | HighlightedRange { range: [13; 18), tag: "text" }, | ||
79 | HighlightedRange { range: [51; 54), tag: "keyword" }, | ||
80 | HighlightedRange { range: [55; 60), tag: "keyword" }, | ||
81 | HighlightedRange { range: [61; 72), tag: "function" }]"#, | ||
82 | &highlights, | ||
83 | ) | ||
84 | } | ||
63 | } | 85 | } |