JetBrains Rider 2021.1 Help

First Steps with JetBrains Rider

This topic will help you quickly get started with JetBrains Rider, and get familiar with its most frequently used features.

The first step

JetBrains Rider is a keyboard-centric product. Most of its actions have default keyboard shortcuts and if necessary, you can assign a custom shortcut to any of its commands.

Among all of the predefined keymaps, you will most probably choose one of the following:

For more information, see Customize keyboard shortcuts

Access frequently used commands

The navigation bar at the top of the Rider main window does not show many commands, but the most indispensable ones are at your fingertips:

JetBrains Rider: using navigation bar to access most frequently used actions

You can build your solution, change and manage build configurations and run/debug configurations, launch and stop your program, access VCS operations, and search everywhere.

JetBrains Rider provides a lot of navigation and search features. Let's get familiar with some of them.

Jump to declaration

Press the Ctrl key and hover the mouse over your code. You will see that all symbols defined elsewhere become underlined when in focus. You can click any symbol while holding down the Ctrl key to navigate directly to its declaration. If the symbol is defined in the current solution, JetBrains Rider opens the corresponding file and brings the caret to the declaration. If the symbol is defined in a compiled library, JetBrains Rider will decompile the declaration for you.

Go to Declaration with Ctrl+click
For more information, see Go to Declaration.

Find usages

To navigate in the opposite direction, that is to find all places in your solution where the symbol is used, press Alt+F7. JetBrains Rider will quickly find and display all usages of the symbol. For more information, see Find Usages.

Check available navigation actions

Another handy navigation shortcut is Ctrl+Shift+G. When you press it on any symbol, JetBrains Rider will show you all available navigation options:

Navigate To
For more information, see Navigate To.

Find anything in your solution

If you need to find anything in your solution, press Ctrl+T. The list of suggestions appears as soon as you invoke this feature and initially includes your recent files and navigated items. You can start typing to find types, symbols, files, recent edits, recent files, and recently viewed methods. For more information, see Search Everywhere.

Locate current file in the solution tree

When a navigation command brings you to a new file, you may want to see where it is in the Solution Explorer. Just press Alt+Shift+L and the Solution Explorer will scroll to the current file and highlight it. For more information, see Locate current document in Solution/Assembly Explorer

Code in the editor

When you are working in the editor, a bunch of code editing helpers are at your hand. Here are a couple of them.

Code completion (IntelliSense)

Rider's IntelliSense works automatically, but you can always invoke JetBrains Rider's code completion features explicitly, either after you have typed something or even instead of typing, wherever any meaningful code is allowed:

  • Pressing Ctrl+Shift+Space invokes the type-matching completion that provides more intelligent suggestions based on the expected type of the expression.

  • Pressing Ctrl+Alt+Space invokes the Second Basic Completion that displays all types that match a given prefix regardless of what namespace they belong to, It also inserts appropriate namespace import directives to the current file if necessary.

Select and move code blocks

Wherever your caret is, try pressing Ctrl+W/ Ctrl+Shift+W. These shortcuts allow you to successively select a symbol, line, or block of code so that you can easily select any desired expression for copying, cutting, or moving. For more information, see Handle Caret and Select Text.

If you need to move the selected code block, press Ctrl+Shift+Alt and then use the arrow keys to move the block to any allowed position. For more information, see Rearrange Code Elements

The power of Alt+Enter

Very often you will see one of many different action indicators in the left part of the editor. You can press Alt+Enter to see what JetBrains Rider has to suggest at the current caret position:

JetBrains Rider: Action list

Here are a couple of examples:

  • If you see a red bulb Themed icon red bulb screen gray or a yellow bulb Themed icon yellow bulb screen gray icon it is even recommended to press Alt+Enter because these action indicators tell you that JetBrains Rider has detected an error or other code issue and it knows how to fix it.

  • If you see a hammer Themed icon context action screen gray icon, you can ignore it unless you want to modify code at the caret. If you want to make changes, pressing Alt+Enter may be helpful. JetBrains Rider provides hundreds of context actions that can, for example, quickly change symbol visibility, add code that iterates over a collection, and more.

  • You can also press Alt+Enter if there are no action indicators in view. In this case, you can start typing to quickly find and execute any JetBrains Rider action in scope.

Refactor code

JetBrains Rider's set of refactorings by far surpasses that provided by Visual Studio, with regard to number, usability and scope of application.

It is not easy to learn and remember each of several dozens refactorings that JetBrains Rider provides. However, you can press Ctrl+Alt+Shift+T on any symbol in your code and check out which refactorings are available here.

Generate code

JetBrains Rider can help you concentrate on non-trivial tasks by providing a lot of features for generating boilerplate code automatically. For example, you can call a non-existent method and JetBrains Rider will create this method based on the usage, taking into account the return type and the types of parameters.

Generate type members

When your caret is anywhere within a type declaration, press Alt+Insert. In the popup menu that opens, you can select an item that you want to generate for the type. JetBrains Rider can create constructors, properties, overriding members, and more. For more information, see Code Generation.

Generating type members with JetBrains Rider

Code style matters

With JetBrains Rider, you can control the most of style aspects in your code: naming standards, formatting rules, order of members in files and types, and many other tiny things (such as order of modifiers or whether to use the 'var' keyword ).

The default values of JetBrains Rider code style features are selected based on Microsoft guidelines and numerous best practices. At the same time, each tiny aspect of code style can be changed to fit your personal or corporate preferences.

To apply code style rules, press Ctrl+E, C. JetBrains Rider will run code cleanup with one of the default profiles (Full Cleanup, Reformat & Apply Syntax Style and Reformat Code).

Last modified: 29 March 2021