package lsp
LSP protocol implementation in OCaml
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
jsonrpc-1.8.0.tbz
sha256=90ac8fc3b291bc9c28b93d39fee6c75615f278f70ad795912fa5a47fa1a08c89
sha512=9460328d2559d86e9d56bcf8a9ef722c57d20a53c41e47398c36401bdc13dd9874e885586f2ad2d0492707bc3a5e7d5393afcebe1cbad1c15fb314884502bd1d
doc/src/lsp.stdune/user_error.ml.html
Source file user_error.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
# 1 "submodules/dune/otherlibs/stdune-unstable/user_error.ml" module Annot = struct type t = .. let format = ref (fun _ -> assert false) module type S = sig type payload val make : payload -> t val check : t -> (payload -> 'a) -> (unit -> 'a) -> 'a end module Make (M : sig type payload val to_dyn : payload -> Dyn.t end) : S with type payload = M.payload = struct type payload = M.payload type t += A of M.payload let make t = A t let check t on_match on_failure = match t with | A t -> on_match t | _ -> on_failure () let () = let f = function | A t -> Dyn.pp (M.to_dyn t) | other -> !format other in format := f end module Has_embedded_location = Make (struct type payload = unit let to_dyn = Unit.to_dyn end) end exception E of User_message.t * Annot.t list let prefix = Pp.seq (Pp.tag User_message.Style.Error (Pp.verbatim "Error")) (Pp.char ':') let make ?loc ?hints paragraphs = User_message.make ?loc ?hints paragraphs ~prefix let raise ?loc ?hints ?(annots = []) paragraphs = raise (E (make ?loc ?hints paragraphs, annots)) let is_loc_none loc = match loc with | None -> true | Some loc -> loc = Loc0.none let has_embed_location annots = List.exists annots ~f:(fun annot -> Annot.Has_embedded_location.check annot (fun () -> true) (fun () -> false)) let has_location (msg : User_message.t) annots = (not (is_loc_none msg.loc)) || has_embed_location annots let () = Printexc.register_printer (function | E (t, []) -> Some (Format.asprintf "%a@?" Pp.to_fmt (User_message.pp t)) | E (t, annots) -> let open Pp.O in let pp = User_message.pp t ++ Pp.vbox (Pp.concat_map annots ~f:(fun annot -> Pp.box (!Annot.format annot) ++ Pp.cut)) in Some (Format.asprintf "%a" Pp.to_fmt pp) | _ -> None)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>