mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-29 04:45:20 +00:00
languages/nix: add more nvf injections
This commit is contained in:
parent
6e4065cfbc
commit
c4b940239b
2 changed files with 50 additions and 42 deletions
|
|
@ -274,7 +274,7 @@
|
||||||
- Added {option}`vim.treesitter.queries` to support adding custom queries.
|
- Added {option}`vim.treesitter.queries` to support adding custom queries.
|
||||||
|
|
||||||
- Added injections for `vim.treesitter.queries.*.content` as `query` and
|
- 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
|
- Added `vim.lsp.presets.<name>` to contain LSP configurations. This allows for
|
||||||
more flexibility in nvf and reuse of LSPs across languages. Dropped
|
more flexibility in nvf and reuse of LSPs across languages. Dropped
|
||||||
|
|
|
||||||
|
|
@ -138,8 +138,8 @@ in {
|
||||||
filetypes = ["nix"];
|
filetypes = ["nix"];
|
||||||
content = ''
|
content = ''
|
||||||
;; extends
|
;; extends
|
||||||
(
|
|
||||||
(binding
|
((binding
|
||||||
attrpath: (attrpath
|
attrpath: (attrpath
|
||||||
(identifier) @_a
|
(identifier) @_a
|
||||||
(identifier) @_b
|
(identifier) @_b
|
||||||
|
|
@ -171,11 +171,10 @@ in {
|
||||||
]
|
]
|
||||||
|
|
||||||
(#set! injection.language "query")
|
(#set! injection.language "query")
|
||||||
(#set! injection.combined)))))))))
|
(#set! injection.combined))))))))))
|
||||||
)
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
# mkLuaInline = lua
|
# mkLuaInline, entryAnywhere, entryBefore, entryAfter = lua
|
||||||
{
|
{
|
||||||
type = "injections";
|
type = "injections";
|
||||||
filetypes = ["nix"];
|
filetypes = ["nix"];
|
||||||
|
|
@ -185,13 +184,22 @@ in {
|
||||||
((apply_expression
|
((apply_expression
|
||||||
function: (variable_expression
|
function: (variable_expression
|
||||||
name: (identifier) @_func
|
name: (identifier) @_func
|
||||||
(#eq? @_func "mkLuaInline"))
|
(#any-of? @_func "mkLuaInline" "entryAnywhere"))
|
||||||
|
|
||||||
argument: (indented_string_expression
|
argument: (indented_string_expression
|
||||||
(string_fragment) @injection.content)
|
(string_fragment) @injection.content))
|
||||||
|
|
||||||
(#set! injection.language "lua")
|
(#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))
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue