Navigation and search
You can quickly navigate through your Rust and TOML code, as well as through the IDE elements, using various actions and popups.
Search everywhere
Search everywhere is the easiest way to find anything in the IDE - a code item, action, or UI element. Press Shift twice to open the search window. By default, the IDE displays the list of recent files.
Completion also works in this dialog to help you find the desired item, and you can narrow the search by setting the required scope.
Find usages
The Find Usages action helps you search for the references of a code element across the codebase. You can search in a single file, in the whole project, or create a custom scope for your search.
Find usages in file
In the editor, place the caret at a symbol you want to find.
By default, the IDE automatically highlights all found usages in the file:
To turn this highlighting off, go to Highlight on Caret Movement | Usages of element at caret checkbox.
and clear theWhen automatic highlighting is disabled, you can call Find Usages for a file by pressing Ctrl+Shift+F7 or selecting from the main menu.
Search for usages in a project
Select a symbol, then right-click it and choose
from the context menu, or press Alt+F7.The IDE shows the results in the Find tool window. Here you can filter the results, group them, and jump back to the source code:
Go To actions
There are several Go To actions you can use to quickly navigate through your code. Note that all navigation actions are available inside macro-generated blocks as well.
Declaration or Usages (Ctrl+B): jumps to an item's declaration; if invoked for a declaration, jumps to its usage (or shows a list of usages).
Type Declaration (Ctrl+Shift+B): for a variable, field, or constant, navigates to its type declaration; when invoked for a function, jumps to the declaration of the return type.
Definition (Implementation) (Ctrl+Alt+B): for trait elements (methods, constants, and associated types), shows the list of implementations. You can also perform this action using gutter icons.
Go to Super Method: navigates from an item inside a trait implementation to its basic declaration in the trait.
For WASM projects, there's also a Go to generated declaration gutter marker for navigating from the #[wasm_bindgen]
attribute to the corresponding TypeScript code:
File structure
You can explore the structure of the currently opened file in the Structure tool window or in a popup.
View file structure
To open the Structure tool window, select from the main menu or press Alt+7.
To view the file structure in a popup, select
from the main menu or press Ctrl+F12.