Skip to content

Commit fe8bf76

Browse files
committed
update extension commands
1 parent b472f24 commit fe8bf76

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

src/command_api.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ module Internal = struct
150150
let augment_selection_type_verbosity = unit_handle "augment-selection-type-verbosity"
151151
let install_dune_lsp = unit_handle "install-dune-lsp"
152152
let run_dune_pkg_lock = unit_handle "run_dune_pkg_lock"
153+
let install_opam = unit_handle "install-opam"
154+
let init_opam = unit_handle "init-opam"
155+
let install_ocaml_dev = unit_handle "install-ocaml-dev"
156+
let open_utop = unit_handle "open-utop"
153157
end
154158

155159
module Vscode = struct

src/command_api.mli

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ module Internal : sig
5151
val augment_selection_type_verbosity : (unit, unit) handle
5252
val install_dune_lsp : (unit, unit) handle
5353
val run_dune_pkg_lock : (unit, unit) handle
54+
val install_opam : (unit, unit) handle
55+
val init_opam : (unit, unit) handle
56+
val install_ocaml_dev : (unit, unit) handle
57+
val open_utop : (unit, unit) handle
5458
end
5559

5660
module Vscode : sig

src/extension_commands.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ let _switch_impl_intf =
248248
;;
249249

250250
let _install_opam =
251-
let handler (instance : Extension_instance.t) ~args:_ =
251+
let callback (instance : Extension_instance.t) () =
252252
let process_installation () =
253253
let open Promise.Syntax in
254254
let* opam = Opam.make () in
@@ -302,11 +302,11 @@ let _install_opam =
302302
let (_ : unit Promise.t) = process_installation () in
303303
()
304304
in
305-
command Extension_consts.Commands.install_opam handler
305+
command Command_api.Internal.install_opam callback
306306
;;
307307

308308
let _init_opam =
309-
let handler (instance : Extension_instance.t) ~args:_ =
309+
let callback (instance : Extension_instance.t) () =
310310
let options =
311311
ProgressOptions.create
312312
~location:(`ProgressLocation Notification)
@@ -339,11 +339,11 @@ let _init_opam =
339339
let _ = Vscode.Window.withProgress (module Ojs) ~options ~task in
340340
()
341341
in
342-
command Extension_consts.Commands.init_opam handler
342+
command Command_api.Internal.init_opam callback
343343
;;
344344

345345
let _install_ocaml_dev =
346-
let handler (instance : Extension_instance.t) ~args:_ =
346+
let callback (instance : Extension_instance.t) () =
347347
let options =
348348
ProgressOptions.create
349349
~location:(`ProgressLocation Notification)
@@ -378,11 +378,11 @@ let _install_ocaml_dev =
378378
let _ = Vscode.Window.withProgress (module Ojs) ~options ~task in
379379
()
380380
in
381-
command Extension_consts.Commands.install_ocaml_dev handler
381+
command Command_api.Internal.install_ocaml_dev callback
382382
;;
383383

384384
let _open_utop =
385-
let handler (instance : Extension_instance.t) ~args:_ =
385+
let callback (instance : Extension_instance.t) () =
386386
let options =
387387
ProgressOptions.create
388388
~location:(`ProgressLocation Notification)
@@ -415,7 +415,7 @@ let _open_utop =
415415
let _ = Vscode.Window.withProgress (module Ojs) ~options ~task in
416416
()
417417
in
418-
command Extension_consts.Commands.open_utop handler
418+
command Command_api.Internal.open_utop callback
419419
;;
420420

421421
let _open_current_dune_file =

0 commit comments

Comments
 (0)