Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions languages/rbs/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,22 @@

(global_name) @variable

; Generics Keywords
[
(generics_unchecked)
(generics_variance)
] @keyword

Comment on lines +110 to +115
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are snapshot-based query tests for Ruby/ERB, but none for RBS. As a result, these new RBS highlight patterns (e.g., generics_unchecked, inline_*, and the operator nodes) are not validated by cargo test, so a node-name mismatch with the pinned tree-sitter-rbs grammar could ship and break RBS highlighting/injections at runtime. Consider adding an RBS query snapshot test by wiring rbs into tests/support/language_for_id (and adding tree-sitter-rbs as a dev-dependency) plus a small tests/languages/rbs fixture that exercises the inline annotation syntax.

Copilot uses AI. Check for mistakes.
; Standard Arguments
(parameter
(var_name) @variable.parameter)

; Keyword Arguments
(keyword) @variable.parameter

; Unnamed Arguments
(unnamed_parameter) @variable.parameter

; Self
(self) @variable.builtin

Expand Down Expand Up @@ -145,6 +154,10 @@
"&"
"|"
"^"
"?"
(rest_operator)
(block_operator)
(optional_block_operator)
] @operator

; Punctuation
Expand All @@ -164,3 +177,15 @@

; RBS Inline prefix (keep comment color)
(inline_prefix) @comment

; RBS Inline keywords
(inline_class_annotation) @keyword
(inline_generic) @keyword
(inline_override) @keyword
(inline_skip) @keyword

; RBS Inline doc comment (-- description)
(inline_doc_comment) @comment

; RBS Inline doc param names (e.g. @rbs client_request_token: String)
(inline_doc (var_name) @variable.parameter)
Loading