From ed791c4fc1066c686c96db6f6f828c3e8742a841 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Thu, 15 Feb 2024 15:12:41 +0100 Subject: [PATCH] Improve ruby highlighting (#7829) Release Notes: - Improved syntax-highlighting of identifiers in Ruby. Before: ![screenshot-2024-02-15-14 40 19@2x](https://github.com/zed-industries/zed/assets/1185253/29fca0eb-7c0c-4aee-9f31-a8a3c6680cb9) After: ![screenshot-2024-02-15-14 40 56@2x](https://github.com/zed-industries/zed/assets/1185253/2ce0e0c9-8689-4ff8-9f40-2ea5f6ccc2f6) --- crates/zed/src/languages/ruby/highlights.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/zed/src/languages/ruby/highlights.scm b/crates/zed/src/languages/ruby/highlights.scm index 2610cfa1ccf07254c68c87d2e8013741d7d6969f..14703c4ff2860c0a41c31c28c8e6a369e1f0c804 100644 --- a/crates/zed/src/languages/ruby/highlights.scm +++ b/crates/zed/src/languages/ruby/highlights.scm @@ -30,8 +30,6 @@ "yield" ] @keyword -(identifier) @variable - ((identifier) @keyword (#match? @keyword "^(private|protected|public)$")) @@ -54,11 +52,6 @@ ; Identifiers -[ - (class_variable) - (instance_variable) -] @property - ((identifier) @constant.builtin (#match? @constant.builtin "^__(FILE|LINE|ENCODING)__$")) @@ -73,11 +66,19 @@ ((constant) @constant (#match? @constant "^[A-Z\\d_]+$")) +(global_variable) @constant + (constant) @type (self) @variable.special (super) @variable.special +[ + (class_variable) + (instance_variable) +] @variable.member + + ; Literals [