mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-26 19:37:36 +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 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
|
||||
|
|
|
|||
|
|
@ -138,44 +138,43 @@ in {
|
|||
filetypes = ["nix"];
|
||||
content = ''
|
||||
;; extends
|
||||
(
|
||||
(binding
|
||||
attrpath: (attrpath
|
||||
(identifier) @_a
|
||||
(identifier) @_b
|
||||
(identifier)? @_c)
|
||||
(#eq? @_a "vim")
|
||||
(#any-of? @_b "treesitter")
|
||||
(#any-of? @_c "queries")
|
||||
|
||||
expression: (attrset_expression
|
||||
(binding_set
|
||||
(binding
|
||||
attrpath: (attrpath
|
||||
(identifier) @_queries)
|
||||
(#eq? @_queries "queries")
|
||||
((binding
|
||||
attrpath: (attrpath
|
||||
(identifier) @_a
|
||||
(identifier) @_b
|
||||
(identifier)? @_c)
|
||||
(#eq? @_a "vim")
|
||||
(#any-of? @_b "treesitter")
|
||||
(#any-of? @_c "queries")
|
||||
|
||||
expression: (list_expression
|
||||
(attrset_expression
|
||||
(binding_set
|
||||
(binding
|
||||
attrpath: (attrpath
|
||||
(identifier) @_field)
|
||||
(#eq? @_field "content")
|
||||
expression: (attrset_expression
|
||||
(binding_set
|
||||
(binding
|
||||
attrpath: (attrpath
|
||||
(identifier) @_queries)
|
||||
(#eq? @_queries "queries")
|
||||
|
||||
expression: [
|
||||
(string_expression
|
||||
(string_fragment) @injection.content)
|
||||
(indented_string_expression
|
||||
(string_fragment) @injection.content)
|
||||
]
|
||||
expression: (list_expression
|
||||
(attrset_expression
|
||||
(binding_set
|
||||
(binding
|
||||
attrpath: (attrpath
|
||||
(identifier) @_field)
|
||||
(#eq? @_field "content")
|
||||
|
||||
(#set! injection.language "query")
|
||||
(#set! injection.combined)))))))))
|
||||
)
|
||||
expression: [
|
||||
(string_expression
|
||||
(string_fragment) @injection.content)
|
||||
(indented_string_expression
|
||||
(string_fragment) @injection.content)
|
||||
]
|
||||
|
||||
(#set! injection.language "query")
|
||||
(#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.language "lua")
|
||||
(#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