elixir-editors / language-elixir

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

Comment variables starting with underscore #64

Closed almightycouch closed 8 years ago

almightycouch commented 8 years ago

A variable starting with an underscore is meant to be ignored. The Elixir compiler warns the user if he tries to use such a variable or if an unused variable is not starting with _.

Other editors highlights a variable starting with an underscore as commented. It makes it clear that the variable is unused.

Would be nice to have this in Atom too.

keathley commented 8 years ago

I like this idea. Do you know if this is a common pattern in atom? It seems like a quick solution might be to tokenize underscored variables as comments, but I'm not sure what sort of side effects that might have. If that doesn't work then we might have to supply a basic style for "unused" variables that uses the current themes @mono color.

keathley commented 8 years ago

@almightycouch I've opened a PR that may address this. So far its looking OK to me. I'm still not sure if marking a variable as a comment is going to have any weird side effects though. If you'd like to pull down the branch and try it out locally that would be👌.

keathley commented 8 years ago

@almightycouch This has been merged. Let me know if you have any other issues.

almightycouch commented 8 years ago

Works and looks great!

👍