mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 19:30:02 -04:00
Add supercollider support
This commit is contained in:
parent
b8a2d45fa8
commit
1f7db48523
5 changed files with 169 additions and 0 deletions
36
queries/supercollider/locals.scm
Normal file
36
queries/supercollider/locals.scm
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
; The local variables query is different from the highlights query in that, while the highlights query uses arbitrary capture names which can then be mapped to colors, the locals variable query uses a fixed set of capture names, each of which has a special meaning.
|
||||
; The capture names are as follows:
|
||||
; @local.scope - indicates that a syntax node introduces a new local scope.
|
||||
; @local.definition - indicates that a syntax node contains the name of a definition within the current local scope.
|
||||
; @local.reference - indicates that a syntax node contains the name which may refer to an earlier definition within some enclosing scope.
|
||||
|
||||
|
||||
; Scopes
|
||||
[
|
||||
(function_call)
|
||||
(code_block)
|
||||
(function_block)
|
||||
(control_structure)
|
||||
] @scope
|
||||
|
||||
; Definitions
|
||||
(argument
|
||||
name: (identifier) @definition.parameter
|
||||
(set! "definition.var.scope" "local")
|
||||
)
|
||||
|
||||
(variable_definition
|
||||
name: (variable (local_var (identifier) @definition.var
|
||||
)))
|
||||
|
||||
(variable_definition
|
||||
name: (variable (environment_var (identifier) @definition.var))
|
||||
(set! "definition.var.scope" "global"))
|
||||
|
||||
(function_definition name: (variable) @definition.var
|
||||
(set! "definition.var.scope" "parent")
|
||||
)
|
||||
;(variable_definition name: (variable (local_var(identifier))) @local.definition)
|
||||
;(variable) @local.definition
|
||||
|
||||
(identifier) @reference
|
||||
Loading…
Add table
Add a link
Reference in a new issue