package grace

  1. Overview
  2. Docs
type t = {
  1. range : Range.t;
    (*

    The range we are going to include in the rendered diagnostic.

    *)
  2. priority : Priority.t;
    (*

    The priority (or style) of the label.

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

    A message providing additional information for the underlined code.

    *)
}

The type of labels.

Labels describe an underlined region of code associated with a diagnostic.

include Ppx_compare_lib.Equal.S with type t := t
val equal : t Base__Ppx_compare_lib.equal
include Ppx_hash_lib.Hashable.S with type t := t
val hash_fold_t : t Base__Ppx_hash_lib.hash_fold
val hash : t -> Base__Ppx_hash_lib.Std.Hash.hash_value
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 : range:Range.t -> priority:Priority.t -> Message.t -> t

create ~range ~priority message constructs a label.

  • parameter range

    the range to underline.

  • parameter priority

    the priority of the label.

val createf : range:Range.t -> priority:Priority.t -> ('a, t) format -> 'a

createf ~range ~priority fmt ... constructs a label with a formatted message.

  • parameter range

    the range to underline.

  • parameter priority

    the priority of the label.

val kcreatef : range:Range.t -> priority:Priority.t -> (t -> 'b) -> ('a, 'b) format -> 'a

kcreatef ~range ~priority kont fmt ... is equivalent to kont (createf ~range ~priority fmt ...).

  • parameter range

    the range to underline.

  • parameter priority

    the priority of the label.

val primary : range:Range.t -> Message.t -> t

primary ~range message is equivalent to create ~range ~priority:Primary message.

val primaryf : range:Range.t -> ('a, t) format -> 'a

primaryf ~range fmt ... is equivalent to createf ~range ~priority:Primary fmt ....

val kprimaryf : range:Range.t -> (t -> 'b) -> ('a, 'b) format -> 'a

kprimaryf ~range kont fmt ... is equivalent to kcreatef ~range ~priority:Primary kont fmt ....

val secondary : range:Range.t -> Message.t -> t

secondary ~range message is equivalent to create ~range ~priority:Secondary message.

val secondaryf : range:Range.t -> ('a, t) format -> 'a

secondaryf ~range fmt ... is equivalent to createf ~range ~priority:Secondary fmt ....

val ksecondaryf : range:Range.t -> (t -> 'b) -> ('a, 'b) format -> 'a

ksecondaryf ~range kont fmt ... is equivalent to kcreatef ~range ~priority:Secondary kont fmt ....

OCaml

Innovation. Community. Security.