Skip to content

chore: refactor ConsoleFormatter construction#896

Merged
OrKoN merged 1 commit intomainfrom
refactor-console-formatter
Feb 5, 2026
Merged

chore: refactor ConsoleFormatter construction#896
OrKoN merged 1 commit intomainfrom
refactor-console-formatter

Conversation

@szuend
Copy link
Copy Markdown
Contributor

@szuend szuend commented Feb 5, 2026

This PR shuffles code around in ConsoleFormatter so the data flow is more clear and flexible. Instead of augmenting an existing instance via #loadDetailedData we pass the detailed data (if needed) via constructor. The overall public API stays exactly the same, only the internal implementation changed.

This also makes it trivial to inject "resolved arguments for testing", which we'll need to test SymbolizedError instances as part of resolvedArgs.

Drive-by: Make options and message ID mandatory. All call-sites already passed these so its a no-op to tighten the type here and we can simplify toString() a bit.

@szuend szuend requested a review from OrKoN February 5, 2026 10:40
Copy link
Copy Markdown
Collaborator

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@OrKoN OrKoN enabled auto-merge February 5, 2026 10:41
@OrKoN OrKoN added this pull request to the merge queue Feb 5, 2026
Merged via the queue into main with commit d459266 Feb 5, 2026
20 checks passed
@OrKoN OrKoN deleted the refactor-console-formatter branch February 5, 2026 10:50
wolfib pushed a commit to wolfib/chrome-devtools-mcp that referenced this pull request Mar 10, 2026
This PR shuffles code around in `ConsoleFormatter` so the data flow is
more clear and flexible. Instead of augmenting an existing instance via
`#loadDetailedData` we pass the detailed data (if needed) via
constructor. The overall public API stays exactly the same, only the
internal implementation changed.

This also makes it trivial to inject "resolved arguments for testing",
which we'll need to test `SymbolizedError` instances as part of
`resolvedArgs`.

Drive-by: Make options and message ID mandatory. All call-sites already
passed these so its a no-op to tighten the type here and we can simplify
toString() a bit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants