RubyMine 2016.2 Help

Part 1. Finding a File, Class or Symbol by Name

On this page:

Preparing an example

Add a Ruby file to your project and create some source code in it. For example:

rm_goto_file_example

Navigate to file/class/symbol

This is one of the most powerful RubyMine's navigation and search features that enables you to find actually any file, class or symbol by its name, and jump directly to it. This is how it's done.

Navigate to file

Press Ctrl+Shift+N, and type d in the pop-up window that opens:

rm_goto_file

Note that you have to select All in the list of filters (icon filter).

Navigate to class

Next, let's jump to a specific class. To achieve this goal, press Ctrl+N, and type, for example, *o (* is a mask for any amount of any characters.) The suggestion list shows all classes with the letter o somewhere inside their names. Note that each class is followed by its fully qualified path:

rm_goto_class

Select Foo from the topLevelDir in the suggestion ist, and press Enter. This time, the file opens with the caret at the class declaration:

rm_goto_class_1

Navigate to symbol

Next, let's jump to a certain member of a class. Press Ctrl+Shift+Alt+N, and type *o again.

rm_goto_symbol

From the suggestion list, select o1 and press Enter. The file deeplyBuriedFile.py opens at the method declaration:

rm_goto_symbol_1

Using additional controls

You might have noticed the additional controls in the pop-up windows.

First, you can show files, classes or symbols which reside outside of the current project. To show an extended suggestion list, select the check box Include non-project files/classes/symbols, or press the corresponding shortcut once more. Compare the suggestion list of classes within your project with the suggestion list that includes classes from the external libraries:

rm_goto_file_extended

Next, click the pin (pin_small) to show all the matching entries in a separate view of the Find tool window.

rm_find_file_tw

Finally, you can click the funnel icon filter to narrow down the suggestion list to show only the entries belonging to the specified file types:

rm_goto_file_filter

Summary

This brief tutorial is over. You have mastered finding any file, class or symbol by its name, and navigating to it. In the next tutorial, we'll explore navigating to a class or symbol declaration and implementation, and using the gutter icons to jump to an overriding/implementing class or symbol.

See Also

Last modified: 30 November 2016