mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Simplify
This commit is contained in:
parent
939ca83b34
commit
92dac67d0c
2 changed files with 49 additions and 83 deletions
|
@ -4,7 +4,7 @@ mod highlights;
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue