atom / language-ruby-on-rails

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

Ruby do block autocomplete (in most cases?) counter productive #37

Closed TheNotary closed 8 years ago

TheNotary commented 9 years ago

I'm filling out some unit test files, and I keep having to manually remove a |member| symbol that gets auto completed whenever I start a do block. It winds up looking like this

it "should work" do |member|

end

It might be nice to be able prevent this autocomplete behavior. Also, as that I've been looking into the matter, I've found a decent workaround to be to hit tab twice (which highlights the |member| symbol) and then hit enter to overwrite it with a new line character. Maybe adding a suggestion to "hit tab" on the tool tip would be an acceptable enhancement alternatively.

dankimio commented 8 years ago

@TheNotary This is likely a language-ruby issue. Now the default snippet in language-ruby for do is do end, there's also a dop snippet which is the same block but with an argument.

lee-dohm commented 8 years ago

I agree with @itsdan, this was fixed by https://github.com/atom/language-ruby/pull/108. If there is another suggestion, please open an Issue on the language-ruby package.

TheNotary commented 8 years ago

This is great news! I'm pretty sure I tried disabling/ enabling addons till I found this one to be the culprit, but apparently it was language-ruby all along @.@

asselstine commented 8 years ago

In the version I'm using (0.65.0) the snippet trigger 'dop' take precedence over 'do', so it still adds pipes and an arg when you hit return to go to the newline. It's extremely annoying; I would love to be able to edit the snippet triggers and remove it, or fix the precendence.

50Wliu commented 8 years ago

@asselstine As a temporary workaround you can disable the "Use Alternate Scoring" option in the autocomplete-plus settings.