mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-17 17:38:02 +00:00
feat(ruby): update queries to support rbs-inline syntax (#8282)
This commit is contained in:
committed by
GitHub
parent
2144e88dac
commit
2696fb8326
@@ -1860,7 +1860,7 @@ return {
|
||||
},
|
||||
rbs = {
|
||||
install_info = {
|
||||
revision = 'de893b166476205b09e79cd3689f95831269579a',
|
||||
revision = '5282e2f36d4109f5315c1d9486b5b0c2044622bb',
|
||||
url = 'https://github.com/joker1007/tree-sitter-rbs',
|
||||
},
|
||||
maintainers = { '@joker1007' },
|
||||
|
||||
@@ -106,10 +106,18 @@
|
||||
|
||||
(global_name) @variable
|
||||
|
||||
; Generics Keywords
|
||||
[
|
||||
(generics_unchecked)
|
||||
(generics_variance)
|
||||
] @keyword
|
||||
|
||||
; Standard Arguments
|
||||
(parameter
|
||||
(var_name) @variable.parameter)
|
||||
|
||||
(unnamed_parameter) @variable.parameter
|
||||
|
||||
; Keyword Arguments
|
||||
(keyword) @variable.parameter
|
||||
|
||||
@@ -144,6 +152,10 @@
|
||||
"&"
|
||||
"|"
|
||||
"^"
|
||||
"?"
|
||||
(rest_operator)
|
||||
(block_operator)
|
||||
(optional_block_operator)
|
||||
] @operator
|
||||
|
||||
; Punctuation
|
||||
@@ -159,4 +171,17 @@
|
||||
[
|
||||
","
|
||||
"."
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
; RBS Inline syntax
|
||||
(inline_class_annotation) @keyword
|
||||
|
||||
(inline_doc
|
||||
(var_name) @variable.parameter)
|
||||
|
||||
(inline_generic) @keyword
|
||||
|
||||
(inline_override) @keyword
|
||||
|
||||
(inline_skip) @keyword
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#lua-match? @injection.content "^#:")
|
||||
(#set! injection.language "rbs"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#lua-match? @injection.content "^#%s+@rbs")
|
||||
(#set! injection.language "rbs"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#lua-match? @injection.content "^#%s+|")
|
||||
(#set! injection.language "rbs"))
|
||||
|
||||
(heredoc_body
|
||||
(heredoc_content) @injection.content
|
||||
(heredoc_end) @injection.language)
|
||||
|
||||
Reference in New Issue
Block a user