rework grammar to be friendly to injections
want to later support the case of multiple nix-shell directives in injection
This commit is contained in:
8
queries/injections.scm
Normal file
8
queries/injections.scm
Normal file
@@ -0,0 +1,8 @@
|
||||
; if we find an interpreter, mark the *entire file* as injected content.
|
||||
; nix-shell doesn't process the source file before sending it to the interpreter,
|
||||
; so nix-shell directives like `#!nix-shell -i bash` are both a directive to nix-shell
|
||||
; and actual language content handled by the specified interpreter.
|
||||
((source_file
|
||||
(nix_shell_directive
|
||||
(interpreter) @injection.language)) @injection.content
|
||||
(#set! injection.include-children))
|
Reference in New Issue
Block a user