package dune-rpc
Communicate with dune using rpc
Install
Dune Dependency
Authors
Maintainers
Sources
dune-3.8.2.tbz
sha256=5a6ec790128616b6b46616427fa9c8f2ba0d6ef5a405bf8fdbc6f82dc0d935fd
sha512=d0298138e46d1a3eb9b46ed369314259e1b3611f377b7562ac50353cdb9d480c2487810ade65e1f3ccc6df00bd8e43bfd3c2664d0c3c59cb13abd091be87324d
doc/src/dune-rpc.private/exported_types.ml.html
Source file exported_types.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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
open Import module Loc = struct include Loc let start t = t.start let stop t = t.stop let pos_sexp = let open Conv in let to_ (pos_fname, pos_lnum, pos_bol, pos_cnum) = { Lexing.pos_fname; pos_lnum; pos_bol; pos_cnum } in let from { Lexing.pos_fname; pos_lnum; pos_bol; pos_cnum } = (pos_fname, pos_lnum, pos_bol, pos_cnum) in let pos_fname = field "pos_fname" (required string) in let pos_lnum = field "pos_lnum" (required int) in let pos_bol = field "pos_bol" (required int) in let pos_cnum = field "pos_cnum" (required int) in iso (record (four pos_fname pos_lnum pos_bol pos_cnum)) to_ from let sexp = let open Conv in let to_ (start, stop) = { start; stop } in let from { start; stop } = (start, stop) in let start = field "start" (required pos_sexp) in let stop = field "stop" (required pos_sexp) in iso (record (both start stop)) to_ from end module Target = struct type t = | Path of string | Alias of string | Library of string | Executables of string list | Preprocess of string list | Loc of Loc.t let sexp = let open Conv in let path = constr "Path" string (fun p -> Path p) in let alias = constr "Alias" string (fun a -> Alias a) in let lib = constr "Library" string (fun l -> Library l) in let executables = constr "Executables" (list string) (fun es -> Executables es) in let preprocess = constr "Preprocess" (list string) (fun ps -> Preprocess ps) in let loc = constr "Loc" Loc.sexp (fun l -> Loc l) in sum [ econstr path ; econstr alias ; econstr lib ; econstr executables ; econstr preprocess ; econstr loc ] (function | Path p -> case p path | Alias a -> case a alias | Library l -> case l lib | Executables es -> case es executables | Preprocess ps -> case ps preprocess | Loc l -> case l loc) end module Path = struct type t = string let sexp = Conv.string let dune_root = "." let to_string_absolute x = x let absolute abs = if Filename.is_relative abs then Code_error.raise "Path.absolute: accepts only absolute paths" [ ("abs", Dyn.string abs) ]; abs let relative = Filename.concat end module Diagnostic = struct type severity = | Error | Warning module Promotion = struct type t = { in_build : string ; in_source : string } let in_build t = t.in_build let in_source t = t.in_source let sexp = let open Conv in let from { in_build; in_source } = (in_build, in_source) in let to_ (in_build, in_source) = { in_build; in_source } in let in_build = field "in_build" (required string) in let in_source = field "in_source" (required string) in iso (record (both in_build in_source)) to_ from end let sexp_pp : (unit Pp.t, Conv.values) Conv.t = let open Conv in let open Pp.Ast in let nop = constr "Nop" unit (fun () -> Nop) in let verbatim = constr "Verbatim" string (fun s -> Verbatim s) in let char = constr "Char" char (fun c -> Char c) in let newline = constr "Newline" unit (fun () -> Newline) in let t_fdecl = Fdecl.create Dyn.opaque in let t = fdecl t_fdecl in let text = constr "Text" string (fun s -> Text s) in let seq = constr "Seq" (pair t t) (fun (x, y) -> Seq (x, y)) in let concat = constr "Concat" (pair t (list t)) (fun (x, y) -> Concat (x, y)) in let box = constr "Box" (pair int t) (fun (x, y) -> Box (x, y)) in let vbox = constr "Vbox" (pair int t) (fun (x, y) -> Vbox (x, y)) in let hbox = constr "Hbox" t (fun t -> Hbox t) in let hvbox = constr "Hvbox" (pair int t) (fun (x, y) -> Hvbox (x, y)) in let hovbox = constr "Hovbox" (pair int t) (fun (x, y) -> Hovbox (x, y)) in let break = constr "Break" (pair (triple string int string) (triple string int string)) (fun (x, y) -> Break (x, y)) in let tag = constr "Tag" t (fun t -> Tag ((), t)) in let conv = sum [ econstr nop ; econstr verbatim ; econstr char ; econstr newline ; econstr text ; econstr seq ; econstr concat ; econstr box ; econstr vbox ; econstr hbox ; econstr hvbox ; econstr hovbox ; econstr break ; econstr tag ] (function | Nop -> case () nop | Seq (x, y) -> case (x, y) seq | Concat (x, y) -> case (x, y) concat | Box (i, t) -> case (i, t) box | Vbox (i, t) -> case (i, t) vbox | Hbox t -> case t hbox | Hvbox (i, t) -> case (i, t) hvbox | Hovbox (i, t) -> case (i, t) hovbox | Verbatim s -> case s verbatim | Char c -> case c char | Break (x, y) -> case (x, y) break | Newline -> case () newline | Text s -> case s text | Tag ((), t) -> case t tag) in Fdecl.set t_fdecl conv; let to_ast x = match Pp.to_ast x with | Ok s -> s | Error () -> (* We don't use the format constructor in dune. *) assert false in iso (Fdecl.get t_fdecl) Pp.of_ast to_ast module Id = struct type t = int let compare (a : t) (b : t) = Int.compare a b let hash (t : t) = Hashtbl.hash t let create t : t = t let sexp = Conv.int end module Related = struct type t = { message : unit Pp.t ; loc : Loc.t } let message t = t.message let loc t = t.loc let sexp = let open Conv in let loc = field "loc" (required Loc.sexp) in let message = field "message" (required sexp_pp) in let to_ (loc, message) = { loc; message } in let from { loc; message } = (loc, message) in iso (record (both loc message)) to_ from end type t = { targets : Target.t list ; id : Id.t ; message : unit Pp.t ; loc : Loc.t option ; severity : severity option ; promotion : Promotion.t list ; directory : string option ; related : Related.t list } let loc t = t.loc let message t = t.message let severity t = t.severity let promotion t = t.promotion let targets t = t.targets let directory t = t.directory let t = t.related let id t = t.id let sexp_severity = let open Conv in enum [ ("error", 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) 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 Promotion.sexp)) in let id = field "id" (required 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_dyn t = Sexp.to_dyn (Conv.to_sexp sexp t) 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_dyn t = Sexp.to_dyn (Conv.to_sexp sexp t) end end module Progress = struct type t = | Waiting | In_progress of { complete : int ; remaining : int } | Failed | Interrupted | Success let sexp = let open Conv in let waiting = constr "waiting" unit (fun () -> Waiting) in let failed = constr "failed" unit (fun () -> Failed) in let in_progress = let complete = field "complete" (required int) in let remaining = field "remaining" (required int) in constr "in_progress" (record (both complete remaining)) (fun (complete, remaining) -> In_progress { complete; remaining }) in let interrupted = constr "interrupted" unit (fun () -> Interrupted) in let success = constr "success" unit (fun () -> Success) in let constrs = List.map ~f:econstr [ waiting; failed; interrupted; success ] @ [ econstr in_progress ] in let serialize = function | Waiting -> case () waiting | In_progress { complete; remaining } -> case (complete, remaining) in_progress | Failed -> case () failed | Interrupted -> case () interrupted | Success -> case () success in sum constrs serialize end module Message = struct type t = { payload : Sexp.t option ; message : string } let payload t = t.payload let message t = t.message let sexp = let open Conv in let from { payload; message } = (payload, message) in let to_ (payload, message) = { payload; message } in let payload = field "payload" (optional sexp) in let message = field "message" (required string) in iso (record (both payload message)) to_ from let to_sexp_unversioned = Conv.to_sexp sexp end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>