mirror of https://github.com/helix-editor/helix
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
890 B
Scheme
28 lines
890 B
Scheme
3 years ago
|
; Function heads and guards have no body at all, so `keywords` and `do_block` nodes are both optional
|
||
|
((call
|
||
|
target: (identifier) @_keyword
|
||
|
(arguments
|
||
|
[
|
||
|
(call
|
||
|
(arguments (_)? @parameter.inside))
|
||
|
; function has a guard
|
||
|
(binary_operator
|
||
|
left:
|
||
|
(call
|
||
|
(arguments (_)? @parameter.inside)))
|
||
|
]
|
||
|
; body is "do: body" instead of a do-block
|
||
|
(keywords
|
||
|
(pair
|
||
|
value: (_) @function.inside))?)?
|
||
|
(do_block (_)* @function.inside)?)
|
||
|
(#match? @_keyword "^(def|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp|defp|test|describe|setup)$")) @function.around
|
||
|
|
||
|
(anonymous_function
|
||
|
(stab_clause right: (body) @function.inside)) @function.around
|
||
|
|
||
|
((call
|
||
|
target: (identifier) @_keyword
|
||
|
(do_block (_)* @class.inside))
|
||
|
(#match? @_keyword "^(defmodule|defprotocol|defimpl)$")) @class.around
|