feat: add templ

---------

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
This commit is contained in:
Vincent Rischmann 2023-11-16 22:12:55 +01:00 committed by GitHub
parent 8b9f996602
commit da6646c3e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 0 deletions

View file

@ -715,5 +715,8 @@
},
"zig": {
"revision": "0d08703e4c3f426ec61695d7617415fff97029bd"
},
"templ": {
"revision": "94ea27668915ef8f084c9fd7174cfd384ac9a275"
}
}

View file

@ -2095,6 +2095,14 @@ list.zig = {
maintainers = { "@maxxnino" },
}
list.templ = {
install_info = {
url = "https://github.com/vrischmann/tree-sitter-templ",
files = { "src/parser.c", "src/scanner.c" },
},
maintainers = { "@vrischmann" },
}
local M = {
list = list,
filetype_to_parsername = filetype_to_parsername,

View file

@ -0,0 +1,47 @@
; inherits: go
(component_declaration
name: (component_identifier) @function)
[
(tag_start)
(tag_end)
(self_closing_tag)
(style_element)
] @tag
(attribute
name: (attribute_name) @tag.attribute)
(attribute
value: (quoted_attribute_value) @string)
[
(element_text)
(style_element_text)
] @string.special
(css_identifier) @function
(css_property
name: (css_property_name) @attribute)
(css_property
value: (css_property_value) @attribute)
[
(expression)
(dynamic_class_attribute_value)
] @method
(component_import
name: (component_identifier) @function)
(component_render) @function.call
(element_comment) @comment @spell
"@" @operator
[
"templ"
"css"
"script"
] @keyword

View file

@ -0,0 +1,8 @@
; inherits: go
((element_comment) @injection.content (#set! injection.language "comment"))
((script_block_text) @injection.content (#set! injection.language "javascript"))
((script_element_text) @injection.content (#set! injection.language "javascript"))
((style_element_text) @injection.content (#set! injection.language "css"))