mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 07:50:07 -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
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue