Roslyn Plugin

Wrapper plugin that formats C# and Visual Basic code via Roslyn.

This is a process plugin. Using this will cause the CLI to download, run, and communicate with a separate process that is not sandboxed (unlike WASM plugins).

Install and Setup

In .dprintrc.json:

  1. Specify the plugin url in the "plugins" array (follow instructions at https://github.com/dprint/dprint-plugin-roslyn/releases/).
  2. Ensure .cs and .vb file extensions are matched in an "includes" pattern.
  3. Add a "roslyn" configuration property if desired.
{
  // ...etc...
  "roslyn": {
    "csharp.indentBlock": false,
    "visualBasic.indentWidth": 2
  }
}

Configuration

C# configuration uses the CSharpFormattingOptions (use "csharp.<property name goes here>": <value goes here> in the configuration file).

It does not seem like Roslyn supports any VB specific configuration.