feat(rbs): update rbs parser to support inline rbs style

This commit is contained in:
joker1007 2025-11-14 05:13:29 +09:00
parent b50774079a
commit c38b8ba6b9
No known key found for this signature in database
GPG key ID: 69BAF8CC17ECB7B3
2 changed files with 30 additions and 1 deletions

View file

@ -1860,7 +1860,7 @@ return {
}, },
rbs = { rbs = {
install_info = { install_info = {
revision = 'de893b166476205b09e79cd3689f95831269579a', revision = '5282e2f36d4109f5315c1d9486b5b0c2044622bb',
url = 'https://github.com/joker1007/tree-sitter-rbs', url = 'https://github.com/joker1007/tree-sitter-rbs',
}, },
maintainers = { '@joker1007' }, maintainers = { '@joker1007' },

View file

@ -106,10 +106,18 @@
(global_name) @variable (global_name) @variable
; Generics Keywords
[
(generics_unchecked)
(generics_variance)
] @keyword
; Standard Arguments ; Standard Arguments
(parameter (parameter
(var_name) @variable.parameter) (var_name) @variable.parameter)
(unnamed_parameter) @variable.parameter
; Keyword Arguments ; Keyword Arguments
(keyword) @variable.parameter (keyword) @variable.parameter
@ -144,6 +152,10 @@
"&" "&"
"|" "|"
"^" "^"
"?"
(rest_operator)
(block_operator)
(optional_block_operator)
] @operator ] @operator
; Punctuation ; Punctuation
@ -160,3 +172,20 @@
"," ","
"." "."
] @punctuation.delimiter ] @punctuation.delimiter
; RBS Inline prefix (keep comment color)
(inline_prefix) @comment
; RBS Inline syntax
(inline_class_annotation) @keyword
(inline_doc
(var_name) @variable.parameter)
(inline_doc_comment) @comment
(inline_generic) @keyword
(inline_override) @keyword
(inline_skip) @keyword