mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Add RsHtml template language support
This commit is contained in:
parent
5eca61b32a
commit
7515c33d15
4 changed files with 132 additions and 0 deletions
1
SUPPORTED_LANGUAGES.md
generated
1
SUPPORTED_LANGUAGES.md
generated
|
|
@ -250,6 +250,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka
|
|||
[robots](https://github.com/opa-oz/tree-sitter-robots-txt) | unstable | `H J ` | @opa-oz
|
||||
[roc](https://github.com/faldor20/tree-sitter-roc) | unstable | `H IJL` | @nat-418
|
||||
[ron](https://github.com/tree-sitter-grammars/tree-sitter-ron) | unstable | `HFIJL` | @amaanq
|
||||
[rshtml](https://github.com/rshtml/tree-sitter-rshtml) | unstable | `H J ` | @rshtml
|
||||
[rst](https://github.com/stsewd/tree-sitter-rst) | unstable | `H JL` | @stsewd
|
||||
[ruby](https://github.com/tree-sitter/tree-sitter-ruby) | unstable | `HFIJL` | @TravonteD
|
||||
[runescript](https://github.com/2004Scape/tree-sitter-runescript) | unstable | `H J ` | @2004Scape
|
||||
|
|
|
|||
|
|
@ -1963,6 +1963,14 @@ return {
|
|||
maintainers = { '@amaanq' },
|
||||
tier = 2,
|
||||
},
|
||||
rshtml = {
|
||||
install_info = {
|
||||
revision = '89ae0f3a5e221a83aad243def85e822616d3b3c2',
|
||||
url = 'https://github.com/rshtml/tree-sitter-rshtml',
|
||||
},
|
||||
maintainers = { '@rshtml' },
|
||||
tier = 2,
|
||||
},
|
||||
rst = {
|
||||
install_info = {
|
||||
revision = '4e562e1598b95b93db4f3f64fe40ddefbc677a15',
|
||||
|
|
|
|||
114
runtime/queries/rshtml/highlights.scm
Normal file
114
runtime/queries/rshtml/highlights.scm
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
(start_symbol) @keyword
|
||||
|
||||
(hash_symbol) @punctuation.special
|
||||
|
||||
(open_paren) @punctuation.bracket
|
||||
|
||||
(close_paren) @punctuation.bracket
|
||||
|
||||
(open_brace) @punctuation.bracket
|
||||
|
||||
(close_brace) @punctuation.bracket
|
||||
|
||||
(fat_arrow) @operator
|
||||
|
||||
(semicolon) @punctuation.delimiter
|
||||
|
||||
(equals) @punctuation.delimiter
|
||||
|
||||
(string_line) @string
|
||||
|
||||
(comment_block) @comment
|
||||
|
||||
(open_comment) @operator
|
||||
|
||||
(close_comment) @operator
|
||||
|
||||
(continue_) @keyword.conditional
|
||||
|
||||
(break_) @keyword.conditional
|
||||
|
||||
((start_symbol) @keyword.import
|
||||
.
|
||||
(extends_) @keyword.import)
|
||||
|
||||
(raw_) @keyword
|
||||
|
||||
((start_symbol) @keyword.import
|
||||
.
|
||||
(include_directive
|
||||
(include_) @keyword.import))
|
||||
|
||||
(render_) @keyword
|
||||
|
||||
(render_body_) @keyword
|
||||
|
||||
(child_content_) @keyword
|
||||
|
||||
(section_) @keyword
|
||||
|
||||
(section_block
|
||||
name: (rust_identifier) @module)
|
||||
|
||||
(as_) @keyword.operator
|
||||
|
||||
(as_clause
|
||||
alias: (rust_identifier) @type)
|
||||
|
||||
((start_symbol) @keyword.import
|
||||
.
|
||||
(use_directive
|
||||
(use_) @keyword.import))
|
||||
|
||||
(number) @number
|
||||
|
||||
(bool) @boolean
|
||||
|
||||
(tag_open) @punctuation.bracket
|
||||
|
||||
(tag_close) @punctuation.bracket
|
||||
|
||||
(tag_end_open) @punctuation.bracket
|
||||
|
||||
(tag_self_close) @punctuation.bracket
|
||||
|
||||
(component_tag
|
||||
name: (component_tag_identifier) @tag)
|
||||
|
||||
(component_tag
|
||||
name_close: (component_tag_identifier) @tag)
|
||||
|
||||
(component_tag_parameter
|
||||
name: (rust_identifier) @variable.parameter)
|
||||
|
||||
((start_symbol) @function.call
|
||||
.
|
||||
(rust_expr_simple))
|
||||
|
||||
((start_symbol) @function.call
|
||||
.
|
||||
(rust_expr_paren))
|
||||
|
||||
((start_symbol) @keyword.directive
|
||||
.
|
||||
(rust_block))
|
||||
|
||||
((start_symbol) @keyword.conditional
|
||||
.
|
||||
(if_stmt))
|
||||
|
||||
((start_symbol) @keyword
|
||||
.
|
||||
(for_stmt))
|
||||
|
||||
((start_symbol) @keyword.repeat
|
||||
.
|
||||
(while_stmt))
|
||||
|
||||
((start_symbol) @keyword.conditional
|
||||
.
|
||||
(match_stmt))
|
||||
|
||||
;this is for now extra
|
||||
(else_clause
|
||||
head: (rust_text) @keyword.conditional)
|
||||
9
runtime/queries/rshtml/injections.scm
Normal file
9
runtime/queries/rshtml/injections.scm
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
((html_text) @injection.content
|
||||
(#set! injection.language "html")
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.combined))
|
||||
|
||||
((rust_text) @injection.content
|
||||
(#set! injection.language "rust")
|
||||
(#set! injection.include-children)
|
||||
(#not-match? @injection.content "^else"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue