Assingment semantic highlight

This commit is contained in:
GrayJack
2020-07-20 12:36:23 -03:00
parent 54ebb2ce30
commit a662228de4
6 changed files with 47 additions and 41 deletions

View File

@@ -540,7 +540,7 @@ fn highlight_element(
}
}
p if p.is_punct() => match p {
T![::] | T![->] | T![=>] | T![&] => HighlightTag::Operator.into(),
T![::] | T![->] | T![=>] | T![&] | T![..] | T![=] => HighlightTag::Operator.into(),
T![@] => HighlightTag::Operator | HighlightModifier::ControlFlow,
T![!] if element.parent().and_then(ast::MacroCall::cast).is_some() => {
HighlightTag::Macro.into()
@@ -573,6 +573,12 @@ fn highlight_element(
_ if element.parent().and_then(ast::RangeExpr::cast).is_some() => {
HighlightTag::Operator.into()
}
_ if element.parent().and_then(ast::RangePat::cast).is_some() => {
HighlightTag::Operator.into()
}
_ if element.parent().and_then(ast::DotDotPat::cast).is_some() => {
HighlightTag::Operator.into()
}
_ => HighlightTag::Punctuation.into(),
},