CSharpier Formatter for Visual Studio Code
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.
Install 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.
ext install csharpier.csharpier-vscode
Visual 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
editor.action.formatSelection in the keyboard shortcuts menu of vscode.
Format On Save
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:
// Set the default
// Enable per-language
Format Selection is not supported.