mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
Initial Nix queries
This commit is contained in:
parent
e59a789289
commit
ee0e8e8518
3 changed files with 136 additions and 0 deletions
15
queries/nix/locals.scm
Normal file
15
queries/nix/locals.scm
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
; let bindings
|
||||
(let (bind . (attrpath) @definition.var)) @scope
|
||||
|
||||
; rec attrsets
|
||||
(rec_attrset (bind . (attrpath) @definition.field)) @scope
|
||||
|
||||
; functions and parameters
|
||||
(function . [
|
||||
(identifier) @definition.parameter
|
||||
(formals (formal . (identifier) @definition.parameter))
|
||||
]) @scope
|
||||
((formals) "@" (identifier) @definition.parameter) ; I couldn't get this to work properly inside the (function)
|
||||
|
||||
; some identifiers can't be references, but @reference doesn't seem to have an inverse like @none
|
||||
(identifier) @reference
|
||||
Loading…
Add table
Add a link
Reference in a new issue