Skip to content

Commit

Permalink
chore: get rid of stdune in lsp
Browse files Browse the repository at this point in the history
do not use Code_error in the lsp library

ps-id: 364517D0-13DE-459D-99A4-4056F8DE4F57
  • Loading branch information
rgrinberg committed Apr 19, 2022
1 parent 297150d commit b6e5f0b
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ possible and does not make any assumptions about IO.
dyn
yojson
(ppx_yojson_conv_lib (>= "v0.14"))
stdune
(uutf (>= 1.0.2))
(odoc :with-doc)
(ocaml (>= 4.12))))
Expand Down
1 change: 0 additions & 1 deletion lsp.opam
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ depends: [
"dyn"
"yojson"
"ppx_yojson_conv_lib" {>= "v0.14"}
"stdune"
"uutf" {>= "1.0.2"}
"odoc" {with-doc}
"ocaml" {>= "4.12"}
Expand Down
2 changes: 1 addition & 1 deletion lsp/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(library
(name lsp)
(public_name lsp)
(libraries jsonrpc ppx_yojson_conv_lib stdune dyn uutf yojson)
(libraries jsonrpc ppx_yojson_conv_lib dyn uutf yojson)
(lint
(pps ppx_yojson_conv)))

Expand Down
6 changes: 1 addition & 5 deletions lsp/src/import.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ module Result = struct
end
end

(* TODO remove these last remnants of stdune once there is something public
available *)
module Code_error = Stdune.Code_error

let sprintf = Printf.sprintf

module String = struct
Expand Down Expand Up @@ -204,7 +200,7 @@ module Json = struct
t =
match f t with
| `Assoc xs -> `Assoc ((k, `String v) :: xs)
| _ -> Code_error.raise "To.literal_field" []
| _ -> invalid_arg "To.literal_field"

let int_pair (x, y) = `List [ `Int x; `Int y ]
end
Expand Down
2 changes: 1 addition & 1 deletion lsp/src/snippet.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let placeholder ?index content = Tabstop (index, `Placeholder content)

let choice ?index values =
match values with
| [] -> Code_error.raise "choice must have non empty values" []
| [] -> invalid_arg "choice must have non empty values"
| _ -> Tabstop (index, `Choice values)

let variable ?(opt = `None) var = Variable (var, opt)
Expand Down

0 comments on commit b6e5f0b

Please sign in to comment.