From c476f71bdf83e930ebe5c2ad2754f24ee0925c32 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 8 Jun 2020 15:03:14 +0200 Subject: Highlight only the unsafe operator itself --- crates/ra_ide/src/syntax_highlighting.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 9ff7356c9..ab45c364a 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -480,12 +480,8 @@ fn highlight_element( _ => h, } } - PREFIX_EXPR => { - let prefix_expr = element.into_node().and_then(ast::PrefixExpr::cast)?; - match prefix_expr.op_kind() { - Some(ast::PrefixOp::Deref) => {} - _ => return None, - } + T![*] => { + let prefix_expr = element.parent().and_then(ast::PrefixExpr::cast)?; let expr = prefix_expr.expr()?; let ty = sema.type_of_expr(&expr)?; -- cgit v1.2.3