Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

rust: Highlight enum variants as types (#45546)

Rocky Shi73515d9ebdd6
diff --git a/crates/languages/src/rust/highlights.scm b/crates/languages/src/rust/highlights.scm
index 1a08126b55d..82008d70153 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)
+
[
"("
")"