elixir-editors / language-elixir

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

support for 'describe' and 'test' #106

Closed adam-pog closed 6 years ago

adam-pog commented 6 years ago

While 'describe' and 'test' are ExUnit macros, I noticed you already have snippet support for them. Are you planning on adding them to the grammar to support highlighting / would you accept a PR for it?

keathley commented 6 years ago

I think this would be reasonable. What are you expecting to see them highlighted as?

adam-pog commented 6 years ago

I would expect them to highlight the same as def, defmodule, if, etc. They seem to fit the same role as other 'control' keywords that encapsulate some related section of code.

keathley commented 6 years ago

I think that could make sense. My only argument against this is that test and describe are really just macros. They're provided by ExUnit but otherwise they aren't really that special. Given that we don't highlight any other macros in this way I'm not sure it makes sense to do it here. That being said I don't feel super strongly about it. What do you think about that reasoning @adam-pog?

adam-pog commented 6 years ago

@keathley Yeah that makes sense, and I also don't feel very strongly about it. I know many other testing frameworks have their own packages, but wasn't sure if ExUnit would be treated differently since it ships with elixir. I figured i'd check here first before going out of my way to make a specific 'language-exunit' package.

keathley commented 6 years ago

I believe that the vim and emacs packages include the support for describe and test so I guess the precedent has already been set. We should probably support this as well.

keathley commented 6 years ago

This has been published.