Unnamed repository; edit this file 'description' to name the repository.
feat: add mising pkgs.writers.write* nix tree-sitter injections (#12774)
Kristoffer Plagborg Bak Sørensen 2025-02-11
parent 2197b3c · commit a6f94e0
-rw-r--r--runtime/queries/nix/injections.scm61
1 files changed, 61 insertions, 0 deletions
diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm
index 2b87ff5d..ce53d39e 100644
--- a/runtime/queries/nix/injections.scm
+++ b/runtime/queries/nix/injections.scm
@@ -176,6 +176,67 @@
(#set! injection.language "python")
(#set! injection.combined))
+; pkgs.writers.writeNu[Bin] name attrs content
+(apply_expression
+ (apply_expression
+ function: (apply_expression
+ function: ((_) @_func)))
+ argument: (indented_string_expression (string_fragment) @injection.content)
+ (#match? @_func "(^|\\.)writeNu(Bin)?$")
+ (#set! injection.language "nu")
+ (#set! injection.combined))
+
+; pkgs.writers.writeRuby[Bin] name attrs content
+(apply_expression
+ (apply_expression
+ function: (apply_expression
+ function: ((_) @_func)))
+ argument: (indented_string_expression (string_fragment) @injection.content)
+ (#match? @_func "(^|\\.)writeRuby(Bin)?$")
+ (#set! injection.language "ruby")
+ (#set! injection.combined))
+
+; pkgs.writers.writeLua[Bin] name attrs content
+(apply_expression
+ (apply_expression
+ function: (apply_expression
+ function: ((_) @_func)))
+ argument: (indented_string_expression (string_fragment) @injection.content)
+ (#match? @_func "(^|\\.)writeLua(Bin)?$")
+ (#set! injection.language "lua")
+ (#set! injection.combined))
+
+; pkgs.writers.writeNginxConfig name attrs content
+(apply_expression
+ (apply_expression
+ function: (apply_expression
+ function: ((_) @_func)))
+ argument: (indented_string_expression (string_fragment) @injection.content)
+ (#match? @_func "(^|\\.)writeNginxConfig$")
+ (#set! injection.language "nginx")
+ (#set! injection.combined))
+
+; pkgs.writers.writeGuile[Bin] name attrs content
+(apply_expression
+ (apply_expression
+ function: (apply_expression
+ function: ((_) @_func)))
+ argument: (indented_string_expression (string_fragment) @injection.content)
+ (#match? @_func "(^|\\.)writeGuile(Bin)?$")
+ (#set! injection.language "scheme") ; Guile is a GNU specific implementation of scheme
+ (#set! injection.combined))
+
+
+; pkgs.writers.writeBabashka[Bin] name attrs content
+(apply_expression
+ (apply_expression
+ function: (apply_expression
+ function: ((_) @_func)))
+ argument: (indented_string_expression (string_fragment) @injection.content)
+ (#match? @_func "(^|\\.)writeBabashka(Bin)?$")
+ (#set! injection.language "clojure")
+ (#set! injection.combined))
+
; pkgs.writers.writeFSharp[Bin] name content
; No query available for f-sharp as of the time of writing
; See: https://github.com/helix-editor/helix/issues/4943