Skip to content

Web: per-range diagnostics (squigglies) + hover tooltip #2

Description

@proggeramlug

Context

playground.perryts.com renders Perry compiler diagnostics. Today the web target offers setLineDiagnostics('line:severity:#color:message') — whole-line tinting + a right-aligned message. The compiler gives us precise source_range { start:{line,column}, end:{line,column} } (0-based), so we'd like Monaco-style underlines on the exact span plus a hover tooltip with the full message + code.

Requested API

setRangeDiagnostics(json: string): void;
// json = [{ startLine, startCol, endLine, endCol, severity, message, code? }, …] (0-based)
  • Render a squiggle/underline under the exact range (severity-colored).
  • On pointer hover over the range, show a tooltip with message (and code if present).

Notes

  • Line-level setLineDiagnostics is a fine fallback and we use it today; this is the precision upgrade.
  • Pairs well with setCursor(line,col) (separate issue) so a diagnostics list can click-to-jump to the span.

Found while building the Perry playground.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions