diff --git a/ocaml-lsp-server/src/bin.ml b/ocaml-lsp-server/src/bin.ml index 922e66ff1..37385d737 100644 --- a/ocaml-lsp-server/src/bin.ml +++ b/ocaml-lsp-server/src/bin.ml @@ -5,4 +5,4 @@ let _PATH = lazy (Bin.parse_path (Option.value ~default:"" (Unix_env.get Unix_env.initial "PATH"))) ;; -let which = Bin.which ~path:(Lazy.force _PATH) +let which x = Bin.which ~path:(Lazy.force _PATH) x |> Option.map ~f:Stdune.Path.to_string diff --git a/ocaml-lsp-server/src/bin.mli b/ocaml-lsp-server/src/bin.mli index 369253827..492a447c7 100644 --- a/ocaml-lsp-server/src/bin.mli +++ b/ocaml-lsp-server/src/bin.mli @@ -1,3 +1 @@ -open Import - -val which : string -> Fpath.t option +val which : string -> string option diff --git a/ocaml-lsp-server/src/import.ml b/ocaml-lsp-server/src/import.ml index b87749e7a..7e25c5f42 100644 --- a/ocaml-lsp-server/src/import.ml +++ b/ocaml-lsp-server/src/import.ml @@ -6,7 +6,6 @@ include struct module Code_error = Code_error module Comparable = Comparable module Exn_with_backtrace = Exn_with_backtrace - module Fpath = Path module Int = Int module Table = Table module Tuple = Tuple diff --git a/ocaml-lsp-server/src/merlin_config.ml b/ocaml-lsp-server/src/merlin_config.ml index eb476b356..a9d152a03 100644 --- a/ocaml-lsp-server/src/merlin_config.ml +++ b/ocaml-lsp-server/src/merlin_config.ml @@ -69,7 +69,6 @@ module Process = struct ~message:"dune binary not found" ()) | Some prog -> - let prog = Fpath.to_string prog in let stdin_r, stdin_w = Unix.pipe () in let stdout_r, stdout_w = Unix.pipe () in Unix.set_close_on_exec stdin_w; diff --git a/ocaml-lsp-server/src/ocamlformat.ml b/ocaml-lsp-server/src/ocamlformat.ml index 6ddaf37ad..6c20c21ac 100644 --- a/ocaml-lsp-server/src/ocamlformat.ml +++ b/ocaml-lsp-server/src/ocamlformat.ml @@ -136,8 +136,7 @@ let formatter doc = | `Other -> Code_error.raise "unable to format non merlin document" [])) ;; -let exec cancel bin args stdin = - let refmt = Fpath.to_string bin in +let exec cancel refmt args stdin = let+ res, cancel = run_command cancel refmt stdin args in match cancel with | Cancelled () -> diff --git a/ocaml-lsp-server/src/ocamlformat_rpc.ml b/ocaml-lsp-server/src/ocamlformat_rpc.ml index 65f90b9c9..3fde475df 100644 --- a/ocaml-lsp-server/src/ocamlformat_rpc.ml +++ b/ocaml-lsp-server/src/ocamlformat_rpc.ml @@ -24,7 +24,7 @@ module Process : sig val create : logger:(type_:MessageType.t -> message:string -> unit Fiber.t) - -> bin:Fpath.t + -> bin:string -> unit -> (t, [> `No_process ]) result Fiber.t @@ -62,7 +62,6 @@ end = struct ;; let create ~logger ~bin () = - let bin = Fpath.to_string bin in let* pid, stdout, stdin = let stdin_i, stdin_o = Unix.pipe ~cloexec:true () in let stdout_i, stdout_o = Unix.pipe ~cloexec:true () in