From 7cec6219c4ac5ce01ef2f29df23f8b3cebca8b09 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 27 Jul 2024 07:54:27 -0700 Subject: 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. --- .../injections/query/test-query-injections.scm | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/query/injections/query/test-query-injections.scm (limited to 'tests/query') 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)) -- cgit v1.2.3-70-g09d2