feat(vscode): rs fmt document formatter stack - #5
Conversation
Status-bar state changes now land in the shell log with their reason, and identical re-reports skip both the log line and the tooltip rebuild. The fmt stack logs each request the way prettier-vscode does (entry and outcome at info with duration, resolution detail at debug), forwards the CLI's stderr tail on successful runs, and explains once per folder why a request in an undetected folder did nothing.
The extension-host debugger inherits the developer's own profile, so a personal language-scoped defaultFormatter silently outranks the fixture's folder settings; with extensions disabled that formatter is unavailable and format-on-save does nothing. Launch the playground with an isolated, auto-created profile instead (the debugger strips --user-data-dir, so --profile is the supported mechanism), and give the rstack fixture format-on-save through the extension under development.
VS Code's CI-only extension inventory and AgentHost info logs drowned the test output; --log=warn keeps them out while VSCODE_TEST_LOG_LEVEL preserves an opt-in for verbose diagnosis.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff3ea28a84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The watch matcher's endsPattern matched the per-target "built in" line, and the worker bundle finishes seconds before the extension bundle — the first F5 launched against a half-written dist/ and the extension failed to load. Match the once-per-build "build completed" line instead.
A config or lockfile change can reshape the set of fmt-detected folders while reconciliation deliberately keeps the controller alive, leaving the status hover and shell log with stale folder names until the next successful format. Report from the detection listener instead; an empty snapshot stays silent because the shell's retire path owns the off states.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fbf53787e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Mocha's reporter writes to the extension host's stdout, which never reaches the harness log — CI showed only the failure count. The rejection message is the one channel that does surface, so it now carries each failed test's title and assertion message.
Detection can change while a format request is in flight; the success path reported from the request's captured snapshot and reverted the hover and shell log to the pre-change folder list.
The Windows runners check fixtures out with CRLF (autocrlf), and VS Code drops EOL-only changes from computeMoreMinimalEdits, so the formatted document keeps \r\n and the fmt E2E's exact-output assertion fails. Byte- identical fixtures make the assertion hold everywhere without loosening it.
What
iShot_2026-08-07_11.33.24.mp4
Brings the fmt stack from detection-only to a working document formatter, plus the observability and tooling that debugging it demanded.
stacks/fmt): spawn-per-requestrs fmt --stdin-filepaththrough VS Code's bundled Node (process.execPath+ELECTRON_RUN_AS_NODE), registered for the 24 language ids of the pinned prettier'sgetSupportInfo(). The spawn cwd is the nearest governingrstack.config.*directory becausers fmtresolves config from cwd only. A single minimal edit is produced from a prefix/suffix diff; formatting errors are log-only by design, and only launch failures mark the stack crashed.rstack >= 0.3.5, the first release with the full supported config and formatter surface. Older versions surface as a status-bar version mismatch, never a crash.editor.defaultFormattercould silently win over the fixture's settings while--disable-extensionsmakes that formatter unavailable — format-on-save then does nothing. The launch config now uses an isolated auto-created--profile(the debugger strips--user-data-dir), and the rstack fixture opts into format-on-save through the extension under development.--log=warnto keep VS Code's own info noise out of test output (VSCODE_TEST_LOG_LEVELopts back in).Test plan
pnpm lint— 0 errors, 0 type errors.pnpm test:unit— all passing (fmt run/pickConfigDir/minimalEdit units included).pnpm test:e2e:vscode— exit 0; the fmt suite formats a fixture file throughvscode.executeFormatDocumentProvider(quote normalization proves the edit came from prettier, not the built-in TS formatter) and asserts no edits for a folder where fmt is not detected.Not in this PR
A lightweight pre-spawned standby to cut the ~130 ms cold-start latency is planned as a follow-up PR.