mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: add templ
--------- Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
This commit is contained in:
parent
8b9f996602
commit
da6646c3e5
4 changed files with 66 additions and 0 deletions
|
|
@ -715,5 +715,8 @@
|
|||
},
|
||||
"zig": {
|
||||
"revision": "0d08703e4c3f426ec61695d7617415fff97029bd"
|
||||
},
|
||||
"templ": {
|
||||
"revision": "94ea27668915ef8f084c9fd7174cfd384ac9a275"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
47
queries/templ/highlights.scm
Normal file
47
queries/templ/highlights.scm
Normal 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
|
||||
8
queries/templ/injections.scm
Normal file
8
queries/templ/injections.scm
Normal 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"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue