A new way to review problems in code, 27 new intention actions, support for Liquid, full support for GitHub pull requests, and many more new features for Ruby, Rails, JS, and database tools.
We’ve added a new widget that shows the number of issues in the current file. Clicking it opens a tool window with a list of those issues. From there, you can jump to the code containing an issue, or you can fix issues directly from the tool window.
RubyMine 2020.2 includes basic support for the Liquid template language. The IDE will show you if there are any issues with the syntax, provide live templates to insert frequently used constructions, and reformat the code according to the requirements you’ve specified in the Code Style settings.
Save yourself time when coding!
RubyMine 2020.2 comes with a load of new intention actions that you can use (Alt+Enter) to quickly optimize your code.
With the Invert ‘if-else’ action, you are able to flip an if-else operator so that the condition is negated and the branches are switched. For ternary operators, there’s the Flip ‘?:’ intention action which works the same way.
Use the Merge nested ‘if’ action to merge a nested statement into a boolean
expression. To invoke this action, place the caret on the outer if
of the
expression.
Split into multiple ‘ifs’ performs the opposite action, and is available with the caret on the boolean operator.
With the Merge ‘else if’ and Split ‘elsif’ intention actions, you can
split an elsif
statement into a nested else/if
branch and vice
versa.
The Merge/split sequential ‘if’s action is available on the elsif
or
if
keywords. It suggests merging two branches if the code inside these
branches is exactly the same. RubyMine will then combine the two conditions using an
||
operator and add parentheses if necessary. The Split into multiple
‘if’s action will do the opposite.
These intention actions will expand lines with the ::
scope resolution
operators into nested modules and vise versa. Note that the Flatten namespace
action will flatten the modules above it.
Use this intention action to sort hashes alphabetically by their key. It also works for hashes with different key types. In this case, the keys are grouped by their type and then sorted.
The Add clarifying parentheses intention action works for binary and ternary expressions. It adds parentheses to complex expressions that rely on operator precedence, in order to clarify how the expression should be evaluated. You can also call Remove unnecessary parentheses.
The Add underscores action adds underscores for large numbers to aid readability. The
supported types are integer/float/octal
(adds an underscore every 3 digits) and
hexadecimal/binary
(puts underscores every 4 characters/digits).
You can call the Remove underscores action on numbers with underscores.
Use this intention action to introduce a new local variable when the caret is placed on an expression.
This intention action is useful during refactoring in cases where you find yourself left with a variable that is only used once.
You can now convert block comments into line comments and vice versa. Note that these actions are only available for comments that begin at the start of the line, as block comments require this.
For folded constructs, like if
, while
, and for
,
RubyMine now displays the condition or variables used in the first line. This approach
makes it easier to see whether you need to unfold the construct and look into it.
Reading RDoc or YARD docs in the editor can be annoying because of all the tags you have to wade through, especially when you need to interact with the reference links and images. This is why we’re adding a way to render documentation directly in the editor.
Enable this feature through Preferences/Settings | Editor | General | Appearance | Render documentation comments.
RubyMine now supports heredoc injections that allow you to define a multiline string while maintaining the original formatting and indentation. Use it to embed snippets of code, like HTML or SQL.
You can now navigate between the super and overriding methods by calling an intention action or by clicking the icon in the gutter.
As always, RubyMine supports the latest version of Ruby. For example, RubyMine v2020.2 supports beginless ranges, which were introduced in Ruby 2.7.
RubyMine now suggests much more accurate completion for a variety of standard library
methods,
including Array#sort_by
, Hash#each
, and many others.
You can now easily convert named parameters into numbered ones, introduced in Ruby 2.7. Place the caret over any named parameter, press Alt+Enter, and pick the Convert named parameters to numbered intention action. The Convert numbered parameters to named action will do the opposite.
With the new intention actions, you can easily add an attribute accessor, reader, or writer to instance variables. To do so, place the caret on a variable, and press Alt+Enter.
In Rails applications that use lazy keys (lazy lookups), this intention action will automatically expand the key to its full form. If there’s a lazy key in a controller, the intention may ask which lazy key to expand it to (as there can be multiple options).
You no longer need to switch between the browser and your IDE. The entire pull request workflow can now be completed from within RubyMine!
With v2020.2, you can browse, assign, manage, and even merge pull requests, view the timeline and in-line comments, submit comments and reviews, and accept changes.
The Merge, Pull, and Rebase Git dialogs now have better visual consistency and less clutter. With the new design, you can quickly see which Git command will be executed.
We’ve also added the –rebase
option to the Pull dialog and the
–no-verify
option to the Merge dialog.
New smart intentions (Alt+Enter) will help you perform some
actions faster. For example, you can now quickly convert a for
loop with a
numeric index into a forEach
array method. Looking through documentation
comments in JavaScript and TypeScript files has also become easier, as you can now
render them directly in the editor, minimizing all distractions.
Want to use Prettier instead of the built-in formatter to tidy up your code? With this
update, it has become even easier than before. Just tick the new On code reformat
checkbox and the IDE will use Prettier whenever you reformat your .js
,
.ts
, .jsx
, and .tsx
files. Other file types can
be easily added, too.
In the past year, we’ve added Nuxt.js support, Vue-specific code style settings, improvements for Vue in TypeScript projects, and a lot of other things. Vue support in RubyMine has never been so advanced!
Now if you have a huge value in your cell, you can view or edit it in a separate panel. You can also toggle soft wrap mode using the right-hand toolbar.
There’s now a more user-friendly way to view and edit boolean values. True values are now marked with a bullet point to distinguish them from all the others.
Editing:
f
, t
, d
, n
,
g
, or c
will input the corresponding values:
false
, true
, default
, null
,
generated
, and computed
.
Array.to_h()
, Dir.each()
, and others.
not
call in active record relation chains.
Now when no arguments are provided for a where
method, RubyMine will offer
not
as a completion.