Skip to content

Latest commit

 

History

History
 
 

CSharpier.Rider

csharpier-rider

This plugin makes use of the dotnet tool CSharpier to format your code. CSharpier an opinionated code formatter for c#. It uses Roslyn to parse your code and re-prints it using its own rules. The printing process was ported from prettier but has evolved over time.

CSharpier Version

The plugin determines which version of csharpier is needed to format a give file by looking for a dotnet manifest file. If one is not found it looks for a globally installed version of CSharpier.

To format files:

  • Install csharpier
    • as a local tool versioned to your project with dotnet tool install csharpier
    • globally with dotnet tool install -g csharpier
  • Use the Reformat with CSharpier action.
    • Available when right clicking on a file in the editor
    • Available via "Search Everywhere"
    • Does not have a default keyboard shortcut but can be assigned one.
  • Optionally configure CSharpier to Run on Save under Preferences/Settings | Tools | CSharpier

Please report any issues

Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "CSharpier" > Install Plugin


Troubleshooting

See Editor Troubleshooting for more information.

Note This plugin does not do any formatting and is versioned separately from CSharpier.

Viewing CSharpier Logs

  • Use the action "Show Log in Explorer"
  • Look for entries for "CSharpierLogger"

Enable Debug Logging for CSharpier

  • Use the action "Debug Log Settings"
  • Add entry for "#com.intellij.csharpier.CSharpierLogger"
  • Restart Rider