]> git.lizzy.rs Git - rust.git/blobdiff - crates/ide/src/syntax_highlighting.rs
Simplify
[rust.git] / crates / ide / src / syntax_highlighting.rs
index ad456bc0011a790a7e2e1b68f2083cbd098991fd..079248511bf31dbc69ac53787f257024441b59bd 100644 (file)
@@ -4,7 +4,7 @@
 mod injector;
 
 mod format;
-mod injection;
+mod inject;
 mod macro_rules;
 
 mod html;
@@ -135,9 +135,7 @@ pub(crate) fn highlight(
                 if ast::Attr::can_cast(node.kind()) {
                     inside_attribute = false
                 }
-                if let Some((new_comments, inj)) = injection::extract_doc_comments(node) {
-                    injection::highlight_doc_comment(new_comments, inj, &mut hl);
-                }
+                inject::doc_comment(&mut hl, node);
             }
             WalkEvent::Enter(NodeOrToken::Node(node)) if ast::Attr::can_cast(node.kind()) => {
                 inside_attribute = true
@@ -181,7 +179,7 @@ pub(crate) fn highlight(
         if let Some(token) = element.as_token().cloned().and_then(ast::String::cast) {
             if token.is_raw() {
                 let expanded = element_to_highlight.as_token().unwrap().clone();
-                if injection::highlight_injection(&mut hl, &sema, token, expanded).is_some() {
+                if inject::ra_fixture(&mut hl, &sema, token, expanded).is_some() {
                     continue;
                 }
             }