aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/highlight.rs
diff options
context:
space:
mode:
authorChetan Khilosiya <[email protected]>2021-04-05 20:22:00 +0100
committerChetan Khilosiya <[email protected]>2021-04-08 18:28:26 +0100
commitb232549653fa3477dec0585e7bdfe637d7aaf31e (patch)
treee2275269aea3fe322832fed39f4e7d13c4eb4bc3 /crates/ide/src/syntax_highlighting/highlight.rs
parent1735b3ef6a7c7f7b3f5cdecdbf204c85991bcd63 (diff)
8279: Fix the not operator use and test case fix.
Diffstat (limited to 'crates/ide/src/syntax_highlighting/highlight.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/highlight.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs
index 7734ea301..8dd5d801b 100644
--- a/crates/ide/src/syntax_highlighting/highlight.rs
+++ b/crates/ide/src/syntax_highlighting/highlight.rs
@@ -169,16 +169,13 @@ pub(super) fn element(
169 HlTag::Operator(HlOperator::Other).into() 169 HlTag::Operator(HlOperator::Other).into()
170 } 170 }
171 T![!] if element.parent().and_then(ast::MacroCall::cast).is_some() => { 171 T![!] if element.parent().and_then(ast::MacroCall::cast).is_some() => {
172 eprintln!("in macro call: {}", element);
173 HlTag::Symbol(SymbolKind::Macro).into() 172 HlTag::Symbol(SymbolKind::Macro).into()
174 } 173 }
175 T![!] if element.parent().and_then(ast::NeverType::cast).is_some() => { 174 T![!] if element.parent().and_then(ast::NeverType::cast).is_some() => {
176 eprintln!("in never type : {}", element);
177 HlTag::BuiltinType.into() 175 HlTag::BuiltinType.into()
178 } 176 }
179 T![!] if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { 177 T![!] if element.parent().and_then(ast::PrefixExpr::cast).is_some() => {
180 eprintln!("pre expr for : {}", element); 178 HlTag::Operator(HlOperator::Logical).into()
181 HlTag::Operator(HlOperator::Bitwise).into()
182 } 179 }
183 T![*] if element.parent().and_then(ast::PtrType::cast).is_some() => { 180 T![*] if element.parent().and_then(ast::PtrType::cast).is_some() => {
184 HlTag::Keyword.into() 181 HlTag::Keyword.into()
@@ -197,7 +194,6 @@ pub(super) fn element(
197 } 194 }
198 } 195 }
199 T![-] if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { 196 T![-] if element.parent().and_then(ast::PrefixExpr::cast).is_some() => {
200 eprintln!("the - operator: {}", element);
201 let prefix_expr = element.parent().and_then(ast::PrefixExpr::cast)?; 197 let prefix_expr = element.parent().and_then(ast::PrefixExpr::cast)?;
202 198
203 let expr = prefix_expr.expr()?; 199 let expr = prefix_expr.expr()?;
@@ -208,7 +204,6 @@ pub(super) fn element(
208 .into() 204 .into()
209 } 205 }
210 _ if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { 206 _ if element.parent().and_then(ast::PrefixExpr::cast).is_some() => {
211 eprintln!("the prefix expr block: {}", element);
212 HlTag::Operator(HlOperator::Other).into() 207 HlTag::Operator(HlOperator::Other).into()
213 } 208 }
214 T![+] | T![-] | T![*] | T![/] | T![+=] | T![-=] | T![*=] | T![/=] 209 T![+] | T![-] | T![*] | T![/] | T![+=] | T![-=] | T![*=] | T![/=]
@@ -230,11 +225,9 @@ pub(super) fn element(
230 HlTag::Operator(HlOperator::Comparision).into() 225 HlTag::Operator(HlOperator::Comparision).into()
231 } 226 }
232 _ if element.parent().and_then(ast::BinExpr::cast).is_some() => { 227 _ if element.parent().and_then(ast::BinExpr::cast).is_some() => {
233 eprintln!("the bin expr : {}", element);
234 HlTag::Operator(HlOperator::Other).into() 228 HlTag::Operator(HlOperator::Other).into()
235 } 229 }
236 _ if element.parent().and_then(ast::RangeExpr::cast).is_some() => { 230 _ if element.parent().and_then(ast::RangeExpr::cast).is_some() => {
237 eprintln!("the range expr block: {}", element);
238 HlTag::Operator(HlOperator::Other).into() 231 HlTag::Operator(HlOperator::Other).into()
239 } 232 }
240 _ if element.parent().and_then(ast::RangePat::cast).is_some() => { 233 _ if element.parent().and_then(ast::RangePat::cast).is_some() => {