ernest

A highlighter for Gleam warnings and errors

Package Version Hex Docs

gleam add ernest@1
import ernest

pub fn main() -> Nil {
  let diagnostic =
    "error: Unknown variable
    ┌─ /path/to/project/src/project.gleam:4:3
    │
  4 │   println(\"Hello, World!\")
    │   ^^^^^^^

  The name `println` is not in scope here.
  Did you mean one of these:

    - io.println"

  let assert Ok(diagnostic) = ernest.parse(diagnostic) 
  io.println(ernest.to_ansi(diagnostic))
}

Further documentation can be found at https://ernest.hexdocs.pm/.

✨ Search Document