mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Assign mutable semantic token modifier to assignment operators
This commit is contained in:
parent
b3337c26db
commit
d1256a3709
3 changed files with 10 additions and 7 deletions
|
@ -55,7 +55,6 @@ pub(super) fn element(
|
|||
name_ref,
|
||||
)
|
||||
}
|
||||
|
||||
// Simple token-based highlighting
|
||||
COMMENT => {
|
||||
let comment = element.into_token().and_then(ast::Comment::cast)?;
|
||||
|
@ -132,16 +131,18 @@ pub(super) fn element(
|
|||
.into()
|
||||
}
|
||||
_ if parent_matches::<ast::PrefixExpr>(&element) => HlOperator::Other.into(),
|
||||
T![+] | T![-] | T![*] | T![/] | T![+=] | T![-=] | T![*=] | T![/=]
|
||||
if parent_matches::<ast::BinExpr>(&element) =>
|
||||
{
|
||||
T![+] | T![-] | T![*] | T![/] if parent_matches::<ast::BinExpr>(&element) => {
|
||||
HlOperator::Arithmetic.into()
|
||||
}
|
||||
T![|] | T![&] | T![!] | T![^] | T![|=] | T![&=] | T![^=]
|
||||
if parent_matches::<ast::BinExpr>(&element) =>
|
||||
{
|
||||
T![+=] | T![-=] | T![*=] | T![/=] if parent_matches::<ast::BinExpr>(&element) => {
|
||||
Highlight::from(HlOperator::Arithmetic) | HlMod::Mutable
|
||||
}
|
||||
T![|] | T![&] | T![!] | T![^] if parent_matches::<ast::BinExpr>(&element) => {
|
||||
HlOperator::Bitwise.into()
|
||||
}
|
||||
T![|=] | T![&=] | T![^=] if parent_matches::<ast::BinExpr>(&element) => {
|
||||
Highlight::from(HlOperator::Bitwise) | HlMod::Mutable
|
||||
}
|
||||
T![&&] | T![||] if parent_matches::<ast::BinExpr>(&element) => {
|
||||
HlOperator::Logical.into()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue