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=8bf1516829f8dcace133f21f633a275a1d9fdcc59339e0359c67b7b02e9ee6c6
sha512=1f8099b3b085ef0e58317802b180d7321e25a1393034c6cb9fe7b9158baee9868113751111a82352b236e1b3b1078188d2ed40b6316d230f3c81c5b69b5ad872
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
.