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.
请先登录再写评论。
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.
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
Instead of just this
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
when I would have preferred to see a scaffold like this
can you confirm that the only way to get the result i want is with Live Template?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
Thanks for confirming Olga.
It is appreciated.