mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
feat(ruby): update queries to support rbs-inline syntax (#8282)
This commit is contained in:
parent
2144e88dac
commit
2696fb8326
3 changed files with 38 additions and 1 deletions
|
|
@ -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' },
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -159,4 +171,17 @@
|
||||||
[
|
[
|
||||||
","
|
","
|
||||||
"."
|
"."
|
||||||
|
":"
|
||||||
] @punctuation.delimiter
|
] @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
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#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_body
|
||||||
(heredoc_content) @injection.content
|
(heredoc_content) @injection.content
|
||||||
(heredoc_end) @injection.language)
|
(heredoc_end) @injection.language)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue