Repository navigation
feat(server): add formatter status API - #53771
Open
opencode-agent[bot] wants to merge 1 commit into
Open
opencode-agent[bot] wants to merge 1 commit into
opencode-agent[bot] wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the v1 formatter status API (
GET /formatter,formatter.status) to V2. V2 already formats files after edits; this adds the read side so clients can show which formatters are configured and runnable for a location.Formatter.Statuswith the same fields as v1'sFormatterStatus:name,extensions,enabled.Formatter.status()lists every registered formatter and resolves whether it has a runnable command. Disabled formatters are omitted, andformatter: falsereturns an empty list. This is the method refactor(core): remove unused formatter methods #40684 removed while it had no callers.GET /api/formatter(formatter.status), location-scoped with the standard{ location, data }response. The handler waits for plugin activation first; otherwise a cold location returns an empty list because the config plugin registers the formatters.client.formatter.status({ location })on both the Promise and Effect clients, plus aFormatterApitype export.packages/protocol/openapi.jsonwas already out of date onv2, and regenerating it would add about 950 unrelated lines. This PR adds only the new path, schema and tag to it, then syncsservices/www.Not included: the v1 rule where disabling
ruffalso disablesuv, and any TUI or app UI that uses this endpoint.Testing:
packages/core:bun test test/formatter.test.ts(29 pass, including 3 new status tests)packages/server:bun test test/formatter.test.ts(new HTTP test; it fails without the activation wait)packages/client:bun run check:generated;bun testshows the same 4 failures as cleanv2and no new onesservices/www:bun script/generate-openapi.ts --checkbun typecheckpasses in schema, protocol, server, client, core, sdk, tui, app and cliRequested by: @Brendonovich (Brendan via Slack)