- First steps with JetBrains Rider
- The first step
- Access frequently used commands
- Navigate and search
- Jump to declaration
- Find usages
- Check available navigation actions
- Find anything in your solution
- Locate current file in the solution tree
- Code in the editor
- Code completion (IntelliSense)
- Select and move code blocks
- The power of Alt+Enter
- Refactor code
- Generate code
- Generate type members
- Code style matters
- Install JetBrains Rider
- Prerequisites
- Install using the Toolbox App
- Install the Toolbox App
- Install the Toolbox App
- Install the Toolbox App
- Standalone installation
- Installation with dotUltimate installer
- Silent installation on Windows
- Silent configuration file
- Install as a snap package on Linux
First steps with JetBrains Rider
You can also try the interactive tutorials available in Help | Tutorials .
This topic will help you quickly get started with JetBrains Rider, and become familiar with its most frequently used features.
The first step
JetBrains Rider is a keyboard-centric product. Most actions have default keyboard shortcuts, which you can customize.
Among all of the predefined keymaps, you will most probably choose one of the following:
Visual Studio / Visual Studio (macOS) — this keymap is recommended for users who:
have no experience with other IDEs;
have experience with plain Visual Studio;
have experience with Visual Studio + ReSharper and who preferred the ‘Visual Studio’ keyboard scheme in ReSharper.
ReSharper / ReSharper (macOS) — this keymap is recommended for users who have experience with Visual Studio + ReSharper and who preferred the ‘ReSharper 2.x/IntelliJ IDEA’ keyboard scheme in ReSharper.
IntelliJ / IntelliJ (macOS) — this keymap is recommended for users who have experience with IntelliJ IDEA or some of the JetBrains IntelliJ-platform-based IDEs and who preferred to use the IntelliJ / macOS keymap there.
When consulting this page and other pages in JetBrains Rider documentation, you can see keyboard shortcuts for the keymap that you use in the IDE — choose it using the selector at the top of a page.
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:
You can press Ctrl+Shift+A to quickly find and execute any command.
Navigate and search
JetBrains Rider provides a lot of navigation and search features. Let’s look at some of the most useful ones.
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.
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:
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, many code editing helpers are at hand. Here are a couple of them.
Code completion (IntelliSense)
All completion features support CamelHumps, meaning you can complete any identifier by entering only its uppercase characters. For example, type inpc for INotifyPropertyChanged .
JetBrains Rider’s IntelliSense works automatically by default, 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 type-matching completion, which provides more intelligent suggestions based on the expected type of the expression.
Pressing Ctrl+Alt+Space invokes Second basic completion, which 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:
Here are a couple of examples:
If you see a red bulb or a yellow bulb icon, this means JetBrains Rider has detected an error or other code issue and it can help you fix it. Press Alt+Enter to take advantage of this. For more information, see Quick-fixes for code issues.
A hammer icon means an opportunity to quickly modify the code at the caret. It is entirely optional. If you do want to make changes, press Alt+Enter to see context actions available to help you quickly change symbol visibility, add code that iterates over a collection, and more.
Even if there are no action indicators in view, can also press Alt+Enter to quickly find and execute any JetBrains Rider action in scope. Just start typing and choose from the matches that appear:
Refactor code
JetBrains Rider provides many more refactorings than Visual Studio does, but even more importantly, its refactorings are significantly more usable and wider in scope while still being safe to use.
Memorizing all the refactorings and their shortcuts is not an easy task, but luckily you don’t have to. You can simply press Ctrl+Alt+Shift+T on any symbol in your code to see which refactorings are available for that symbol.
Generate code
To help you concentrate on non-trivial tasks, JetBrains Rider provides 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 call, taking into account the return type and the types of arguments.
Generate type members
When your caret is anywhere within a type declaration, press Alt+Insert . In the popup menu that opens, 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.
Code style matters
With JetBrains Rider, you can control most of the style aspects in your code, including 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 reflect Microsoft guidelines and numerous best practices. At the same time, you can adjust every tiny aspect of code style 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).
Источник
Install JetBrains Rider
JetBrains Rider is a cross-platform IDE that provides consistent experience on the Windows, macOS, and Linux operating systems.
Prerequisites
Install using the Toolbox App
The JetBrains Toolbox App is the recommended tool to install JetBrains products. Use it to install and manage different products or several versions of the same product, including Early Access Program (EAP) and Nightly releases, update and roll back when necessary, and easily remove any tool. The Toolbox App maintains a list of all your projects to quickly open any project in the right IDE and version.
Install the Toolbox App
Download the installer .exe from the Toolbox App web page.
Run the installer and follow the wizard steps.
After you run the Toolbox App, click its icon in the notification area and select which product and version you want to install.
Log in to your JetBrains Account from the Toolbox App and it will automatically activate the available licenses for any IDE that you install.
Install the Toolbox App
Download the disk image .dmg from the Toolbox App web page.
There are separate disk images for Intel and Apple Silicon processors.
Mount the image and drag the JetBrains Toolbox app to the Applications folder.
After you run the Toolbox App, click its icon in the main menu and select which product and version you want to install.
Log in to your JetBrains Account from the Toolbox App and it will automatically activate the available licenses for any IDE that you install.
Install the Toolbox App
Download the tarball .tar.gz from the Toolbox App web page.
Extract the tarball to a directory that supports file execution.
For example, if the downloaded version is 1.17.7391, you can extract it to the recommended /opt directory using the following command:
Execute the jetbrains-toolbox binary from the extracted directory to run the Toolbox App and select which product and version you want to install. After you run the Toolbox App for the first time, it will automatically add the Toolbox App icon to the main menu.
Log in to your JetBrains Account from the Toolbox App and it will automatically activate the available licenses for any IDE that you install.
You can use this shell script that automatically downloads the tarball with the latest version of the Toolbox App, extracts it to the recommended /opt directory, and creates a symbolic link in the /usr/local/bin directory.
Standalone installation
Install JetBrains Rider manually to manage the location of every instance and all the configuration files. For example, if you have a policy that requires specific install locations.
Run the installer and follow the wizard steps.
On the Installation Options step, you can configure the following:
Create a desktop shortcut for launching JetBrains Rider.
Add the directory with JetBrains Rider command-line launchers to the PATH environment variable to be able to run them from any working directory in the Command Prompt.
Add the Open Folder as Project action to the system context menu (when you right-click a folder).
Associate specific file extensions with JetBrains Rider to open them with a double-click.
To run JetBrains Rider, find it in the Windows Start menu or use the desktop shortcut. You can also run the launcher batch script or executable in the installation directory under bin .
There are separate disk images for Intel and Apple Silicon processors.
Mount the image and drag the JetBrains Rider app to the Applications folder.
Run the JetBrains Rider app from the Applications directory, Launchpad, or Spotlight.
Extract the tarball to a directory that supports file execution.
For example, to extract it to the recommended /opt directory, run the following command:
Do not extract the tarball over an existing installation to avoid conflicts. Always extract it to a clean directory.
Execute the Rider.sh script from the extracted directory to run JetBrains Rider.
To create a desktop entry, do one of the following:
On the Welcome screen, click Configure | Create Desktop Entry
From the main menu, click Tools | Create Desktop Entry
When you run JetBrains Rider for the first time, some steps are required to complete the installation, customize your instance, and start working with the IDE.
For information about the location of the default IDE directories with user-specific files, see Directories used by the IDE.
Installation with dotUltimate installer
If you have the dotUltimate license, which includes all JetBrains tools for .NET development, such as ReSharper, dotTrace, dotMemory, and dotCover, you can download the dotUltimate installer and use it to set up Rider as well as all other .NET tools.
Silent installation on Windows
Silent installation is performed without any user interface. It can be used by network administrators to install JetBrains Rider on a number of machines and avoid interrupting other users.
To perform silent install, run the installer with the following switches:
/S : Enable silent install
/CONFIG : Specify the path to the silent configuration file
/D : Specify the path to the installation directory
This parameter must be the last in the command line and it should not contain any quotes even if the path contains blank spaces.
To check for issues during the installation process, add the /LOG switch with the log file path and name between the /S and /D parameters. The installer will generate the specified log file. For example:
Silent configuration file
You can download the default silent configuration file for JetBrains Rider at https://download.jetbrains.com/rider/silent.config
The silent configuration file defines the options for installing JetBrains Rider. With the default options, silent installation is performed only for the current user: mode=user . If you want to install JetBrains Rider for all users, change the value of the installation mode option to mode=admin and run the installer as an administrator.
The default silent configuration file is unique for each JetBrains product. You can modify it to enable or disable various installation options as necessary.
It is possible to perform silent installation without the configuration file. In this case, omit the /CONFIG switch and run the installer as an administrator. Without the silent configuration file, the installer will ignore all additional options: it will not create desktop shortcuts, add associations, or update the PATH variable. However, it will still create a shortcut in the Start menu under JetBrains .
Install as a snap package on Linux
You can install JetBrains Rider as a self-contained snap package. Since snaps update automatically, your JetBrains Rider installation will always be up to date.
To use snaps, install and run the snapd service as described in the installation guide.
On Ubuntu 16.04 LTS and later, this service is pre-installed.
JetBrains Rider is distributed via two channels:
The stable channel includes only stable versions. To install the latest stable release of JetBrains Rider, run the following command:
The —classic option is required because the JetBrains Rider snap requires full access to the system, like a traditionally packaged application.
The edge channel includes EAP builds. To install the latest EAP build of JetBrains Rider, run the following command:
When the snap is installed, you can launch it by running the rider command.
To list all installed snaps, you can run sudo snap list . For information about other snap commands, see the Snapcraft documentation.
Источник