CSharpier Formatter for Visual Studio CodeThis extension makes use of the dotnet tool CSharpier to format your code and is versioned independently. CSharpier is 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. InstallationInstall through VS Code extensions. Search for Can also be installed in VS Code: Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
CSharpier VersionThe extension determines which version of csharpier is needed to format a given file by looking for a dotnet manifest file. If one is not found it looks for a globally installed version of CSharpier. Dotnet CommandsThe extension makes use of
Default FormatterTo ensure that CSharpier is used to format c# files, be sure to set it as the default formatter.
UsageKeyboard ShortcutsVisual Studio Code provides default keyboard shortcuts for code formatting. You can learn about these for each platform in the VS Code documentation. If you don't like the defaults, you can rebind Format On SaveRespects Found in the settings at Text Editor | Formatting | Format on Save You can turn on format-on-save on a per-language basis by scoping the setting:
DevcontainersCSharpier supports DevContainers if it is installed as a local dotnet tool.
LimitationsFormat Selection is not supported. Only
|