📜 ⬆️ ⬇️

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 code completion
Rendering of the charts in markown
Improved code analysis
Chruby support and enhancements for Ruby version managers
Restart Fallen Tests
Yaml
Attaching a debugger to remote processes
Javascript
Git
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, 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 simply put an end 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 the puml in front of the chart code in the .md file 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 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.



The new feature is also available when using presets like rake test and rake spec .

Yaml


YAML support has been greatly expanded for all IDE based on IntelliJ. First of all, we added the ability to format the code in .yml files. 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 Process or find the corresponding action by calling the Find Action window ( Help | Find Action ), as indicated in the picture:



Read more about debugging remote processes in our blog .


Javascript



Learn more about JavaScript improvements in the video:



Git


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 press Commit and Push (|K | Ctrl + Alt + K) at the next commit in the Commit Changes dialog, the IDE will not additionally display the Push dialog, but will 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.

Source: https://habr.com/ru/post/418931/


All Articles