Color for as a regular keyword when it's part of impl _ for _
This commit is contained in:
@@ -403,13 +403,13 @@ fn highlight_element(
|
||||
T![break]
|
||||
| T![continue]
|
||||
| T![else]
|
||||
| T![for]
|
||||
| T![if]
|
||||
| T![loop]
|
||||
| T![match]
|
||||
| T![return]
|
||||
| T![while]
|
||||
| T![in] => h | HighlightModifier::ControlFlow,
|
||||
T![for] if !is_child_of_impl(element) => h | HighlightModifier::ControlFlow,
|
||||
T![unsafe] => h | HighlightModifier::Unsafe,
|
||||
_ => h,
|
||||
}
|
||||
@@ -433,6 +433,13 @@ fn highlight_element(
|
||||
}
|
||||
}
|
||||
|
||||
fn is_child_of_impl(element: SyntaxElement) -> bool {
|
||||
match element.parent() {
|
||||
Some(e) => e.kind() == IMPL_DEF,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
fn highlight_name(db: &RootDatabase, def: Definition) -> Highlight {
|
||||
match def {
|
||||
Definition::Macro(_) => HighlightTag::Macro,
|
||||
|
||||
Reference in New Issue
Block a user