From 73515d9ebdd6cdedf9ef3e14558d6c620ce9b3d0 Mon Sep 17 00:00:00 2001 From: Rocky Shi Date: Fri, 23 Jan 2026 00:52:14 +1300 Subject: [PATCH] rust: Highlight enum variants as types (#45546) Closes [#ISSUE](https://github.com/zed-industries/zed/issues/14489) Release Notes: - Fix Rust enum variants with no lower-case highlighted as constants Screenshot: image --- crates/languages/src/rust/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/languages/src/rust/highlights.scm b/crates/languages/src/rust/highlights.scm index 1a08126b55d2084e39611a9e73cde83b6cfc9999..82008d701536177cbe7cab8d6fc6c82e0568e944 100644 --- a/crates/languages/src/rust/highlights.scm +++ b/crates/languages/src/rust/highlights.scm @@ -57,6 +57,9 @@ ((identifier) @constant (#match? @constant "^_*[A-Z][A-Z\\d_]*$")) +; Ensure enum variants are highlighted correctly regardless of naming convention +(enum_variant name: (identifier) @type) + [ "(" ")"