diff options
| author | Benny Powers <bennypowers@users.noreply.github.com> | 2023-03-17 09:51:16 +0200 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-19 08:20:16 -0400 |
| commit | 1ba94e9f01c18d2826e991874082fbfb422b3226 (patch) | |
| tree | 6a3331466bab26be8fde5a9938a93036f71eadfc /queries/ecma | |
| parent | fix(cpp): nullptr should be `@constant.builtin` (diff) | |
| download | nvim-treesitter-1ba94e9f01c18d2826e991874082fbfb422b3226.tar nvim-treesitter-1ba94e9f01c18d2826e991874082fbfb422b3226.tar.gz nvim-treesitter-1ba94e9f01c18d2826e991874082fbfb422b3226.tar.bz2 nvim-treesitter-1ba94e9f01c18d2826e991874082fbfb422b3226.tar.lz nvim-treesitter-1ba94e9f01c18d2826e991874082fbfb422b3226.tar.xz nvim-treesitter-1ba94e9f01c18d2826e991874082fbfb422b3226.tar.zst nvim-treesitter-1ba94e9f01c18d2826e991874082fbfb422b3226.zip | |
fix(ecma): template literal injections
see https://github.com/nvim-treesitter/nvim-treesitter/commit/e3ebc8ec5d586162f3c408417621daa59ba8ea62#commitcomment-104824257 for explanation
This also assigns the HTML parser for SVG tagged literals, since svg uses the HTML parser
Diffstat (limited to 'queries/ecma')
| -rw-r--r-- | queries/ecma/injections.scm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/queries/ecma/injections.scm b/queries/ecma/injections.scm index 15da0431e..7ea48dec4 100644 --- a/queries/ecma/injections.scm +++ b/queries/ecma/injections.scm @@ -11,6 +11,19 @@ (#offset! @content 0 1 0 -1)) ) +; html`...`, sql`...` etc +(call_expression + function: ((identifier) @language) + arguments: ((template_string) @content + (#offset! @content 0 1 0 -1)) +) + +; svg`...`, which uses the html parser +(call_expression + function: ((identifier) @_name (#eq? @_name "svg")) + arguments: ((template_string) @html + (#offset! @html 0 1 0 -1))) + (call_expression function: ((identifier) @_name (#eq? @_name "gql")) |
