mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 19:03:30 +04:00
5a1bed2b70
This doesn't work robustly (within pattern matches). Only regular bindings are highlighted as parameters. In order to highlight all parameters even in matches, we would need an arbitrary nesting operator in queries which doesn't exist yet in tree-sitter.
31 lines
877 B
Scheme
31 lines
877 B
Scheme
; Specs and Callbacks
|
|
(attribute
|
|
(stab_clause
|
|
pattern: (arguments (variable) @local.definition)
|
|
; If a spec uses a variable as the return type (and later a `when` clause to type it):
|
|
body: (variable)? @local.definition)) @local.scope
|
|
|
|
; parametric `-type`s
|
|
((attribute
|
|
name: (atom) @_type
|
|
(arguments
|
|
(binary_operator
|
|
left: (call (arguments (variable) @local.definition))
|
|
operator: "::") @local.scope))
|
|
(#match? @_type "(type|opaque)"))
|
|
|
|
; macros
|
|
((attribute
|
|
name: (atom) @_define
|
|
(arguments
|
|
(call (arguments (variable) @local.definition)))) @local.scope
|
|
(#eq? @_define "define"))
|
|
|
|
; `fun`s
|
|
(anonymous_function (stab_clause pattern: (arguments (variable) @local.definition))) @local.scope
|
|
|
|
; Ordinary functions
|
|
(function_clause pattern: (arguments (variable) @local.definition)) @local.scope
|
|
|
|
(variable) @local.reference
|