From c96a96b3ce538f452b677f4f08730aed309162dd Mon Sep 17 00:00:00 2001 From: Ben Hamment Date: Mon, 22 Apr 2024 21:43:48 +0100 Subject: [PATCH] Add traits in Rust highlights (#10731) Question: I use type.super here because I made a similar change to the ruby syntax to apply the same style to superclasses. With this in mind, should this change be renamed to type.trait or should it be renamed to something like type.italic so the ruby syntax or any other language can all use type.italic? or maybe something else altogether. image Release Notes: - Exposed Rust traits as `type.interface` for individual syntax theming. --- crates/languages/src/rust/highlights.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/languages/src/rust/highlights.scm b/crates/languages/src/rust/highlights.scm index e01010151f..79a50185aa 100644 --- a/crates/languages/src/rust/highlights.scm +++ b/crates/languages/src/rust/highlights.scm @@ -3,6 +3,12 @@ (self) @variable.special (field_identifier) @property +(trait_item name: (type_identifier) @type.interface) +(impl_item trait: (type_identifier) @type.interface) +(abstract_type trait: (type_identifier) @type.interface) +(dynamic_type trait: (type_identifier) @type.interface) +(trait_bounds (type_identifier) @type.interface) + (call_expression function: [ (identifier) @function