dprint-vscode
dprint-vscode copied to clipboard
VSCode Dprint extension requires two formatting passes to reach final output
When using the Dprint extension in VSCode, formatting is applied in multiple stages:
- First pass removes block braces (
{}) - Second pass converts to single-line
This requires manually formatting the file twice. In contrast, the CLI version completes the transformation in a single run.
Reproduction Steps
- Install the Dprint VSCode extension
- Use this
.dprint.jsonconfig:{ "typescript": { "quoteStyle": "alwaysSingle", "quoteProps": "asNeeded", "semiColons": "prefer", "singleBodyPosition": "sameLine", "useBraces": "preferNone" } } - Format the following code:
if (Math.random() > 0.5) { console.log('HI!'); } - First format: braces are removed
- Second format: line is compressed to one-liner
Expected Behavior
Formatting should complete in one pass, like the CLI version.
Actual Behavior
VSCode requires two passes to reach the same output.
Environment
- VSCode Version: 1.97.2
- Dprint Extension Version: 0.16.4
- Dprint CLI Version: 0.49.1
- OS: MacOS Sequoia 15.4
Notes
The CLI correctly applies multi-step transforms in one run. The VSCode extension applies only one step per format operation.