A code formatter for Dart.
Forked version from the official dart_style
formatter.
Inside your settings.json
"[dart]": {
"editor.defaultFormatter": "xnfo.dart-polisher",
"editor.formatOnSave": true, // optional
"editor.formatOnType": true, // optional
}
Works on ranges too.
"[dart]": {
"editor.tabSize": 4,
"editor.insertSpaces": false // optional: use Tab as indent
}
The formatter internally works with space indents,
dart-polisher.blockIndent
oreditor.tabSize
will be used for tab conversion, in that order.
{
// The number of spaces in a single level of expression nesting.
"dart-polisher.expressionIndent": 4,
// The number of spaces in a block or collection body.
"dart-polisher.blockIndent": 4,
// How much wrapped cascade sections indent.
"dart-polisher.cascadeIndent": 4,
// The ":" on a wrapped constructor initialization list.
"dart-polisher.constructorInitializerIndent": 4
}
These are all defaulted to
editor.tabSize
if not set.
NOTE: when using tabs uneven indent sizes will be filled with spaces.
{
// Dart style (default) is the original dart style
// but with customizable indent sizes.
"dart-polisher.codeStyle": "Dart Style",
// Expanded style is inspired by an outer braces style
// on block-like sintax. [beta]
"dart-polisher.codeStyle": "Expanded Style",
}
Search for dart polisher
in the VS Code Extension Marketplace and install it!
or
Install latests vsix manually from Github Releases
Works on Windows x64, Linux and Mac versions of VScode.
Compatible with web version of vscode
Beta version.
Please check CHANGELOG tab