languages/nix: add more nvf injections

This commit is contained in:
Snoweuph 2026-04-19 18:37:19 +02:00
commit c4b940239b
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
2 changed files with 50 additions and 42 deletions

View file

@ -274,7 +274,7 @@
- Added {option}`vim.treesitter.queries` to support adding custom queries.
- Added injections for `vim.treesitter.queries.*.content` as `query` and
`mkLualine ""` as `lua`.
`mkLualine`, `entryAnywhere`, `entryBefore`, `entryAfter` as `lua`.
- Added `vim.lsp.presets.<name>` to contain LSP configurations. This allows for
more flexibility in nvf and reuse of LSPs across languages. Dropped

View file

@ -138,8 +138,8 @@ in {
filetypes = ["nix"];
content = ''
;; extends
(
(binding
((binding
attrpath: (attrpath
(identifier) @_a
(identifier) @_b
@ -171,11 +171,10 @@ in {
]
(#set! injection.language "query")
(#set! injection.combined)))))))))
)
(#set! injection.combined))))))))))
'';
}
# mkLuaInline = lua
# mkLuaInline, entryAnywhere, entryBefore, entryAfter = lua
{
type = "injections";
filetypes = ["nix"];
@ -185,13 +184,22 @@ in {
((apply_expression
function: (variable_expression
name: (identifier) @_func
(#eq? @_func "mkLuaInline"))
(#any-of? @_func "mkLuaInline" "entryAnywhere"))
argument: (indented_string_expression
(string_fragment) @injection.content)
(string_fragment) @injection.content))
(#set! injection.language "lua")
(#set! injection.combined)))
(#set! injection.combined))
((apply_expression
function: (apply_expression
function: (variable_expression
name: (identifier) @_func
(#any-of? @_func "entryBefore" "entryAfter"))
argument: (_))
argument: (indented_string_expression
(string_fragment) @injection.content))
(#set! injection.language "lua")
(#set! injection.combined))
'';
}
];