Code Completion in ERB and minitest

Hello I do not know if I am doing something wrong but is there a way to generate code completion on erb and minitest.

An example

typing form would generate

<%= form_with do |form| %>
  Form contents
<% end %>

or in a test

assert. 

would show the different asserts that could be used?

If it is not natively integrated is there a way to import it?

Thank you.

4 comments
Comment actions Permalink

Could you please provide more details about the completion you'd like to have in ERB? As for MiniTest, it provides the completion for assert in case the gem is added to the Gemfile.

0
Comment actions Permalink

Hello Olga,

Thanks for your answer.

I have seen those suggestions for assert but i just find that they stop short.

When selecting "assert_equal" for example it would just complete it. I thought i would get a scaffold of the assert_equal like this

I would have liked to see this

assert_equal(exp, act, msg = nil)

Instead of just this

assert_equal

But I found the live templates and i saw different abbreviations for asserts. I customizing them so they behave the way i would like. It is just more work and I though this would have been taken care of.

For erb, i thought that helpers like form would behave as stated above. I will just create a Live Template for it.

Basically right now, if i type form_with and i select to autocomplete it

I just see this

form_with

when I would have preferred to see a scaffold like this

<%= form_with do |form| %>
  Form contents
<% end %>

can you confirm that the only way to get the result i want is with Live Template?

0
Comment actions Permalink

Yes, at the moment that's the only option but you're welcome to submit a corresponding feature request on our tracker: 

https://youtrack.jetbrains.com/issues/RUBY

0
Comment actions Permalink

Thanks for confirming Olga.

It is appreciated.

0

Please sign in to leave a comment.