[ANN] Grace 0.3.0 šŸ’…, fancy diagnostics library for compilers

I’m excited to announce the release of grace 0.3.0, an OCaml library for building, reporting and rendering beautiful compiler diagnostics :camel: :paintbrush:. Now available on opam-repository.

This release includes:

  • :window: Windows support: Grace now works on Windows, a long-awaited feature since its 0.1.0 release! :rocket:

  • :keyboard: TTY auto-detection: Grace_ansi_renderer can now automatically configure itself based on whether the output channel is a TTY. New functions: pr_diagnostic, epr_diagnostic, and output_diagnostic.

  • :elephant: Line elision: Grace_ansi_renderer now elides unnecessary lines in diagnostics, producing more focused output.

  • :zero: Zero-width ranges: Grace_ansi_renderer can now handle zero-width ranges within lines, as well as at end-of-line (EOL) and end-of-file (EOF) positions.

Many thanks to @giltho for their contributions to this release! :flexed_biceps:

CHANGES

  • feat(renderer): add breaks in large diagnostics (#63)
  • feat(renderer): check for tty when rendering (#60)
  • fix(renderer): off-by-one in lines_of_labels (#65)
  • fix(renderer): create 0-sized segment on empty label range (#64)
  • fix(renderer): renderer multi-line labels when message is empty (#53)
  • fix(renderer): fix errors that occur with special zero-width segments (#41)
  • fix(renderer): use Format.pp_infinity in Message.to_string for OCaml >5.2 (#40)
  • refactor!: removes base/core dependency (#58)

BREAKING CHANGE

  • Many base/core interfaces from Grace have been replaced with custom ones.
  • Source.reader has been removed. Use Source.Reader.t instead.
10 Likes