package grace

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Diagnostic types and constructors.

type ('a, 'b) format = ('a, Stdlib.Format.formatter, unit, 'b) Core.format4

The type of format strings associated with messages.

  1. The input is always a Format.formatter
  2. The result of %a and %t printing functions is unit.
module Severity : sig ... end

The type of severity.

module Priority : sig ... end

The type of priority. These are used to style the primary and secondary causes of a diagnostic.

module Message : sig ... end
module Label : sig ... end
type t = {
  1. severity : Severity.t;
    (*

    The overall severity of the diagnostic.

    *)
  2. message : Message.t;
    (*

    The main message associated with the diagnostic. These should not include control characters (such as the newline character \n). To support compact rendering, the message should be specific enough to make sense on its own, without the additional context provided by labels and notes.

    *)
  3. labels : Label.t list;
    (*

    Labels that describe the cause of the diagnostic. The order of the labels has no meaning, Grace's rendering engine will determine the order they appear.

    *)
  4. notes : Message.t list;
    (*

    Notes that are associated with the primary cause of the diagnostic.

    *)
}

The type of diagnostics.

include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
val create : ?notes:Message.t list -> ?labels:Label.t list -> Severity.t -> Message.t -> t

create severity message constructs a diagnostic with the message.

  • parameter notes

    additional notes associated with the primary cause of the diagnostic.

  • parameter labels

    used to describe the cause of the diagnostic.

val createf : ?notes:Message.t list -> ?labels:Label.t list -> Severity.t -> ('a, t) format -> 'a

createf severity fmt ... formats a message and constructs a diagnostic.

  • parameter notes

    additional notes associated with the primary cause of the diagnostic.

  • parameter labels

    used to describe the cause of the diagnostic.

val kcreatef : ?notes:Message.t list -> ?labels:Label.t list -> (t -> 'b) -> Severity.t -> ('a, 'b) format -> 'a

kcreatef kont severity fmt ... is equivalent to kont (createf severity fmt ...).

  • parameter notes

    additional notes associated with the primary cause of the diagnostic.

  • parameter labels

    used to describe the cause of the diagnostic.

OCaml

Innovation. Community. Security.