From 345b266deefc6c26bc527537d73912a0bac92eeb Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 24 Aug 2022 16:49:03 -0700 Subject: [PATCH] Add missing rust highlights --- crates/zed/src/languages/rust/highlights.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/crates/zed/src/languages/rust/highlights.scm b/crates/zed/src/languages/rust/highlights.scm index d4f571dd52..72482b4073 100644 --- a/crates/zed/src/languages/rust/highlights.scm +++ b/crates/zed/src/languages/rust/highlights.scm @@ -1,6 +1,6 @@ (type_identifier) @type (primitive_type) @type.builtin - +(self) @variable.builtin (field_identifier) @property (call_expression @@ -15,6 +15,16 @@ (function_item name: (identifier) @function.definition) (function_signature_item name: (identifier) @function.definition) +(macro_invocation + macro: [ + (identifier) @function.special + (scoped_identifier + name: (identifier) @function.special) + ]) + +(macro_definition + name: (identifier) @function.special.definition) + ; Identifier conventions ; Assume uppercase names are enum constructors @@ -71,6 +81,7 @@ "mod" "move" "pub" + "ref" "return" "static" "struct" @@ -91,6 +102,13 @@ (char_literal) ] @string +[ + (integer_literal) + (float_literal) +] @number + +(boolean_literal) @constant + [ (line_comment) (block_comment)