RubyMine: Close look on Code Insight

For those who are using Ruby or Rails for development, you might have encountered RubyMine.

RubyMine is a specific IDE for Ruby and Rails that was created by JetBrains. It has been 10 years since it was created and has a well-established user base. Nevertheless, a common question that arises during industry events and shows is: “What does RubyMine do that a text editor cannot do?”

The answer is simple: There is a lot that RubyMine can do. One key feature that makes RubyMine stand out from the rest is Code Insight.

With Code Insight, it includes several elements such as smart code completion, in-editor documentation, code navigation, language-specific inspections with quick-fixes, and smart notifications.

Let us take a close look at each of these features to get the most out of your work.

Automatic Code Completion

With this feature, it is present in all popular editors but what makes it different is that RubyMine’s auto-complete feature is not restricted to only Ruby/Rails in-built keywords and text auto-complete function.

As the IDE catalogs your project during every startup, it can automatically complete almost any pertinent unit irrespective of where it is defined. You no longer need to open a file in a different tab to autocomplete any type of declarations from it. Remember that RubyMine knows everything regarding your project.

In case you are creating a new table, RubyMine will provide possible autocompletion options of applicable column types and elements you are likely to expect.

If you want access to the columns later when working on a model, the IDE will do it the same manner as it autocompletes all the built-in Rails stuff.

It can also autocomplete methods that were earlier defined in the model. The IDE will not provide autocomplete options for column labels where you expect to find methods that were demarcated in the specific model and vice versa. Remember that this is a vital feature that makes this RubyMine feature different from other editors.

Furthermore, you can handle your views, in the same manner, generally all the specified entities in the project you are working on.

Go to declaration (Go to definition)

Generally, a favored feature of RubyMine is the “Go to declaration”. There is no doubt that the IDE proved to be more efficient when navigating to declarations.

Simply use ⌘+Click and jump to the definition that you need. This not only allows easy access to a method, class or any other entity declaration, but you can also navigate to gems and their entities’ definitions.

Static Analysis

Atom has a solid syntax highlighting feature where you will not miss a closing tag or end which makes it a must-have. There is also an efficient plugin that underlies all RuboCop offenses and even allows you to automatically correct offenses for the file.

Just recently, this kind of RuboCop support is as good as the one in RubyMine. With the latest release of RubyMine 2017.3, you will not only fix the whole file with RuboCop, but even select whether you want to autocorrect all possible offenses, specific cop department or a specific offense type. All this is available out of the box on the editor and by simply pressing Alt+Enter.

As with the syntax assessment, RubyMine is clever enough to supply basic syntax highlighting for Rails, Ruby, HTML, JavaScript, ERB, CSS and many more. On top of all, the IDE has several of its own beneficial intentions such as the capability to convert do … endblocks to {} or alter statements to trailing conditionals.

Aside from static analysis, RubyMine also provides a built-in RegExp checker. Just like with other inspections and intentions, they can be found and easily disabled or enabled in the settings.

Another tool of Code Insight is Parameter name hints. As the name suggests, it helps you understand the name of the argument you are passing to a method.

Smart notifications and actions

RubyMine also provides smart notifications that will help users with their routine tasks such as configuring detected data sources or operating ‘bundle install’ after adding a new gem.

There are also several multiple-stage actions which are highly beneficial. One example is a shortcut of RubyMine for quick routing between a Rails entity.

Quick documentation

Lastly, RubyMine comes with in-editor quick documentation for any present Ruby/Rails entities as well as units present in the application. This simply means that you no longer need to surf the Internet every time you encounter some alias or search the entire application for a method declaration you cannot recall.

Simply key in the caret on a keyword you are looking up and hit F1. The best part is that it also works from the autocompletion list.

Conclusion

The abilities mentioned above include the stack of Code Insight structures in RubyMine but there are other features that you will surely love in the IDE such as safe refactorings, a variety of navigation options and a GUI-based debugger as well as testing suites.

If you find these features appealing, take the leap and download RubyMine and use it for free for a month.

Leave a Reply

Your email address will not be published. Required fields are marked *