Giter Site home page Giter Site logo

ariadne's Introduction

Ariadne

crates.io crates.io License actions-badge

A fancy compiler diagnostics crate.

Example

Ariadne supports arbitrary multi-line spans

See examples/ for more examples.

About

ariadne is a sister project of chumsky. Neither are dependent on one-another, but I'm working on both simultaneously and like to think that their features complement each other. If you're thinking of using ariadne to process your compiler's output, why not try using chumsky to process its input?

Features

  • Inline and multi-line labels capable of handling arbitrary configurations of spans
  • Multi-file errors
  • Generic across custom spans and file caches
  • A choice of character sets to ensure compatibility
  • Coloured labels & highlighting with 8-bit and 24-bit color support (thanks to yansi)
  • Label priority and ordering
  • Compact mode for smaller diagnostics
  • Correct handling of variable-width characters such as tabs
  • A ColorGenerator type that generates distinct colours for visual elements.
  • A plethora of other options (tab width, label attach points, underlines, etc.)
  • Built-in ordering/overlap heuristics that come up with the best way to avoid overlapping & label crossover

Planned Features

  • Improved layout planning & space usage
  • Non-ANSI terminal support
  • More accessibility options (screenreader-friendly mode, textured highlighting as an alternative to color, etc.)
  • More color options
  • Better support for layout restrictions (maximum terminal width, for example)

Stability

The API (should) follow semver. However, this does not apply to the layout of final error messages. Minor tweaks to the internal layout heuristics can often result in the exact format of error messages changing with labels moving slightly. If you experience a change in layout that you believe to be a regression (either the change is incorrect, or makes your diagnostics harder to read) then please open an issue.

Credit

Thanks to:

  • @brendanzab for their beautiful codespan crate that inspired me to try pushing the envelope of error diagnostics.

  • @estebank for showing innumerable people just how good compiler diagnostics can be through their work on Rust.

ariadne's People

Contributors

gimbling-away avatar legorooj avatar martinohmann avatar moxinilian avatar remimimimimi avatar zesterer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.