ReSharper Platform SDK Help

Creating Your First Plugin

This documentation section will help you get started with developing ReSharper and Rider plugins. You can use either JetBrains Rider or Microsoft Visual Studio (with or without ReSharper) as your IDE (it is highly recommended to use the latest available version). Please refer to the Rider Web Help or ReSharper Web Help to become more familiar with the products.

Creating ReSharper and Rider Plugins

Creating new ReSharper and Rider plugin projects is performed using the dedicated dotnet new template. The generator creates all the necessary project files based on a few template inputs.

Create ReSharper & Rider Plugins

Launch the New Project wizard via the File | New | Project... action and provide the following information:

  1. Download the plugin template from the GitHub Release section.

  2. Install the plugin template by calling:

dotnet new --install JetBrains.ReSharper.SamplePlugin.*.nupkg

  1. Unpack the template with your preferred plugin name:

dotnet new resharper-rider-plugin --name MyPlugin

    Components of the Template-Generated Plugin

    When extracting the template using MyPlugin as a name, it will create the following directory content:

    MyPlugin ├── .github │ └── wrapper │ ├── CI.yml │ └── Deploy.yml ├── .run │ ├── rdgen (Unix).run.xml │ ├── rdgen (Windows).run.xml │ ├── rdgen.run.xml │ ├── Rider (Unix).run.xml │ ├── Rider (Windows).run.xml │ ├── Rider - Frontend (Unix).run.xml │ ├── Rider - Frontend (Windows).run.xml │ ├── Rider.run.xml │ └── VisualStudio.run.xml ├── gradle │ └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── protocol │ ├── src/main/kotlin/model/rider │ └── build.gradle ├── src │ ├── dotnet │ │ ├── ReSharperPlugin.MyPlugin │ │ │ ├── IMyPluginZone.cs │ │ │ ├── ReSharperPlugin.MyPlugin.csproj │ │ │ └── ReSharperPlugin.MyPlugin.Rider.csproj │ │ ├── ReSharperPlugin.MyPlugin.Tests │ │ │ ├── ReSharperPlugin.MyPlugin.Tests.csproj │ │ │ ├── TestEnvironment.cs │ │ │ └── test │ │ │ └── data │ │ │ └── nuget.config │ │ ├── Directory.Build.props │ │ └── Plugin.props │ └── rider/main │ ├── kotlin/com/jetbrains/rider/plugins/myplugin │ └── resources │ └── META-INF │ └── plugin.xml ├── tools │ ├── nuget.exe │ └── vswhere.exe ├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── README.md ├── ReSharperPlugin.MyPlugin.sln ├── build.gradle ├── buildPlugin.ps1 ├── gradle.properties ├── gradlew ├── gradlew.bat ├── publishPlugin.ps1 ├── runVisualStudio.ps1 ├── settings.gradle └── settings.ps1
    • The gradlew and gradlew.bat files to bootstrap running Gradle on Windows, macOS, and Linux. These will also automatically install the required Amazon Corretto 11 SDK into the build/gradle-jvm directory.

    • The build.gradle file to build and deploy the plugin for ReSharper and Rider.

    • The buildPlugin.ps1 and publishPlugin.ps1 files to build and deploy only the ReSharper plugin.

    • The gradle.properties, settings.ps1, plugin.xml, and Plugin.props files, containing information about plugin metadata (id, description, authors), dependency versions (ReSharper/ Rider SDK), and paths to solution and project files.

    • The Run/debug configurations for Rider/IntelliJ IDEA (.run directory) and the runVisualStudio.ps1 for PowerShell (--resharper-only template extraction) to launch the plugin in an experimental instance of Rider or Visual Studio with ReSharper.

    • The src/dotnet directory with basic project files for ReSharper and Rider including a test project. The Directory.Build.props defines all common NuGet references for both.

    • The README.md and CHANGELOG.md files for documentation about the plugin. The first section of the CHANGELOG.md is automatically included in the plugin metadata. The README.md has predefined Shields.IO badges with RIDER_PLUGIN_ID and RESHARPER_PLUGIN_ID as placeholders that can be updated after the first deployment.

    Running ReSharper and Rider Plugins

    A plugin generated from the template can be run through one of the Run/debug configurations or from the command-line on Windows, macOS, and Linux systems.

    Running from the Command-Line

    On Windows systems, you can run the plugin in Rider or Visual Studio with ReSharper.

    // Rider .\gradlew.bat // ReSharper .\runVisualStudio.ps1

    For macOS/Linux, you can run the plugin in Rider:

    ./gradlew :runIde

    Running from Run Configurations

    The included run configurations are shortcuts for the aforementioned command-line invocations. Choose one of the following configurations in Rider and click Run or Debug:

    • Rider (Unix) – Launches Rider on Unix-systems (macOS/Linux). Automatically compiles the frontend part using IntelliJ SDK.

    • Rider (Windows) – Launches Rider on Windows. Automatically compiles the frontend part using IntelliJ SDK.

    • VisualStudio – Launches Visual Studio with ReSharper.

    Plugin Run Configurations

    If your plugin has a frontend part, you will see a unified Rider configuration in IntelliJ IDEA that works cross-platform.

    Publishing ReSharper and Rider Plugins

    • Commands

      • ./publishPlugin.ps1 -Version <Version> -ApiKey <ApiKey> [-Configuration <Debug|Release>]

      • ./gradlew -PPluginVersion="<Version>" -PPublishToken="<Token>" [-PBuildConfiguration=<Debug|Release>]

    • GitHub Workflow

    Last modified: 15 July 2022