Search code examples
ruby-on-railsrubyautocompleteiderubymine

RubyMine code autocompletion


I'm about to get used to work with Java in Android Studio. The great thing there is that everything is strongly declared. So when I type MyClass.someme..., the IDE offers me advanced code autocompletion features. The development is rapid and pleasantly.

But then I wanted to learn RubyOnRails. I'm in love with JetBrains products and so I've installed RubyMine on my Windows machine.

Despite of a bag of problems with Windows enviroment, I was confused with not-so-well working code completion. Even if the method is known by the IDE (it can be found by Ctrl+B combination), it does not offer it in popup menu (discover the picture).

Function from railstutorial.org:

# SomeControllerHelper.rb
# Redirects to stored location (or to the default)
def redirect_back_or (default)
  redirect_to(session[:forwarding_url] || default)
  session.delete(:forwarding_url)
end

Why, RubyMine?

Is there any way to fix this problem? Are there any better IDEs with really smart code completion?


Solution

  • Although, RubyMine doesn't work for ALL code completion all the time due to the dynamic nature of Ruby. But, I still find it the BEST Ruby IDE for code completion, method navigation, searching features.

    Here is a screenshot to show you how to configure RubyMine for Code Completion:

    enter image description here

    Here is a good tutorial by Justin Gordon which shows some awesome features of RubyMine which may interest you.

    I don't know any other Ruby IDE that has smarter code completion than RubyMine. In fact, a vast majority of Ruby programmers doesn't even use an IDE, rather they use a Text Editor!

    Here are couple of short sitepoint articles that would give you more insights:

    Which IDEs do Rubyists Use?

    What Editor Do Rubyists Use?