Files
Michael Davis e0dd20d729 queries: Use discards instead of highlight captures in locals.scm
With tree-house v0.4, locals now correctly have their own precedence and
act independently. This removes the need to hack around the precedence
of highlights versus locals as we were doing. So this change mainly
updates captures which were highlights to be discards instead.
2026-05-31 12:02:14 -04:00

26 lines
896 B
Scheme

; Specs and Callbacks
(attribute
(stab_clause
pattern: (arguments (variable)? @local.definition.variable.parameter)
; If a spec uses a variable as the return type (and later a `when` clause to type it):
body: (variable)? @local.definition.variable.parameter)) @local.scope
; parametric `-type`s
((attribute
name: (atom) @_keyword
(arguments
(binary_operator
left: (call (arguments (variable) @local.definition.variable.parameter))
operator: "::") @local.scope))
(#any-of? @_keyword "type" "opaque" "nominal"))
; `fun`s
(anonymous_function (stab_clause pattern: (arguments (variable) @local.definition.variable.parameter))) @local.scope
; Ordinary functions
((function_clause
pattern: (arguments (variable) @local.definition.variable.parameter)) @local.scope
(#not-match? @local.definition.variable.parameter "^_"))
(variable) @local.reference