RubyMine 2018.2: attaching a debugger to remote processes, chruby, improved code analysis, and more

    Hi, Habr!

    The season of IDE summer updates based on IntelliJ continues, and in this series we will tell you what RubyMine learned new in versions 2018.1 and RubyMine 2018.2 released recently .

    Table of contents

    Run / Debug Anything
    Postfix add-on code
    Rendering diagrams in Marcown
    Improved code analysis
    Support for chruby and improvements for Ruby version managers
    Restarting dropped
    YAML tests Attaching a
    debugger to remote
    JavaScript processes
    Something else

    Run / Debug Anything

    Discussion in our user Slack chat led to the creation of a convenient tool for running various configurations and commands - Run Anything . Its principle of operation is somewhat similar to Search Everywhere . However, instead of searching for anything, Run Anything by double-clicking Ctrl allows you to run anything: rake-task rails s, tests and other configurations, as well as console commands.

    Moreover, if Shift is held down while Run Anything is called , the tool will switch to the Debug Anything mode , which allows you to conveniently launch the debugger.

    By the way, as you can see, RubyMine remembers previously launched commands and scripts and in the future will offer them in a drop-down list. More details .

    Postfix code completion

    This feature allows you to modify, flip and add expressions without having to return to the beginning of the line in order, for example, to insert a condition. Now you can just put a point and choose if. The IDE will place the condition at the beginning of the line automatically. If there are several possible options, then RubyMine will offer to select the desired one from the list.

    A full list of supported postfix templates can be found in the settings ( Preferences / Settings | Editor | General | Postfix Completion ). You can also disable irrelevant. More details .

    Rendering of the charts in markown

    Preview of the markaun-files has learned how to draw diagrams that are in the code. Paste pumlin front of the chart code in the .mdfile, so that RubyMine picks up the syntax and displays the chart in the preview. More details .

    Note that Markdown support is provided via a plugin that is compatible with other IDEs from JetBrains. The RubyMine and IntelliJ IDEA Ultimate plugin is installed by default.

    Improved code analysis

    We have essentially rewritten type inference and the mechanism for analyzing Ruby files. Thanks to this, autocompletion and code navigation has been significantly improved.

    As you can see in the image, a new action has appeared for viewing the type of the variable. You can call it by pressing Ctrl + Shift + P ( View | Expression Type ). More details .

    Also in the new release is available autocompletion and navigation to models with polymorphic connections. More details .

    Chruby support and enhancements for Ruby version managers

    The new version adds support for chruby and asdf. At the same time, all supported version managers (RVM, rbenv, chruby, and asdf) became available when connecting via WSL, Docker, as well as via SSH and other remote connections.

    Recall that you can configure the remote SDK as follows: Preferences / Settings | Languages ​​& Frameworks | Ruby SDK and Gems | New remote .

    Restart Fallen Tests

    Now, after running the tests, you can restart separately only those that have not passed. Just click on the appropriate icon.

    New feature is also available when using presets like rake testand rake spec.


    YAML support has been greatly expanded for all IDE based on IntelliJ. First of all, we added the ability to format the code in files .yml. To format, use the key combination ⌥⌘L / Ctrl + Alt + L ( Code | Reformat Code ). More details .

    Code navigation, autocompletion, and search for anchors ( &) and their links ( *) appeared.

    Also, anchors and links can be renamed into one action ( Shift + F6 ). To avoid conflicts, the IDE will warn you that you are trying to use the name of an already existing anchor. More details .

    Other improvements include JSON Schema support for autocompleting relevant configurations in YAML, as well as the ability to copy the path to a value in YAML files. More details .

    Attaching a debugger to remote processes

    In version 2016.3, we announced the possibility of attaching a debugger to running local processes and promised to add the ability to attach to remote ones. In the latest version, we realized the promise!

    To begin debugging, connect to a remote server via SSH ( Preferences / Settings | Ruby SDK and Gems | New Remote | SSH Credentials ). Be sure to include the path to the Ruby interpreter.

    Additionally, you can associate a local version of the application with the one running on the server ( Edit Path Mappings ). This will simplify the breakpoint distribution anywhere in the application for further debugging.

    Now you are ready to debug remote processes! To start, select Run | Attach to Processor find the corresponding action by calling the Find Action window ( Help | Find Action ), as indicated in the picture:

    Read more about setting up debugging of remote processes in our blog .


    • Added a set of new quick code additions ( Alt + Enter ) for JavaScript and TypeScript: Implement interface, Generate cases for 'switch' and others.
    • All new features of TypeScript 2.9 and TypeScript 3.0 are now available in the IDE.
    • Added Annotate with type from JSDoc and other quick fixes from TypeScript Language Service.
    • Now it is possible to extract React components ( Refactor | Extract Component ) and convert class components into functional ones (and vice versa).
    • .vueAuto-completion for the events and their handlers became available in the files .

    Learn more about JavaScript improvements in the video:


    Files containing conflicts are now conveniently grouped under the item Merge Conflicts . By clicking on Resolve, you are expected to be taken to the Files Merged with Conflicts dialog .

    Another new convenient option, Browse repository at revision , allows you to view earlier versions of the repository. You can activate the option by calling the context menu on the required commit in the Git-log. The IDE opens the Project tool window, from which you can go to viewing earlier versions of the application files.

    In the new version, you can commit changes, bypassing the Push dialog . To do this, uncheck the corresponding checkbox in Preferences / Settings | Version Control | Git . If you pressCommit and Push (⌥⌘K | Ctrl + Alt + K) at the next commit in the Commit Changes dialog , the IDE will not additionally display the Push dialog , and immediately send the changes to the repository.

    Something else

    In the new version, you will also find improved CoffeeScript, the ability to use different GitHub accounts, updated icons and support for the MacBooks touchbar.

    Download the new version on the What's new page . We remind you that the first 30 days you can use RubyMine for free.

    Also popular now: