Skip to content

Commit

Permalink
make many functions of Client.t optional in Client.make (see #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Jan 26, 2018
1 parent 8a84cc7 commit 14e1e29
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/Client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ module Kernel = struct
?(file_extension=".txt")
?mime_type
?(init=fun () -> Lwt.return_unit)
?(is_complete=fun _ -> Lwt.return Is_complete)
?(complete=fun ~pos i->
Lwt.return {completion_matches=[]; completion_start=pos;completion_end=pos})
?(inspect=fun _ -> Lwt.return (Error "no inspection implemented"))
?(history=fun _ -> Lwt.return [])
~language_version
~language
~is_complete
~complete
~inspect
~history
~exec
() : t =
{ banner; file_extension; mime_type; language; language_version;
Expand Down
14 changes: 10 additions & 4 deletions src/Client.mli
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ module Kernel : sig
type exec_action =
| Mime of mime_data_bundle

(* TODO:
make the [exec] return type be asynchronous
- return [Ok str] as a future
- return a stream of actions
*)

type exec_status_ok = {
msg: string option;
(* main message *)
Expand Down Expand Up @@ -75,12 +81,12 @@ module Kernel : sig
?file_extension:string ->
?mime_type:string ->
?init:(unit -> unit Lwt.t) ->
?is_complete:(string -> is_complete_reply Lwt.t) ->
?complete:(pos:int -> string -> completion_status Lwt.t) ->
?inspect: (inspect_request -> inspect_reply_ok or_error Lwt.t) ->
?history:(history_request -> string list Lwt.t) ->
language_version:int list ->
language:string ->
is_complete:(string -> is_complete_reply Lwt.t) ->
complete:(pos:int -> string -> completion_status Lwt.t) ->
inspect: (inspect_request -> inspect_reply_ok or_error Lwt.t) ->
history:(history_request -> string list Lwt.t) ->
exec:(count:int -> string -> exec_status_ok or_error Lwt.t) ->
unit ->
t
Expand Down

0 comments on commit 14e1e29

Please sign in to comment.