Sorbet
Add the 'sorbet' and 'sorbet-runtime' gems to your Gemfile and install them to your project SDK
RubyMine recognizes Sorbet type signatures stored in .rbi files. RubyMine can utilize them to determine types of Ruby objects and check if method arguments or return values match their signatures.
To view the object type, place the caret at the desired Ruby object and go to View | Type Info CtrlShift0P in the main menu.
RubyMine warns you when you try to use method arguments or return values with the types that don't agree with the corresponding Sorbet signatures. You can manage these warnings using the Mismatched argument type and Mismatched return type inspections.
RubyMine enables you to navigate from a Ruby declaration to its type signature, and vice versa.
Select a Ruby declaration and go to Navigate | Type Signature in the main menu to navigate to its type signature.
Gif
Select a type signature and go to Navigate | Associated Declaration in the main menu to navigate to the associated Ruby declaration.
Gif
tip
These actions come without default shortcuts. If you use them frequently, consider assigning your own shortcuts.
In the Settings dialog (CtrlAlt0S) , select Keymap.
Find the
Go to Type Signature or Associated Declaration
action using the search field. Double-click the action to set a shortcut for it.
Thanks for your feedback!