All Projects → JetBrains → Resharper Rider Plugin

JetBrains / Resharper Rider Plugin

https://www.jetbrains.com/help/resharper/sdk/

JetBrains Official

Plugin Template for ReSharper and Rider

This repository defines a template for easy development of ReSharper and Rider plugins according to the official documentation for the ReSharper SDK and IntelliJ SDK.

Prerequisites

When developing for Rider, Java 11 Amazon Corretto should be installed.

Getting Started

Download the JetBrains.ReSharper.SamplePlugin.*.nupkg template package from the releases page and invoke from the download directory:

dotnet new --install JetBrains.ReSharper.SamplePlugin --nuget-source ./

Afterwards, a new project can be created from the installed template. The name identifier should be letters-only:

dotnet new resharper-rider-plugin --name MyAwesomePlugin [--include-samples] [--resharper-only] [--build-only]

This will create a new folder with all the structure ready to go and all identifiers, like namespaces, ids and file names, replaced with MyAwesomePlugin. Passing --include-samples will include a set of sample implementations for actions, code inspections, option pages, and more. Passing --resharper-only will exclude all Rider related files. With the --build-only --force, all the build-relevant files can be updated. Metadata including project website, description, author and others should be entered in Plugin.props and plugins.xml.

⚠️ The only place that currently needs to be updated manually is the RIDER_PLUGIN_ID in README.md, which you'll only get after uploading your Rider plugin the first time.

Development

For general development, there are a couple of scripts/invocations worth knowing. Most importantly, to run and debug your plugin, invoke:

# For Rider
gradlew :runIde

# For ReSharper (VisualStudio)
powershell .\runVisualStudio.ps1

When starting Gradle tasks from inside IntelliJ IDEA, make sure that the Gradle settings are as follows:

If your Rider plugin requires a model to share information between ReSharper backend and IntelliJ frontend, there is a sample protocol defined in protocol directory. To generate the Kotlin and C# implementation, call:

gradlew :rdgen

Opening the solution in Rider or IntelliJ IDEA will automatically provide the corresponding run configurations:

Version Relevant Code

There are a couple of version identifiers that should always be updated synchronously:

  • The ProductVersion variable in build.gradle is responsible for download a certain Rider frontend distribution
  • The SdkVersion property in Plugin.props will affect the referenced JetBrains.ReSharper.SDK NuGet package and will also determine the wave version that is required for the Extension Manager in ReSharper
  • The runVisualStudio.ps1 script will always download the latest available installer for ReSharper - this can be either a normal release or early-access-program (EAP) release

Available versions are listed here for ReSharper and Rider (under com.jetbrains.intellij.rider).

Visual Studio / ReSharper Relevant Directories

Installing ReSharper and the plugin into an experimental Visual Studio instance (hive) affects the following directories:

  • %LOCALAPPDATA%/JetBrains/plugins contains a copy of the plugin package, similar to the global NuGet package cache
  • %LOCALAPPDATA%/JetBrains/Installations contains settings directories per experimental instance, whereas packages.config defines what plugins should be installed
  • %APPDATA%/JetBrains/ReSharperPlatformVs[version] contains binary directories per experimental instance with all assemblies to run ReSharper and the plugin

Using attached folders can be of great help to track these directories while developing a ReSharper plugin.

Deployment

Both plugins can be published by calling:

# For Rider & ReSharper (Gradle)
gradlew :publishPlugin -PPluginVersion=<version> -PPublishToken=<token>

# For ReSharper (PowerShell)
powershell ./publishPlugin.ps1 -Version <version> -ApiKey <ApiKey>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].