mblode / mblode/vscode-pretty-formatter
Formatter rewrite: migrate off the abandoned prettydiff engine
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 26
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Background
Pretty Formatter wraps the prettydiff beautifier (the prettydiff npm package, last meaningfully updated years ago). That engine is no longer maintained — its author moved on to a successor project and the npm package we depend on is effectively frozen.
A large share of the open issues in this repo are not bugs in the extension's own code (which is a thin VS Code wrapper in src/extension.ts). They are bugs in how prettydiff parses and re-emits specific languages and constructs. We can tweak which options we pass, but we cannot fix the underlying lexer/beautifier behaviour without forking or replacing the engine.
What this issue tracks
The shared root cause behind the formatting-correctness reports, and the plan to migrate to a maintained beautifier (e.g. Prettier + community plugins, Biome, or @liquify/prettify — the maintained prettydiff successor) on a per-language basis.
Subsumed issues (engine-rooted)
These are kept open and labelled formatter; they are symptoms of the same root cause and are expected to be resolved (or obsoleted) by an engine migration rather than individual patches:
- #26 — Indentation size not respected
- #24 — XML not formatted
- #23 — No tab indentation support
- #22 — Breaks on front-matter (nunjucks/liquid)
- #21 — High CPU load / unresponsive
- #19 — Bad TypeScript formatting with generics in class def
- #18 — CSS media query
andcondensed incorrectly - #17 — Twig nested blocks broken
- #15 — Breaking changes in TypeScript without semicolons
- #14 — ColdFusion (cfml) not formatted
- #13 — QML: extra space before colon
- #12 — Twig:
<character breaks formatting - #8 — Freemarker formatting broken / corrupts output
- #3 — Inline HTML tags treated like block tags
Notes
Contributions welcome. The realistic path forward is to delegate each language to a maintained formatter and keep this extension as the routing layer. Until then, these reports remain open for visibility but are unlikely to be individually fixable against the current engine.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/extension.ts, where the VS Code wrapper routes formatting through prettydiff, and review the listed engine-rooted issues to understand the affected languages. Compare the proposed maintained formatter options on a per-language basis before choosing an implementation path. Done means the extension no longer depends on the abandoned engine while retaining a routing layer for supported formatters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100