From b08362f6d2973336764c52ebc7cc5e9f34f0d80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Tue, 21 May 2019 16:28:10 +0300 Subject: Address feedback --- crates/ra_ide_api/src/syntax_highlighting.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs index ab69a4374..2158291dc 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide_api/src/syntax_highlighting.rs @@ -13,8 +13,15 @@ pub struct HighlightedRange { fn is_control_keyword(kind: SyntaxKind) -> bool { match kind { - FOR_KW | LOOP_KW | WHILE_KW | CONTINUE_KW | BREAK_KW | IF_KW | ELSE_KW | MATCH_KW - | RETURN_KW => true, + T![for] + | T![loop] + | T![while] + | T![continue] + | T![break] + | T![if] + | T![else] + | T![match] + | T![return] => true, _ => false, } } @@ -37,8 +44,8 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec "function", INT_NUMBER | FLOAT_NUMBER | CHAR | BYTE => "literal", LIFETIME => "parameter", - UNSAFE_KW => "unsafe", - k if is_control_keyword(k) => "control", + T![unsafe] => "keyword.unsafe", + k if is_control_keyword(k) => "keyword.control", k if k.is_keyword() => "keyword", _ => { if let Some(macro_call) = node.as_node().and_then(ast::MacroCall::cast) { -- cgit v1.2.3