elixir-editors / language-elixir

Elixir language support for the Atom editor.
Other
181 stars 40 forks source link

Basic matching for function definitions #34

Closed keathley closed 8 years ago

keathley commented 8 years ago

Highlight function declarations properly. Later we can use this initial pattern to match arguments to functions as well.

screenshot 2016-02-05 22 58 19

Currently this only matches def and defp. It would also make sense to match defmacro and defmacrop. The match works for both function and macro definitions.

As part of this change I've also updated the function and macro snippets to add a default name. Without this the match registers the do as the definition which can look odd. Adding an default name conveniently solves this issue while also being more explicit.