aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-09 14:32:27 +0000
committerGitHub <[email protected]>2021-01-09 14:32:27 +0000
commit927657432e77bc971f2b853dec7b98b909351541 (patch)
treeb36600814ed46b5e01f4c946aed8829e99eff380 /crates/ide/src/syntax_highlighting.rs
parent939ca83b34f9a5648d196f85e5cc7d844ba22604 (diff)
parent92dac67d0cf9036557249aa8801b0dfed1fd0320 (diff)
Merge #7217
7217: Simplify r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide/src/syntax_highlighting.rs')
-rw-r--r--crates/ide/src/syntax_highlighting.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index ad456bc00..079248511 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -4,7 +4,7 @@ mod highlights;
4mod injector; 4mod injector;
5 5
6mod format; 6mod format;
7mod injection; 7mod inject;
8mod macro_rules; 8mod macro_rules;
9 9
10mod html; 10mod html;
@@ -135,9 +135,7 @@ pub(crate) fn highlight(
135 if ast::Attr::can_cast(node.kind()) { 135 if ast::Attr::can_cast(node.kind()) {
136 inside_attribute = false 136 inside_attribute = false
137 } 137 }
138 if let Some((new_comments, inj)) = injection::extract_doc_comments(node) { 138 inject::doc_comment(&mut hl, node);
139 injection::highlight_doc_comment(new_comments, inj, &mut hl);
140 }
141 } 139 }
142 WalkEvent::Enter(NodeOrToken::Node(node)) if ast::Attr::can_cast(node.kind()) => { 140 WalkEvent::Enter(NodeOrToken::Node(node)) if ast::Attr::can_cast(node.kind()) => {
143 inside_attribute = true 141 inside_attribute = true
@@ -181,7 +179,7 @@ pub(crate) fn highlight(
181 if let Some(token) = element.as_token().cloned().and_then(ast::String::cast) { 179 if let Some(token) = element.as_token().cloned().and_then(ast::String::cast) {
182 if token.is_raw() { 180 if token.is_raw() {
183 let expanded = element_to_highlight.as_token().unwrap().clone(); 181 let expanded = element_to_highlight.as_token().unwrap().clone();
184 if injection::highlight_injection(&mut hl, &sema, token, expanded).is_some() { 182 if inject::ra_fixture(&mut hl, &sema, token, expanded).is_some() {
185 continue; 183 continue;
186 } 184 }
187 } 185 }