From b232549653fa3477dec0585e7bdfe637d7aaf31e Mon Sep 17 00:00:00 2001 From: Chetan Khilosiya Date: Tue, 6 Apr 2021 00:52:00 +0530 Subject: 8279: Fix the not operator use and test case fix. --- crates/ide/src/syntax_highlighting/highlight.rs | 9 +-------- .../ide/src/syntax_highlighting/test_data/highlight_doctest.html | 2 +- crates/ide/src/syntax_highlighting/test_data/highlighting.html | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) (limited to 'crates/ide/src') 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( HlTag::Operator(HlOperator::Other).into() } T![!] if element.parent().and_then(ast::MacroCall::cast).is_some() => { - eprintln!("in macro call: {}", element); HlTag::Symbol(SymbolKind::Macro).into() } T![!] if element.parent().and_then(ast::NeverType::cast).is_some() => { - eprintln!("in never type : {}", element); HlTag::BuiltinType.into() } T![!] if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { - eprintln!("pre expr for : {}", element); - HlTag::Operator(HlOperator::Bitwise).into() + HlTag::Operator(HlOperator::Logical).into() } T![*] if element.parent().and_then(ast::PtrType::cast).is_some() => { HlTag::Keyword.into() @@ -197,7 +194,6 @@ pub(super) fn element( } } T![-] if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { - eprintln!("the - operator: {}", element); let prefix_expr = element.parent().and_then(ast::PrefixExpr::cast)?; let expr = prefix_expr.expr()?; @@ -208,7 +204,6 @@ pub(super) fn element( .into() } _ if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { - eprintln!("the prefix expr block: {}", element); HlTag::Operator(HlOperator::Other).into() } T![+] | T![-] | T![*] | T![/] | T![+=] | T![-=] | T![*=] | T![/=] @@ -230,11 +225,9 @@ pub(super) fn element( HlTag::Operator(HlOperator::Comparision).into() } _ if element.parent().and_then(ast::BinExpr::cast).is_some() => { - eprintln!("the bin expr : {}", element); HlTag::Operator(HlOperator::Other).into() } _ if element.parent().and_then(ast::RangeExpr::cast).is_some() => { - eprintln!("the range expr block: {}", element); HlTag::Operator(HlOperator::Other).into() } _ if element.parent().and_then(ast::RangePat::cast).is_some() => { diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html index b6d1cac4e..6ee6d85fb 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html @@ -76,7 +76,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd /// // calls bar on foo /// assert!(foo.bar()); /// - /// let bar = foo.bar || Foo::bar; + /// let bar = foo.bar || Foo::bar; /// /// /* multi-line /// comment */ diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html index 973173254..c43bcb691 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlighting.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlighting.html @@ -213,7 +213,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd let baz = -42; let baz = -baz; - let _ = !true; + let _ = !true; 'foo: loop { break 'foo; -- cgit v1.2.3