Skip to content

iridiculous/resharper-rider-plugin

 
 

Repository files navigation

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

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. 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 will automatically get you the corresponding run configurations:

Version Relevant Code

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

  • The sdkVersion 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).

Deployment

Both plugins can be published by calling:

# For Rider
gradlew :publishPlugin -PpluginVersion=<version> -Pusername=<username> -Ppassword=<password>

# For ReSharper (VisualStudio)
powershell ./publishPlugin.ps1 -Version <version> -ApiKey <ApiKey>