diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-06-12 09:54:30 -0600 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | 692b051b09935653befdb8f7ba8afdb640adf17b (patch) | |
| tree | 167162b6b129ae04f68c5735078521a72917c742 /queries/gotmpl | |
| parent | feat(c-family): inherit injections (diff) | |
| download | nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2 nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip | |
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'queries/gotmpl')
| -rw-r--r-- | queries/gotmpl/folds.scm | 8 | ||||
| -rw-r--r-- | queries/gotmpl/highlights.scm | 133 | ||||
| -rw-r--r-- | queries/gotmpl/injections.scm | 31 | ||||
| -rw-r--r-- | queries/gotmpl/locals.scm | 12 |
4 files changed, 0 insertions, 184 deletions
diff --git a/queries/gotmpl/folds.scm b/queries/gotmpl/folds.scm deleted file mode 100644 index f3a22e90c..000000000 --- a/queries/gotmpl/folds.scm +++ /dev/null @@ -1,8 +0,0 @@ -[ - (if_action) - (range_action) - (block_action) - (with_action) - (define_action) - (comment) -] @fold diff --git a/queries/gotmpl/highlights.scm b/queries/gotmpl/highlights.scm deleted file mode 100644 index 4ee768c28..000000000 --- a/queries/gotmpl/highlights.scm +++ /dev/null @@ -1,133 +0,0 @@ -; Priorities of the highlight queries are raised, so that they overrule the -; often surrounding and overlapping highlights from the non-gotmpl injections. -; -; Identifiers -([ - (field) - (field_identifier) -] @variable.member - (#set! priority 110)) - -((variable) @variable - (#set! priority 110)) - -; Function calls -(function_call - function: (identifier) @function - (#set! priority 110)) - -(method_call - method: (selector_expression - field: (field_identifier) @function - (#set! priority 110))) - -; Builtin functions -(function_call - function: (identifier) @function.builtin - (#set! priority 110) - (#any-of? @function.builtin - "and" "call" "html" "index" "slice" "js" "len" "not" "or" "print" "printf" "println" "urlquery" - "eq" "ne" "lt" "ge" "gt" "ge")) - -; Operators -([ - "|" - "=" - ":=" -] @operator - (#set! priority 110)) - -; Delimiters -([ - "." - "," -] @punctuation.delimiter - (#set! priority 110)) - -([ - "{{" - "}}" - "{{-" - "-}}" - ")" - "(" -] @punctuation.bracket - (#set! priority 110)) - -; Actions -(if_action - [ - "if" - "else" - "else if" - "end" - ] @keyword.conditional - (#set! priority 110)) - -(range_action - [ - "range" - "else" - "end" - ] @keyword.repeat - (#set! priority 110)) - -(template_action - "template" @function.builtin - (#set! priority 110)) - -(block_action - [ - "block" - "end" - ] @keyword.directive - (#set! priority 110)) - -(define_action - [ - "define" - "end" - ] @keyword.directive.define - (#set! priority 110)) - -(with_action - [ - "with" - "else" - "end" - ] @keyword.conditional - (#set! priority 110)) - -; Literals -([ - (interpreted_string_literal) - (raw_string_literal) -] @string - (#set! priority 110)) - -((rune_literal) @string.special.symbol - (#set! priority 110)) - -((escape_sequence) @string.escape - (#set! priority 110)) - -([ - (int_literal) - (imaginary_literal) -] @number - (#set! priority 110)) - -((float_literal) @number.float - (#set! priority 110)) - -([ - (true) - (false) -] @boolean - (#set! priority 110)) - -((nil) @constant.builtin - (#set! priority 110)) - -((comment) @comment @spell - (#set! priority 110)) diff --git a/queries/gotmpl/injections.scm b/queries/gotmpl/injections.scm deleted file mode 100644 index 3cfc26361..000000000 --- a/queries/gotmpl/injections.scm +++ /dev/null @@ -1,31 +0,0 @@ -((comment) @injection.content - (#set! injection.language "comment")) - -; {{"put" | printf "%s%s" "out" | printf "%q"}} -(function_call - function: (identifier) @_function - arguments: (argument_list - . - (interpreted_string_literal) @injection.content) - (#eq? @_function "printf") - (#set! injection.language "printf")) - -; {{ js "var a = 1 + 1" }} -(function_call - function: (identifier) @_function - arguments: (argument_list - . - (interpreted_string_literal) @injection.content) - (#eq? @_function "js") - (#offset! @injection.content 0 1 0 -1) - (#set! injection.language "javascript")) - -; {{ html "<h1>hello</h1>" }} -(function_call - function: (identifier) @_function - arguments: (argument_list - . - (interpreted_string_literal) @injection.content) - (#eq? @_function "html") - (#offset! @injection.content 0 1 0 -1) - (#set! injection.language "html")) diff --git a/queries/gotmpl/locals.scm b/queries/gotmpl/locals.scm deleted file mode 100644 index 528e9fabb..000000000 --- a/queries/gotmpl/locals.scm +++ /dev/null @@ -1,12 +0,0 @@ -[ - (if_action) - (range_action) - (block_action) - (with_action) - (define_action) -] @local.scope - -(variable_definition - variable: (variable) @local.definition.var) - -(variable) @local.reference |
