Closed darrenterhune closed 7 years ago
Wow thanks! I'll give it a go tomorrow. My issue was with 'do'. Does this take care of that and all the other language constructs that have an 'end' like 'unless', 'while', etc? Apologies again for my ignorance about how snippets work.
You can pretty much copy the code and replicate what's there for anything e.g. do
, while
, for
. I'll wait on reply from @ezekg before I add anything else.
This is great. I'd like to add support for do
, while
, for
, etc. before merging.
Sounds good, I'll get it added today when I have a minute. Is there anything else other than do
, while
and for
that I'm not remembering?
You can find them by searching for 'end' in the parent snippets: https://github.com/atom/language-ruby/blob/master/snippets/language-ruby.cson
I think these are all the remaining ones from the core language - I don't know if some of the other specialized ones that include a 'do' will also fire (e.g. 'Benchmark.bmbm do .. end'):
I'm wondering why anyone would write begin
, class
, def
, module
etc in haml? I don't think those ones would be needed honestly.
Maybe they're former PHP developers? ;)
Certainly would be unorthodox, but right now if someone does do it the snippet inserts an invalid 'end'.
Awesome. I would go ahead and do all of them, just in case.
K I've added everything my language-ruby
package has that prints out end
. If I missed anything, feel free to ping me in the future if you need help.
Thanks a lot @darrenterhune. Cut v0.25 with the new snippets. 👌
This has been bothering me for a while. But not enough to ever cause me to fix the problem. This does fix the problem of over-riding ruby's
if
statements although I'm not positive this is correct way to do it.@pedantic-git to fix your issue quickly you can open your atom config folder and drop this into
~/.atom/snippets.cson
or just the~/.atom/packages/language-haml/snippets/language-haml.cson
and when/if this gets merged or updated and merged it'll just over-ride and continue working.@ezekg let me know if you'd like this fixed or changed?
refs #63