On second thought, we want to preserve the textMate here where all punctuation that are from a Attr be highlited as Attribute

This commit is contained in:
GrayJack
2020-07-20 23:37:31 -03:00
parent 04d8dc4a10
commit 5ca3855c06
3 changed files with 5 additions and 3 deletions

View File

@@ -540,7 +540,6 @@ fn highlight_element(
}
}
p if p.is_punct() => match p {
T![#] => HighlightTag::Attribute.into(),
T![::] | T![->] | T![=>] | T![&] | T![..] | T![=] | T![@] => {
HighlightTag::Operator.into()
}
@@ -581,6 +580,9 @@ fn highlight_element(
_ if element.parent().and_then(ast::DotDotPat::cast).is_some() => {
HighlightTag::Operator.into()
}
_ if element.parent().and_then(ast::Attr::cast).is_some() => {
HighlightTag::Attribute.into()
}
_ => HighlightTag::Punctuation.into(),
},