package dune-rpc
Communicate with dune using rpc
Install
Dune Dependency
Authors
Maintainers
Sources
dune-3.15.0.tbz
sha256=b5c3d10f6f6048bfaf56fc4f0942d56381b55af4287caf8251487d4c4e7920d7
sha512=b3944b47c7ab1b2109aabc73dab7b9227765168bdcaddda875f3ee3c8277825f4a2672fbba903bf54ea507d00c7649c7dfc3c3bb156365d3052e570cf02caa82
doc/src/dune-rpc.private/diagnostics_v1.ml.html
Source file diagnostics_v1.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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
open Import open Exported_types module Related = struct type t = { message : unit Pp.t ; loc : Loc.t } let sexp = let open Conv in let loc = field "loc" (required Loc.sexp) in let message = field "message" (required sexp_pp_unit) in let to_ (loc, message) = { loc; message } in let from { loc; message } = loc, message in iso (record (both loc message)) to_ from ;; let t : Diagnostic.Related.t = { message = t.message |> Pp.map_tags ~f:(fun _ -> User_message.Style.Details) ; loc = t.loc } ;; let (t : Diagnostic.Related.t) = { message = t.message |> Pp.map_tags ~f:(fun _ -> ()); loc = t.loc } ;; end type t = { targets : Target.t list ; id : Diagnostic.Id.t ; message : unit Pp.t ; loc : Loc.t option ; severity : Diagnostic.severity option ; promotion : Diagnostic.Promotion.t list ; directory : string option ; related : Related.t list } let sexp_severity = let open Conv in enum [ "error", Diagnostic.Error; "warning", Warning ] ;; let sexp = let open Conv in let from { targets; message; loc; severity; promotion; directory; id; } = targets, message, loc, severity, promotion, directory, id, related in let to_ (targets, message, loc, severity, promotion, directory, id, ) = { targets; message; loc; severity; promotion; directory; id; related } in let loc = field "loc" (optional Loc.sexp) in let message = field "message" (required sexp_pp_unit) in let targets = field "targets" (required (list Target.sexp)) in let severity = field "severity" (optional sexp_severity) in let directory = field "directory" (optional string) in let promotion = field "promotion" (required (list Diagnostic.Promotion.sexp)) in let id = field "id" (required Diagnostic.Id.sexp) in let = field "related" (required (list Related.sexp)) in iso (record (eight targets message loc severity promotion directory id related)) to_ from ;; let to_diagnostic t : Diagnostic.t = { targets = t.targets ; message = t.message |> Pp.map_tags ~f:(fun _ -> User_message.Style.Details) ; loc = t.loc ; severity = t.severity ; promotion = t.promotion ; directory = t.directory ; id = t.id ; related = t.related |> List.map ~f:Related.to_diagnostic_related } ;; let of_diagnostic (t : Diagnostic.t) = { targets = t.targets ; message = t.message |> Pp.map_tags ~f:(fun _ -> ()) ; loc = t.loc ; severity = t.severity ; promotion = t.promotion ; directory = t.directory ; id = t.id ; related = t.related |> List.map ~f:Related.of_diagnostic_related } ;; module Event = struct type nonrec t = | Add of t | Remove of t let sexp = let diagnostic = sexp in let open Conv in let add = constr "Add" diagnostic (fun a -> Add a) in let remove = constr "Remove" diagnostic (fun a -> Remove a) in sum [ econstr add; econstr remove ] (function | Add t -> case t add | Remove t -> case t remove) ;; let to_event : t -> Diagnostic.Event.t = function | Add t -> Add (to_diagnostic t) | Remove t -> Remove (to_diagnostic t) ;; let of_event : Diagnostic.Event.t -> t = function | Add t -> Add (of_diagnostic t) | Remove t -> Remove (of_diagnostic t) ;; end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>