From c1473e4da39406b887cd00d77ec9980187e70f8a Mon Sep 17 00:00:00 2001 From: AltCode Date: Thu, 15 Oct 2026 00:25:52 +0200 Subject: [PATCH] fix(ruby): adjust identifier highlights - Use `@function.method.definition` capture for alias/setter function definitions as well - Use `@variable.special.class` capture for class variables --- languages/ruby/highlights.scm | 6 +++--- tests/languages/ruby/snapshots/highlights.snap | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/languages/ruby/highlights.scm b/languages/ruby/highlights.scm index 6c3dea9..c2220ec 100644 --- a/languages/ruby/highlights.scm +++ b/languages/ruby/highlights.scm @@ -91,10 +91,10 @@ ; Function definitions (alias - (identifier) @function.method) + (identifier) @function.method.definition) (setter - (identifier) @function.method) + (identifier) @function.method.definition) (method name: [ @@ -153,7 +153,7 @@ (super) @variable.special -(class_variable) @variable.special +(class_variable) @variable.special.class (instance_variable) @variable.special.instance diff --git a/tests/languages/ruby/snapshots/highlights.snap b/tests/languages/ruby/snapshots/highlights.snap index 60bc327..a164be4 100644 --- a/tests/languages/ruby/snapshots/highlights.snap +++ b/tests/languages/ruby/snapshots/highlights.snap @@ -22,7 +22,7 @@ expression: captures line: 6 column: 1 text: "@instance_variable" -- name: variable.special +- name: variable.special.class line: 7 column: 1 text: "@@class_variable" @@ -1826,7 +1826,7 @@ expression: captures line: 147 column: 1 text: alias -- name: function.method +- name: function.method.definition line: 147 column: 7 text: foo @@ -1918,7 +1918,7 @@ expression: captures line: 154 column: 1 text: def -- name: function.method +- name: function.method.definition line: 154 column: 5 text: setter