package lsp
Install
Dune Dependency
Authors
-
AAndrey Popp <8mayday@gmail.com>
-
RRusty Key <iam@stfoo.ru>
-
LLouis Roché <louis@louisroche.net>
-
OOleksiy Golovko <alexei.golovko@gmail.com>
-
RRudi Grinberg <me@rgrinberg.com>
-
SSacha Ayoun <sachaayoun@gmail.com>
-
Ccannorin <cannorin@gmail.com>
-
UUlugbek Abdullaev <ulugbekna@gmail.com>
-
Thibaut Mattio
-
MMax Lantas <mnxndev@outlook.com>
Maintainers
Sources
sha256=9640f418cbacedb41d888908e99d3ad349d473c35876271acc9185d5c6ca1104
sha512=7353542380fcd419569fd729017ba592d817c284209033016c6921bd6bf0568fc51c8f47f88a82713bebbfacc9bdd841f512d984dd49c014632d27910089c935
doc/lsp.stdune/Stdune/User_message/index.html
Module Stdune.User_message
Source
A message for the user
User messages are styled document that can be printed to the console or in the log file.
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 = {
loc : Stdune__.Loc0.t option;
paragraphs : Style.t Pp.t list;
hints : Style.t Pp.t list;
annots : Annots.t;
}
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.
The annots
field is intended to carry extra context for other, non-user-facing purposes (such as data for the RPC).
val make :
?loc:Stdune__.Loc0.t ->
?prefix:Style.t Pp.t ->
?hints:Style.t Pp.t list ->
?annots:Annots.t ->
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.
Print to stdout
(not thread safe)
Print to stderr
(not thread safe)
Produces a "Did you mean ...?" hint
Produces a plain text representation of the error message, without the "Error: " prefix.
Returns true
if the message has an explicit location or one embedded in the text.
Returns true
if the message's annotations contains Annot.Has_embedded_location
.