diff options
| author | Vincent Rischmann <vincent@rischmann.fr> | 2023-11-16 22:12:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-16 16:12:55 -0500 |
| commit | da6646c3e51cf10b8da1cb89be9aaf60ab41c6a3 (patch) | |
| tree | b621f027c9aeaf500f8aa7a90f42913e8a5d011c /queries/templ | |
| parent | Update parsers: cpp, wing (diff) | |
| download | nvim-treesitter-da6646c3e51cf10b8da1cb89be9aaf60ab41c6a3.tar nvim-treesitter-da6646c3e51cf10b8da1cb89be9aaf60ab41c6a3.tar.gz nvim-treesitter-da6646c3e51cf10b8da1cb89be9aaf60ab41c6a3.tar.bz2 nvim-treesitter-da6646c3e51cf10b8da1cb89be9aaf60ab41c6a3.tar.lz nvim-treesitter-da6646c3e51cf10b8da1cb89be9aaf60ab41c6a3.tar.xz nvim-treesitter-da6646c3e51cf10b8da1cb89be9aaf60ab41c6a3.tar.zst nvim-treesitter-da6646c3e51cf10b8da1cb89be9aaf60ab41c6a3.zip | |
feat: add templ
---------
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Diffstat (limited to 'queries/templ')
| -rw-r--r-- | queries/templ/highlights.scm | 47 | ||||
| -rw-r--r-- | queries/templ/injections.scm | 8 |
2 files changed, 55 insertions, 0 deletions
diff --git a/queries/templ/highlights.scm b/queries/templ/highlights.scm new file mode 100644 index 000000000..a7a0718e6 --- /dev/null +++ b/queries/templ/highlights.scm @@ -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 diff --git a/queries/templ/injections.scm b/queries/templ/injections.scm new file mode 100644 index 000000000..54e8d6f68 --- /dev/null +++ b/queries/templ/injections.scm @@ -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")) |
