Skip to content

feat: parse st-json/1 (NDJSON) reports too (parity with MCP) #3

Description

@GabrielBBaldez

The plugin's parser (core/src/main/java/io/github/gabrielbbaldez/stacktale/idea/StReportParser.java) only understands the text format (st/1). stacktale can also be configured to write reports as st-json/1 — one JSON object per line (NDJSON) — and those files currently show up empty in the tool window. The MCP server and (soon) the VS Code extension read both; the JetBrains plugin should reach parity.

What to do

In :core (StReportParser.java), keeping it pure Java with no IntelliJ API:

  1. Detect the format from the first non-blank, non-# line: starts with {st-json/1; otherwise the existing st/1 path.
  2. For JSON, parse each line as an object (skip blanks; a half-written trailing line must be ignored, not throw). Handle the two record kinds — a full report and a repeat. Map a report into the same report model the text parser produces (id, timestamp, headline, culprit frame, the raw block for Copy Report for AI).
  3. Keep the public parse entry point unchanged so StacktalePanel doesn't care which format it got.

Use a JSON reader already on the plugin classpath (the IntelliJ Platform ships Gson/Jackson) — no new dependency in :core if you can avoid it; a tiny hand-roll is also fine given the flat shape.

Reference

  • Format spec: docs/FORMAT.md (st-json/1 section).
  • A working mirror: the MCP server's StReportFile.parseJson in the main repo.

How to verify

Add a case to core/src/main/java/io/github/gabrielbbaldez/stacktale/idea/../StReportParserTest.java (in core/src/test) with an NDJSON sample and assert id/timestamp/headline/culprit. ./gradlew test must stay green (no IDE download needed for :core tests).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestformatThe st/1 / st-json/1 report format (public API)good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions