diff --git a/src/Client.ml b/src/Client.ml index 6028d03..9ade934 100644 --- a/src/Client.ml +++ b/src/Client.ml @@ -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; diff --git a/src/Client.mli b/src/Client.mli index c3a55ad..0cad6be 100644 --- a/src/Client.mli +++ b/src/Client.mli @@ -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 *) @@ -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