Copyright | (c) Sebastian Witte |
---|---|
License | Apache-2.0 |
Maintainer | woozletoff@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- asks :: (r -> a) -> Neovim r st a
- ask :: Neovim r st r
- eventQueue :: Neovim r st (TQueue SomeMessage)
- get :: MonadState s m => m s
- put :: MonadState s m => s -> m ()
- modify :: MonadState s m => (s -> s) -> m ()
- gets :: MonadState s m => (s -> a) -> m a
- type Neovim r st = StateT st (ReaderT (ConfigWrapper r) IO)
- type Neovim' = Neovim () ()
- data NeovimException = ErrorMessage String
- data ConfigWrapper a = ConfigWrapper {
- _eventQueue :: TQueue SomeMessage
- _quit :: MVar QuitAction
- _providerName :: String
- customConfig :: a
- runNeovim :: ConfigWrapper r -> st -> Neovim r st a -> IO (Either String (a, st))
- forkNeovim :: ir -> ist -> Neovim ir ist a -> Neovim r st ThreadId
- err :: String -> Neovim r st a
- restart :: Neovim r st ()
- quit :: Neovim r st ()
- data QuitAction
- throwError :: MonadError e m => forall a. e -> m a
Documentation
asks :: (r -> a) -> Neovim r st a Source
Retrieve something from the configuration with respect to the first
function. Works exactly like asks
.
Retrieve the Cunfiguration (i.e. read-only state) from the Neovim
context.
eventQueue :: Neovim r st (TQueue SomeMessage) Source
get :: MonadState s m => m s
put :: MonadState s m => s -> m ()
modify :: MonadState s m => (s -> s) -> m ()
gets :: MonadState s m => (s -> a) -> m a
type Neovim r st = StateT st (ReaderT (ConfigWrapper r) IO) Source
This is the environment in which all plugins are initially started.
Stateless functions use '()' for the static configuration and the mutable
state and there is another type alias for that case: Neovim'
.
Functions have to run in this transformer stack to communicate with neovim.
If parts of your own functions dont need to communicate with neovim, it is
good practice to factor them out. This allows you to write tests and spot
errors easier. Essentially, you should treat this similar to IO
in general
haskell programs.
data NeovimException Source
data ConfigWrapper a Source
A wrapper for a reader value that contains extra fields required to communicate with the messagepack-rpc components.
ConfigWrapper | |
|
runNeovim :: ConfigWrapper r -> st -> Neovim r st a -> IO (Either String (a, st)) Source
Initialize a Neovim
context by supplying an InternalEnvironment
.
forkNeovim :: ir -> ist -> Neovim ir ist a -> Neovim r st ThreadId Source
Fork a neovim thread with the given custom config value and a custom
state. The result of the thread is discarded and only the ThreadId
is
returend immediately.
data QuitAction Source
throwError :: MonadError e m => forall a. e -> m a