mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 10:56:19 +04:00
fdcd461e65
A few changes: * 0-arity type specs like the following previously would not have the expected 'variable.parameter' highlighting for the return type: -spec foo() -> Value when Value :: term(). * Highlight module, type and function docs as documentation comments and inject markdown into them. * Replace `#match?` predicates with `#any-of?` where possible. * Remove custom auto-pairs. Now that Erlang uses markdown for documentation, the asciidoc-style backtick-singlequote pair is no longer useful.
31 lines
878 B
Scheme
31 lines
878 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
|