Repository navigation
Conversation
OrKoN
left a comment
There was a problem hiding this comment.
Thanks for the PR, could you please add tests?
| } | ||
|
|
||
| toJSONDetailed(): object { | ||
| const location = this.#getTopFrameLocation(); |
There was a problem hiding this comment.
the feature is about adding the first line of the stack to the non-detailed variants (toString(), toJSON()) so that the first source line appears in the list of console message. toJSONDetailed is not used in list_console_messages.
There was a problem hiding this comment.
Made required changes. Let me know any further improvements needed.
Also added test cases for the same. @OrKoN
…s tests according to that and also removed from message. toJSONDetailed
OrKoN
left a comment
There was a problem hiding this comment.
Tests and linter need to be fixed.
| }); | ||
| }); | ||
|
|
||
| describe('ConsoleFormatter - Source Map & Heavy Error Tests', () => { |
There was a problem hiding this comment.
these tests do not use any source maps. Can we also embed them into existing tests that already verify console message details and cover the list expectations there too?
|
Closing as stale. |
Address reviewer feedback on PR ChromeDevTools#2060: - Resolve source-mapped location via the stack trace's top non-ignored frame using uiSourceCode.uiLocation(), similar to the approach in ChromeDevTools#960. - Use the short display name (filename:line:col) for the concise text output to keep token usage low; full URL is preserved in the structured JSON output. - Include source location in the grouping key so that messages with identical text but different origins do not collapse together. - Bound stack-trace resolution with a timeout so a hanging page (e.g. blocked on a dialog) does not stall the tool call; falls back to the raw msg.location() / exceptionDetails location. - Split SymbolizedError.fromDetails' `includeStackAndCause` into `includeStack` and `includeCause` so the formatter can fetch the stack for location resolution without paying for cause lookup.
I implemented async fetching of source-mapped locations for console messages and uncaught errors.
list_console_messages remains fast and non-blocking.
get_console_message returns detailed stack traces with resolved source-mapped top frames.
Verified with 3000+ simulated errors; performance remains acceptable.
This addresses the request to show the source-mapped location for errors directly, without having to manually parse the stack trace.
Made the changes in src/formatters/ConsoleFormatter.ts