diff options
| author | Riley Bruins <ribru17@hotmail.com> | 2024-07-27 07:54:27 -0700 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-07-27 17:17:26 +0200 |
| commit | 7cec6219c4ac5ce01ef2f29df23f8b3cebca8b09 (patch) | |
| tree | 6b8c8fb60b8cb59c5ef0056734f1cb0a3a4a16f8 /tests/query | |
| parent | feat(luap): Make class captures similar to regex captures (diff) | |
| download | nvim-treesitter-7cec6219c4ac5ce01ef2f29df23f8b3cebca8b09.tar nvim-treesitter-7cec6219c4ac5ce01ef2f29df23f8b3cebca8b09.tar.gz nvim-treesitter-7cec6219c4ac5ce01ef2f29df23f8b3cebca8b09.tar.bz2 nvim-treesitter-7cec6219c4ac5ce01ef2f29df23f8b3cebca8b09.tar.lz nvim-treesitter-7cec6219c4ac5ce01ef2f29df23f8b3cebca8b09.tar.xz nvim-treesitter-7cec6219c4ac5ce01ef2f29df23f8b3cebca8b09.tar.zst nvim-treesitter-7cec6219c4ac5ce01ef2f29df23f8b3cebca8b09.zip | |
fix(query): properly apply predicate injections
I think these have been broken since the query parser update. Basically
the inner node for the string content was preventing injections because
include-children was not set.
Diffstat (limited to 'tests/query')
| -rw-r--r-- | tests/query/injections/query/test-query-injections.scm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/query/injections/query/test-query-injections.scm b/tests/query/injections/query/test-query-injections.scm new file mode 100644 index 000000000..f382eddd9 --- /dev/null +++ b/tests/query/injections/query/test-query-injections.scm @@ -0,0 +1,27 @@ +; vim: ft=query +; format-ignore +(((symbol) @constant + (#not-lua-match? @constant "^_*[A-Z][A-Z0-9_]*$")) +; ^ @luap +) + +; format-ignore +(((tag + (attributes + (attribute + (attribute_name) @keyword))) + (#match? @keyword "^(:|v-bind|v-|\\@)")) +; ^ @regex +) + +((comment) @injection.language + . + [ + (string_expression + (string_fragment) @injection.content) + (indented_string_expression + (string_fragment) @injection.content) + ] + (#gsub! @injection.language "#%s*([%w%p]+)%s*" "%1") + ; ^ @luap + (#set! injection.combined)) |
