Title: Parse stack traces and display file/line context
Problem
CLI output currently shows only the error message; users need a quick pointer to the file and line that caused the error.
Proposed change
Add a stack trace parser that extracts file path, line, column, and function name from Node-style stack traces. Show a small source snippet around the error location when available and expose this info in JSON output.
Files to change
- add
lib/stack-parser.js
- update
lib/formatter.js to include location + snippet
- update
bin/index.js to pass stack to matcher/formatter
Tasks
- Implement
parseStackTrace(errorString) to extract frames (file, line, col, function).
- Implement
sourceSnippet(filepath, line, radius) to read a safe context sample.
- Add
--context flag to run/analyze to enable snippet printing.
- Add tests for common Node.js stack formats.
Acceptance criteria
- For input with a stack trace, the CLI prints the location and a 5-line snippet.
- JSON output includes a
locations array with frame details.
Labels: enhancement, medium-priority
Title: Parse stack traces and display file/line context
Problem
CLI output currently shows only the error message; users need a quick pointer to the file and line that caused the error.
Proposed change
Add a stack trace parser that extracts file path, line, column, and function name from Node-style stack traces. Show a small source snippet around the error location when available and expose this info in JSON output.
Files to change
lib/stack-parser.jslib/formatter.jsto include location + snippetbin/index.jsto pass stack to matcher/formatterTasks
parseStackTrace(errorString)to extract frames (file, line, col, function).sourceSnippet(filepath, line, radius)to read a safe context sample.--contextflag torun/analyzeto enable snippet printing.Acceptance criteria
locationsarray with frame details.Labels: enhancement, medium-priority