Scaffolded with npx --yes @biomejs/create-biome-reproduction@latest, generator version 0.2.1.
This reproduces formatting corruption with two LSP clients connected to the same daemon and opening the same file.
Requires Linux, Node.js 18 or newer, npm, and a locally built Biome binary. Build the Biome checkout with cargo build --bin biome, then run from this directory:
npm run repro -- /absolute/path/to/biome/target/debug/biomeBIOME_BIN can also select a binary. The explicit command-line argument takes precedence.
The reproduction uses Node.js built-in modules and does not require npm install. The generator's published Biome dependency remains in package.json, but the reproduction command does not use it.
- Start two LSP clients with an isolated daemon cache directory.
- Open
src/index.tsin both clients with identical contents at version 1. - Confirm both clients' formatting edits match CLI formatting.
- Change A's in-memory buffer to version 2 without changing B or the disk file.
- Confirm A's formatting edits still match CLI formatting.
- Request formatting from B, apply the returned edits to B's original text, and compare against CLI formatting of that original text.
The fixture is ASCII, so character offsets also equal UTF-16 offsets. Applying edits clamps positions past a line's end to that line's end and positions past the document to its end.
Expected: B's formatting matches CLI formatting of B's buffer and remains valid TypeScript.
Observed with checkout 88854dd63d: the baseline controls and A's control pass, but B's edits corrupt its buffer. Formatting the result fails with parser errors. No network delay or overlapping formatting requests are needed.
Exit status is 0 when B matches the expected output and 1 when it differs. Setup failures also exit nonzero; check the summary and REPRODUCED message to distinguish them.
Each run writes artifacts/:
result.json: binary path, server version, and control results.a.jsonlandb.jsonl: LSP messages.client-a.ts: A's changed buffer.expected.tsandactual.ts: expected and actual formatting of B.edits.json: formatting edits returned to B.parse-errors.txt: parser diagnostics for B's resulting text.
The runner leaves src/index.ts unchanged. It closes its clients and removes its temporary daemon cache after the run.