Add RsHtml template language support

This commit is contained in:
mehmetkesik 2025-11-06 19:38:08 +03:00
parent 5eca61b32a
commit 7515c33d15
4 changed files with 132 additions and 0 deletions

View file

@ -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

View file

@ -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',

View 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)

View 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"))