nvim-hs-0.0.6: Haskell plugin backend for neovim

Stabilityexperimental
Maintainerwoozletoff@gmail.com
Safe HaskellNone

Neovim.RPC.Common

Description

 

Synopsis

Documentation

data RPCConfig Source

Things shared between the socket reader and the event handler.

Constructors

RPCConfig 

Fields

recipients :: TVar (Map Int64 (UTCTime, TMVar (Either Object Object)))

A map from message identifiers (as per RPC spec) to a tuple with a timestamp and a TMVar that is used to communicate the result back to the calling thread.

newRPCConfig :: (Applicative io, MonadIO io) => io RPCConfigSource

Create a new basic configuration containing a communication channel for remote procedure call events and an empty lookup table for functions to mediate.

data SocketType Source

Simple data type defining the kind of socket the socket reader should use.

Constructors

Stdout Handle

Use the handle for receiving msgpack-rpc messages. This is suitable for an embedded neovim which is used in test cases.

Environment

Read the connection information from the environment variable NVIM_LISTEN_ADDRESS.

UnixSocket FilePath

Use a unix socket.

TCP Int String

Use an IP socket. First argument is the port and the second is the host name.

createHandle :: (Functor io, MonadIO io) => SocketType -> io HandleSource

Create a Handle from the given socket description.

The handle is not automatically closed.

cleanUpHandle :: MonadIO io => Handle -> Bool -> io ()Source

Close the handle and print a warning if the conduit chain has been interrupted prematurely.