atom / language-ruby-on-rails

Ruby on Rails package for Atom
Other
48 stars 41 forks source link

About snippets in erb, it does not work. #3

Closed haitaoxu closed 10 years ago

haitaoxu commented 10 years ago

In the .erb file, I input "if" and then click 'tab' button, but it's not change to "<% if xxx %>"

ScottRadcliff commented 10 years ago

I needed to make sure my syntax was correct. By default, my setup was using Ruby and wasn't picking up on erb stuff. Unfortunately, there is not a way to do this from the command palette yet.

Click on the syntax in the bottom left corner and select the Rails syntax.

capture

haitaoxu commented 10 years ago

@ScottRadcliff Thx, But there is another question working with emmet plugin, In the erb file, I use the HTML(Rails) syntax. When I input 'if' and key up 'tab' key, It expect "<%if conditons %>", but in fact it shows " ".

May be I should report this to emmet developer ?

ScottRadcliff commented 10 years ago

Yep. I think your issue is in the wrong place.

toctan commented 10 years ago

@ScottRadcliff Every time I open a ruby or erb files I have to change to Rails syntax manually? Should not this be done automatically?

ScottRadcliff commented 10 years ago

@toctan I totally agree. For now, I am using Shift-Ctrl-L.

You might have better luck posting bugs/concerns on the feedback site http://discuss.atom.io/

seantaylor commented 10 years ago

Yeah some of the commands are working for me, ex, - + tab will insert <% %> as expected but "if" tab is also not working for me. I checked to make sure it was picking up my erb file as html (Ruby- ERB), but it still doesn't seem to work.

amnwebmaster commented 10 years ago

This seems to happen because the "Language Ruby" package also has grammar for the html.erb file type. As a temp fix you can edit the Language Ruby package (Preferences > Language Ruby > Open in Atom) and in grammars either remove the file html(ruby - erb).json or edit it.

Hopefully they'll provide a solution soon though..

nathansobo commented 10 years ago

For reference: atom/atom#1831

We need to add the ability to match on directory structure to Atom grammars so that Rails is treated as more specific than Ruby. If anyone is interested in helping out with that, that would be awesome.

nathansobo commented 10 years ago

I moved the issue mentioned above to https://github.com/atom/first-mate/issues/17 and provided a bit of guidance as to how someone could help us fix this.

probablycorey commented 10 years ago

I closed this because it looks like it was moved to first-mate

TangMonk commented 9 years ago

@amnwebmaster

Hi, I cannot found Open in Atom In Atom 1.0.5

amingilani commented 8 years ago

@amnwebmaster

Like @TangMonk said, I can't Open in Atom anymore. Any ideas?