package vcaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'state t
val create : on_error:[ `Raise | `Call of Vcaml_error.t -> unit ] -> [ `not_connected ] t

on_error is invoked when VCaml fails to parse a response from Neovim and when Neovim sends us an asynchronous error event to inform us that it encountered a problem with a message we sent.

module Connection_type : sig ... end

A value of type Connection_type.t describes the type of connection to use, along with the information necessary to connect to Neovim.

val attach : ?close_reader_and_writer_on_disconnect:bool -> [ `not_connected ] t -> 'a Connection_type.t -> time_source:Async.Time_source.t -> 'a Async.Deferred.Or_error.t

Attach to Neovim over an RPC channel. Once attach is called Neovim can start sending RPC requests and notifications, so handlers should be registered in advance with register_request_async and register_request_blocking as needed. Registering more handlers after attaching is allowed. Calling attach twice will raise.

val close : [ `connected ] t -> unit Async.Deferred.t

Close the client and release the underlying file descriptors. Can be called safely multiple times.

val rpc_channel_id : [ `connected ] t -> int

Returns neovim's id for the channel over which neovim and the client communicate. This can be useful when you want to register an RPC event to fire upon a certain event happening in vim (e.g. keypress or autocmd), since registering events require the channel id.