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.10.0.tbz
sha256=9640f418cbacedb41d888908e99d3ad349d473c35876271acc9185d5c6ca1104
sha512=7353542380fcd419569fd729017ba592d817c284209033016c6921bd6bf0568fc51c8f47f88a82713bebbfacc9bdd841f512d984dd49c014632d27910089c935
doc/src/lsp.stdune/sexp.ml.html
Source file sexp.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
# 1 "submodules/dune/otherlibs/stdune/sexp.ml" module Array = ArrayLabels module List = ListLabels module String = StringLabels include Csexp let rec to_string = function | Atom s -> Escape.quote_if_needed s | List l -> Printf.sprintf "(%s)" (List.map ~f:to_string l |> String.concat ~sep:" ") let rec pp = function | Atom s -> Pp.text (Escape.quote_if_needed s) | List [] -> Pp.text "()" | List xs -> Pp.box ~indent:1 (let open Pp.O in Pp.text "(" ++ Pp.hvbox (List.map xs ~f:pp |> Pp.concat ~sep:Pp.space) ++ Pp.text ")") let hash = Stdlib.Hashtbl.hash let string_equal (x : string) (y : string) = x = y let rec equal x y = match (x, y) with | Atom x, Atom y -> string_equal x y | List x, List y -> equal_list x y | _, _ -> false and equal_list xs ys = (* replicating List.equal to avoid circular deps *) match (xs, ys) with | [], [] -> true | x :: xs, y :: ys -> equal x y && equal_list xs ys | _, _ -> false let compare x y = Ordering.of_int (compare x y) let rec of_dyn : Dyn.t -> t = function | Opaque -> Atom "<opaque>" | Unit -> List [] | Int i -> Atom (string_of_int i) | Int32 i -> Atom (Int32.to_string i) | Int64 i -> Atom (Int64.to_string i) | Nativeint i -> Atom (Nativeint.to_string i) | Bool b -> Atom (string_of_bool b) | String s -> Atom s | Bytes s -> Atom (Bytes.to_string s) | Char c -> Atom (String.make 1 c) | Float f -> Atom (string_of_float f) | Option o -> List (match o with | None -> [] | Some x -> [ of_dyn x ]) | List l -> List (List.map l ~f:of_dyn) | Array a -> List (Array.to_list a |> List.map ~f:of_dyn) | Map xs -> List (List.map xs ~f:(fun (k, v) -> List [ of_dyn k; of_dyn v ])) | Set xs -> List (List.map xs ~f:of_dyn) | Tuple t -> List (List.map t ~f:of_dyn) | Record fields -> List (List.map fields ~f:(fun (field, f) -> List [ Atom field; of_dyn f ])) | Variant (s, []) -> Atom s | Variant (s, xs) -> List (Atom s :: List.map xs ~f:of_dyn) let rec to_dyn : t -> Dyn.t = function | Atom s -> String s | List xs -> List (List.map ~f:to_dyn xs) let record (xs : (string * t) list) : t = List (List.map xs ~f:(fun (x, y) -> List [ Atom x; y ]))
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>