RubyMine 2018.2 EAP is Open: Attach to Remote Processes With the Debugger, and More!
Today we are opening the Early Access Program for RubyMine 2018.2. As making RubyMine more integral and robust is currently our top priority, in this release cycle we are staying focused on upgrading and polishing existing features and subsystems. Here’s what we are ready to give you in the first EAP build:
- Attach to remote processes with the debugger
- Polymorphic associations
- Autocompletion for blocks
- A better Run anything
- Remote SDK improvements
- Other improvements
Attach to remote processes with the debugger
In v2016.3, we announced the ability to attach to local processes with the RubyMine debugger. In this EAP we’re adding the highly desirable ability to attach to remotely running processes. This means you can now tuck the debugger into a running production process without restarting, and troubleshoot it without any additional configurations.
In order to attach to the server’s process, you’ll need an SSH connection to its host. Let’s set up an SSH remote Ruby SDK in the settings (Preferences/Settings | Ruby SDK and Gems | New Remote | SSH Credentials):
It’s recommended (though not required), that you map the app running on the remote machine with its local copy. This will allow you to set a breakpoint anywhere in the app and investigate its execution at a specific point.
To configure mappings, simply click the Edit Path Mappings icon:
Apply the newly added remote SDK:
Set a breakpoint, go to Run | Attach to Process, and find the required process on the remote machine:
Now the debugger is attached to the remotely running app, and it will grasp the execution at the breakpoint once a related action is hit on the remote server:
Please follow the related ticket for any issues and suggestions: [RUBY-18487]
We aim to continuously improve code navigation in each major release. As such, starting with this EAP, RubyMine correctly recognizes and navigates (Ctrl/Cmd + Click) to definitions and usages of models that use polymorphic associations:
Autocompletion for abstract model names also becomes available if a polymorphic association is defined in the project:
Please add any comments to the related ticket if you encounter any problems.
Autocompletion for blocks
Autocompletion is another core feature of RubyMine that is being constantly improved. In this build you will discover smarter autocompletion for blocks.
When you type `.` after the array, press Tab or Enter to choose `.each` from the completion list. RubyMine will fill out the rest of the statement, and move the caret inside the vertical bars (|’s) to let you provide a block parameter:
As you can see in the gif, the IDE will also offer you to quickly choose between curly braces and `do..end` blocks in place. However, you can switch between inline and multi-line blocks at any time later, by using the related intention action (Alt+Enter):
Note that while this feature already works in this build, it’s still being polished. Please let us know of any issues you stumble upon, if you that is.
A better Run anything
Run in context
In v2018.1 we introduced the new Run anything action that allows you to literally run any command or configuration, or even debug the latter. However, one Run anything option wasn’t covered before: its ability to run scripts in the current context.
By default, Run anything looks for a script in the project root, so you’d have to specify a path if a script you want to run is located in a different directory. Luckily, you can avoid all the excessive typing by pressing Alt, which makes Run anything look for a script in the context of the file that is currently opened in the editor, project dir, or navigation bar:
Debug in context
The new EAP build also features an ability to debug scripts in the current context. To do that, hold Alt+Shift after you have called Run anything:
Related issue: [RUBY-21275]
This build also fixes the inability to stop IRB/Rails consoles launched via Run anything [RUBY-20898], and provides other bug-fixes for Run anything.
Remote SDK improvements
Remote SDK synchronization
We’ve added an option to manually update gems for an active remote SDK, which may come in handy if, for instance, a Docker image was updated outside of the IDE, or a Vagrant machine was restored.
If you ever find yourself in a situation like that, go to Preferences/Settings | Languages & Frameworks | Ruby SDK and Gems, and click on the related icon to force RubyMine to hook up the new gems:
Related issue: [RUBY-21511]
Background SDK loading
You will also discover that configuring of remote interpreters has become smoother as we hid some excessive pop-ups in the background:
Related issue: [RUBY-19834]
- Added navigation to definitions of Cucumber Expression params [RUBY-21278]
- Fixed unidentified `td` in Slim [RUBY-21069]
- Fixed freezing issues [RUBY-20952]
- Fixed drag & drop from Finder [RUBY-21383]
- Other improvements and bug-fixes