diff --git a/build-flavored-queries.py b/build-flavored-queries.py index fd64af6..1eac62f 100755 --- a/build-flavored-queries.py +++ b/build-flavored-queries.py @@ -179,6 +179,7 @@ "injections.scm": [ "injection.combined", "injection.language", + "injection.include-children", ] } @@ -202,8 +203,6 @@ # Changes to textobject queries (r"(@[\w.]+.)inside", r"\1inner"), (r"(@[\w.]+.)around", r"\1outer"), - # nvim does not have `injection.include-children` - (r"\n?\s*\(\s*#set!\s*injection\.include-children\s*\)", "", re.MULTILINE), # nvim uses `var` rather than `variable` (r"(@[\w.]+)\.variable", r"\1.var"), ] @@ -320,6 +319,7 @@ "injections.scm": [ "injection.combined", "injection.language", + "injection.include-children", ] } @@ -337,8 +337,6 @@ # Changes to textobject queries (r"(@[\w.]+).inside", "\1.inner"), (r"(@[\w.]+).around", "\1.outer"), - # nvim does not have `injection.include-children` - (r"\s*\n?\s*\(\s*#set!\s*injection\.include-children\s*\)", "", re.MULTILINE), # nvim uses `var` rather than `variable` (r"(@[\w.]+)\.variable", r"\1.var"), # nothing more specific than reference diff --git a/queries-flavored/helix/injections.scm b/queries-flavored/helix/injections.scm index bbf0dd3..c8035d5 100644 --- a/queries-flavored/helix/injections.scm +++ b/queries-flavored/helix/injections.scm @@ -10,7 +10,8 @@ (#set! injection.language "comment")) ; Highlight the RHS of `=~` as regex -((regex_literal (_) @injection.content) +((regex_literal + (_) @injection.content) (#set! injection.language "regex")) ; ================ Global defaults ================ diff --git a/queries-flavored/lapce/injections.scm b/queries-flavored/lapce/injections.scm index fb8aed4..5309c20 100644 --- a/queries-flavored/lapce/injections.scm +++ b/queries-flavored/lapce/injections.scm @@ -10,7 +10,8 @@ (#set! injection.language "comment")) ; Highlight the RHS of `=~` as regex -((regex_literal (_) @injection.content) +((regex_literal + (_) @injection.content) (#set! injection.language "regex")) ; ================ Global defaults ================ diff --git a/queries-flavored/nvim-next/injections.scm b/queries-flavored/nvim-next/injections.scm index 0bb650f..f1d1697 100644 --- a/queries-flavored/nvim-next/injections.scm +++ b/queries-flavored/nvim-next/injections.scm @@ -8,14 +8,16 @@ (#set! injection.language "comment")) ; Highlight the RHS of `=~` as regex -((regex_literal (_) @injection.content) +((regex_literal + (_) @injection.content) (#set! injection.language "regex")) ; ================ Global defaults ================ ; Default everything to be bash (recipe_body - (#set! injection.language "bash")) @injection.content + (#set! injection.language "bash") + (#set! injection.include-children)) @injection.content (external_command (command_body) @injection.content @@ -46,7 +48,7 @@ (#set! injection.language "powershell")) [ (recipe - (recipe_body) @injection.content) + (recipe_body (#set! injection.include-children)) @injection.content) (assignment (expression @@ -60,7 +62,8 @@ (#not-match? @injection.language ".*(powershell|pwsh|cmd).*")) [ (recipe - (recipe_body) @injection.content) + (recipe_body + (#set! injection.include-children)) @injection.content) (assignment (expression @@ -75,7 +78,8 @@ (recipe_body ; (shebang ; (language) @injection.language) ; - (#not-any-of? @injection.language "python3" "nodejs" "node")) @injection.content + (#not-any-of? @injection.language "python3" "nodejs" "node") + (#set! injection.include-children)) @injection.content ; Transform some known executables @@ -84,11 +88,13 @@ (shebang (language) @_lang) (#eq? @_lang "python3") - (#set! injection.language "python")) @injection.content + (#set! injection.language "python") + (#set! injection.include-children)) @injection.content ; node/nodejs -> javascript (recipe_body (shebang (language) @_lang) (#any-of? @_lang "node" "nodejs") - (#set! injection.language "javascript")) @injection.content + (#set! injection.language "javascript") + (#set! injection.include-children)) @injection.content diff --git a/queries-flavored/zed/injections.scm b/queries-flavored/zed/injections.scm index fb8aed4..5309c20 100644 --- a/queries-flavored/zed/injections.scm +++ b/queries-flavored/zed/injections.scm @@ -10,7 +10,8 @@ (#set! injection.language "comment")) ; Highlight the RHS of `=~` as regex -((regex_literal (_) @injection.content) +((regex_literal + (_) @injection.content) (#set! injection.language "regex")) ; ================ Global defaults ================ diff --git a/queries-src/injections.scm b/queries-src/injections.scm index dad93f6..d78946e 100644 --- a/queries-src/injections.scm +++ b/queries-src/injections.scm @@ -8,7 +8,8 @@ (#set! injection.language "comment")) ; Highlight the RHS of `=~` as regex -((regex_literal (_) @injection.content) +((regex_literal + (_) @injection.content) (#set! injection.language "regex")) ; ================ Global defaults ================ diff --git a/queries/just/injections.scm b/queries/just/injections.scm index 0bb650f..f1d1697 100644 --- a/queries/just/injections.scm +++ b/queries/just/injections.scm @@ -8,14 +8,16 @@ (#set! injection.language "comment")) ; Highlight the RHS of `=~` as regex -((regex_literal (_) @injection.content) +((regex_literal + (_) @injection.content) (#set! injection.language "regex")) ; ================ Global defaults ================ ; Default everything to be bash (recipe_body - (#set! injection.language "bash")) @injection.content + (#set! injection.language "bash") + (#set! injection.include-children)) @injection.content (external_command (command_body) @injection.content @@ -46,7 +48,7 @@ (#set! injection.language "powershell")) [ (recipe - (recipe_body) @injection.content) + (recipe_body (#set! injection.include-children)) @injection.content) (assignment (expression @@ -60,7 +62,8 @@ (#not-match? @injection.language ".*(powershell|pwsh|cmd).*")) [ (recipe - (recipe_body) @injection.content) + (recipe_body + (#set! injection.include-children)) @injection.content) (assignment (expression @@ -75,7 +78,8 @@ (recipe_body ; (shebang ; (language) @injection.language) ; - (#not-any-of? @injection.language "python3" "nodejs" "node")) @injection.content + (#not-any-of? @injection.language "python3" "nodejs" "node") + (#set! injection.include-children)) @injection.content ; Transform some known executables @@ -84,11 +88,13 @@ (shebang (language) @_lang) (#eq? @_lang "python3") - (#set! injection.language "python")) @injection.content + (#set! injection.language "python") + (#set! injection.include-children)) @injection.content ; node/nodejs -> javascript (recipe_body (shebang (language) @_lang) (#any-of? @_lang "node" "nodejs") - (#set! injection.language "javascript")) @injection.content + (#set! injection.language "javascript") + (#set! injection.include-children)) @injection.content