Visual Studio Code formatting extension for dprint—a pluggable and configurable code formatting platform.
Requires dprint 0.17 or above.
- Install dprint's CLI
- Install extension via Visual Studio Marketplace
- Run
dprint init
in the root directory of your repository to create a dprint configuration file. - Set the default formatter in your vscode settings:
{ "editor.defaultFormatter": "dprint.dprint", // or specify per language "[javascript]": { "editor.defaultFormatter": "dprint.dprint" }, "[typescript]": { "editor.defaultFormatter": "dprint.dprint" }, "[json]": { "editor.defaultFormatter": "dprint.dprint" }, "[jsonc]": { "editor.defaultFormatter": "dprint.dprint" }, "[markdown]": { "editor.defaultFormatter": "dprint.dprint" }, "[toml]": { "editor.defaultFormatter": "dprint.dprint" }, "[rust]": { "editor.defaultFormatter": "dprint.dprint" } }
- Consider turning on "format on save" (see below in Extension Settings)
Formats code in the editor using dprint.
Plugins are currently resolved based on the dprint configuration file in the current workspace folder.
You must have dprint installed globally on the path.
Follow the instructions here: Install
Respects formatting on save:
{
"editor.formatOnSave": true,
// or per language
"[typescript]": {
"editor.formatOnSave": true
},
// By default it will use `dprint` found on the path,
// but use this when you want to specify a custom location.
// Include the executable name (ex. on windows "C:\\some-dir\\dprint.exe")
"dprint.path": "/home/david/otherPath/dprint",
// Change this to `true` to get verbose logging
"dprint.verbose": false
}
- No support for custom config locations.
- Support for dprint 0.17
- Get config file schema from plugins.
- Add logging to "output" tab in vscode (under "dprint").
- Add
"dprint.verbose"
config for outputting verbose logging.
- Support dprint 0.13
- Support dprint 0.12
- Added
dprint.path
setting.
- Update to work with dprint 0.10.0 (will be backwards compatible with 0.9.0 for now).
- Plugin now re-initializes when the configuration file changes.
Formatting is faster due to using a long-running background process for formatting.
- Instructional message when dprint is not installed globally.
- Fix encoding issue on error.
Updates based on latest dprint CLI.
Fix error text.
Auto-dismiss syntax error notifications.
Initial release.