A DevToys extension that formats code in 34 languages with live auto-formatting. Supports Python, JavaScript, TypeScript, JSON, Markdown, TOML, CSS, SCSS, Less, HTML, Vue, Svelte, Astro, YAML, GraphQL, Dockerfile, Java, SQL, C, C++, C#, Go, Go Assembly, Shell/Bash, Lua, R, Delphi/Pascal, Kotlin, Perl, PHP, MATLAB, Ruby, Objective-C, and Haskell. All formatters bundled as native binaries - no external dependencies required.
$ dotnet add package CodeFormatter.DevToysA code formatting extension for DevToys 2.0 that supports 22 programming languages with automatic live formatting.
| Language | Formatter | Notes |
|---|---|---|
| Python | Ruff | Bundled binary |
| JavaScript | dprint | Bundled binary |
| TypeScript | dprint | Bundled binary |
| JSON | dprint | Bundled binary |
| Markdown | dprint | Bundled binary |
| TOML | dprint | Bundled binary |
| CSS | dprint | Bundled binary |
| SCSS | dprint | Bundled binary |
| Less | dprint | Bundled binary |
| HTML | dprint | Bundled binary |
| Vue | dprint | Bundled binary |
| Svelte | dprint | Bundled binary |
| Astro | dprint | Bundled binary |
| YAML | dprint | Bundled binary |
| GraphQL | dprint | Bundled binary |
| Dockerfile | dprint | Bundled binary |
| Java | Prettier + prettier-plugin-java | Requires Node.js |
| SQL | sql-formatter | Requires Node.js |
| C | clang-format | Bundled binary |
| C++ | clang-format | Bundled binary |
| Go | gofumpt | Bundled binary |
| Shell/Bash | shfmt | Bundled binary |
npm install -g prettier prettier-plugin-java sql-formatter
.nupkg file from Releases.nupkg.nupkg (it's a ZIP file) to:
%LocalAppData%\DevToys\Plugins\CodeFormatter.DevToys.1.0.0\~/Library/com.devtoys/Plugins/CodeFormatter.DevToys.1.0.0/~/.local/share/devtoys/Plugins/CodeFormatter.DevToys.1.0.0/Click the gear icon to open settings for any language. Available options vary by formatter:
Settings are saved to ~/.config/code-formatter/config.toml (or equivalent on your OS).
# Clone the repository
git clone https://github.com/user/cs-f.git
cd cs-f
# Build
dotnet build -c Release
# Run tests
dotnet test
# Create NuGet package
dotnet pack -c Release -o ./nupkgFor development with hot reload:
Set environment variables:
[Environment]::SetEnvironmentVariable("DevToysGuiDebugEntryPoint", "C:\path\to\DevToys.exe", "User")
Press F5 in Visual Studio/VS Code/Rider to debug with DevToys
The Properties/launchSettings.json is configured for debugging with the EXTRAPLUGIN environment variable.
cs-f/
├── CodeFormatterTool.cs # Main UI and tool implementation
├── Models/
│ ├── Language.cs # Language enum and extensions
│ ├── FormatterConfig.cs # Configuration model
│ └── FormatterSettings.cs # Per-language setting definitions
├── Services/
│ ├── FormatterService.cs # Formatting orchestration
│ ├── ConfigManager.cs # TOML config read/write
│ └── ProcessRunner.cs # External process execution
├── Resources/
│ └── CodeFormatterStrings.resx # Localized strings
├── Binaries/ # Bundled formatter executables
│ ├── ruff.exe
│ ├── dprint.exe
│ ├── clang-format.exe
│ ├── gofumpt.exe
│ └── shfmt.exe
└── CodeFormatter.Tests/ # Integration tests
MIT