package lsp

  1. Overview
  2. Docs
LSP protocol implementation in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

jsonrpc-1.2.0.tbz
sha256=e4e56590b9af02160e5af7733763897d7cfe3f9b876692af4d4184ab0fce4bcb
sha512=724d5190a678ca8a3f3c13915cbfcf8d3cce8efa43e0dde130b14c45065b6ccd22507951e79977bcecf361c7928f271d312b87642bb2c52f33669c3e952a7e1b

doc/lsp.stdune/Stdune/User_message/index.html

Module Stdune.User_message

A message for the user

User messages are styled document that can be printed to the console or in the log file.

module Style : sig ... end

Symbolic styles that can be used inside messages. These styles are later converted to actual concrete styles depending on the output device. For instance, when printed to the terminal they are converted to ansi terminal styles (Ansi_color.Style.t list values).

type t = {
  1. loc : Stdune__.Loc0.t option;
  2. paragraphs : Style.t Pp.t list;
  3. hints : Style.t Pp.t list;
}

A user message.contents composed of an optional file location and a list of paragraphs.

The various paragraphs will be printed one after the other and will all start at the beginning of a line. They are all wrapped inside a Pp.box.

When hints are provided, they are printed as last paragraphs and prefixed with "Hint:". Hints should give indication to the user for how to fix the issue.

val pp : t -> Style.t Pp.t
module Print_config : sig ... end
val make : ?loc:Stdune__.Loc0.t -> ?prefix:Style.t Pp.t -> ?hints:Style.t Pp.t list -> Style.t Pp.t list -> t

Construct a user message from a list of paragraphs.

The first paragraph is prefixed with prefix inside the box. prefix should not end with a space as a space is automatically inserted by make if necessary.

val print : ?config:Print_config.t -> t -> unit

Print to stdout (not thread safe)

val prerr : ?config:Print_config.t -> t -> unit

Print to stderr (not thread safe)

val did_you_mean : string -> candidates:string list -> Style.t Pp.t list

Produces a "Did you mean ...?" hint

val to_string : t -> string

Produces a plain text representation of the error message, without the "Error: " prefix.

OCaml

Innovation. Community. Security.