What’s mining: Introduce parameter for Ruby is coming
We’ve just celebrated RubyMine 3.0 release here but already working hard on a new stuff for you.
And today I want to make a what’s mining-like post and a new feature I want to show is Introduce Parameter refactoring for Ruby. RubyMine supports wide range of different Ruby code refactorings: you can easily introduce variable, field, etc., and introduce parameter refactoring is on the list now! You’ll be able to try it soon enough once we open RubyMine 3.1 Early Access.
So, let me show you how it works with a couple of screenshots!
- Consider that you have the following piece of code, and you want to introduce a parameter for the message text. Just select the desired piece of code and invoke Refactor | Introduce Parameter menu action.
- In the Introduce Parameter dialog you can edit the desired parameter name and RubyMine will automatically check if the selected name is valid and even that it won’t interfere with any local variables existing in the method scope.
- Ruby is quite a magical language, full of DSLs, and RubyMine not always can cope with it. However, you can always preview the refactoring result before it is actually performed to ensure that you won’t break anything. Here is a preview for the above example:
- As you can see RubyMine is smart enough to find all the super methods and to prompt to update their signatures too. Even text base usages are found and shown. Let’s finally perform the refactoring by pressing Do Refactor button and voila, here is a result code.
That’s all for now. Stay tuned for RubyMine 3.1 announcement to try this feature.
P.S. Also see the full RubyMine 3.1 roadmap to see what else is mining.
Develop with pleasure!
– JetBrains RubyMine Team
Subscribe to Blog updates
Thanks, we've got you!
The RubyMine 2023.3 Early Access Program Is Open!
Hello everyone, The third RubyMine Early Access Program of 2023 is underway! The key change in the first EAP build is an important indexing optimization. By refactoring our code base, we’ve doubled RubyMine’s indexing speed compared to v2023.1. This is particularly noticeable when working wi…
Performance Improvements in RubyMine 2023.1
Hello everybody, The new release is fast approaching, so it’s time to unveil the performance enhancements you can expect from RubyMine 2023.1. Faster code completion When developing and supporting RubyMine, we analyze a great load of anonymized usage data. A lot of recent data pointed to the fact t…
RubyMine 2023.1 EAP5 Is Out!
Hello everyone, RubyMine 2023.1 EAP5 is now available! Below you can find the most notable features in this build. We encourage you to try them out and share your feedback in the comments or in our issue tracker. Migration of Ruby code to the Symbol API In order to improve code insight actions such…
The RubyMine 2023.1 EAP2 Is Out!
The RubyMine 2023.1 Early Access Program recently started and EAP2 is already here! You can get the new build from our website or via the free Toolbox App. In this post, we’ll highlight some of the most important updates included in the new EAP version. Rails 7: support for turbo-rails complet…