

RubyMine provides a tool to generate simple signature prototypes from your Ruby code. RubyMine will split them on the :: symbol and create the surrounding modules for all qualifiers. You can use qualified names when creating a new RBS file. Press Alt+Insert and select RBS File/Class from the popup.Īs another option, select File | New | RBS File/Class from the main menu. In the Project view Alt+1, select the directory where you want to create a new RBS file. Parameter assignments in methods and blocks The inspections are available for:Īssignments to instance and class variables (including instance variables in singleton classes/methods) You can manage these warnings using the Mismatched type inspections. RubyMine warns you when you try to use types that don't agree with the types from RBS files. To invoke the Parameter info popup explicitly, go to View | Parameter Info Ctrl+P. By default, RubyMine shows the popup automatically after you type an opening bracket in the editor, or select a method from the list of suggestions. RubyMine uses RBS signatures to display types of method parameters in the Parameter info popup. To view the element type, place the caret at the desired Ruby element and go to View | Type Info Ctrl+Shift+P. Having RBS signatures provided, RubyMine uses them to determine types of Ruby elements. When RubyMine utilizes RBS, it will only suggest renaming relevant entities instead of showing all potential options.

When you invoke the 'Refactor' action, RubyMine instantly finds usages of the corresponding declaration instead of giving you a list of declarations to choose from. With RBS types, RubyMine can find the correct declaration of a Ruby element. Search for usages of the corresponding declaration When you invoke the 'Go to declaration' action, RubyMine navigates you to the exact declaration instead of providing a list of declarations to choose from. RubyMine displays methods from appropriate classes at the beginning of the list, when invoking code completion.

If you have RBS files in your project, RubyMine provides: This helps you to experience better code insight when developing your code in Ruby. RubyMine supports RBS type signatures and uses them to determine the type of Ruby elements. In this scenario, RubyMine will determine which type signatures will be loaded and used for code insight. RubyMine can also work with your rbs_ file. When you use RBS in your project, RubyMine displays its sources in external libraries. RBS provides a set of built-in type signatures for the standard libraries out-of-the-box. rbs files and provides the following coding assistance: RubyMine supports the RBS language to describe the types used in Ruby programs.
