package grace

  1. Overview
  2. Docs

Module Diagnostic.LabelSource

Sourcetype 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 Sexplib0.Sexpable.S with type t := t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval 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.

Sourceval 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.

Sourceval 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.

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

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

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

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

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

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

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

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

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

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

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

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