ribosome-0.9.9.9: Neovim plugin framework for Polysemy
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ribosome.Embed

Description

Main function combinators for embedding Neovim

Synopsis

Documentation

type EmbedStack c = HandlerEffects ++ BasicPluginStack c Source #

The complete stack for an embedded plugin test.

interpretPluginEmbed :: Members [Log, Reader LogConfig, Reader PluginName] r => Members IOStack r => InterpretersFor HandlerEffects r Source #

Run the internal stack for an embedded Neovim test, without IO effects.

embedPlugin :: Members (HostDeps er) r => Members BuiltinHandlersDeps r => Sem r a -> Sem r a Source #

Fork the main loop for a plugin connected to an embedded Neovim.

runEmbedStackCli :: PluginConfig c -> Sem (EmbedStack c) () -> IO () Source #

Run an embedded Neovim, plugin internals and IO effects, reading options from the CLI.

Like runEmbedStack, but allows the CLI option parser to be specified.

runEmbedStack :: PluginConfig () -> Sem (EmbedStack ()) () -> IO () Source #

Run an embedded Neovim, plugin internals and IO effects, reading options from the CLI.

runEmbedPluginCli :: HigherOrder r (EmbedStack c) => PluginConfig c -> InterpretersFor r (EmbedStack c) -> [RpcHandler (r ++ EmbedStack c)] -> Sem (r ++ EmbedStack c) () -> IO () Source #

Run a Sem in an embedded plugin context by starting a Neovim subprocess, forking the Ribosome main loop and registering the supplied handlers, using the supplied custom effect stack.

Like runEmbedPluginIO, but allows the PluginConfig to contain a CLI parser for an arbitrary type c that is then provided in a Reader c to the plugin.

This is separate from runEmbedPluginIO because it requires a type hint when using OverloadedStrings or def to construct the config without an option parser.

runEmbedPluginIO :: HigherOrder r (EmbedStack ()) => PluginConfig () -> InterpretersFor r (EmbedStack ()) -> [RpcHandler (r ++ EmbedStack ())] -> Sem (r ++ EmbedStack ()) () -> IO () Source #

Run a Sem in an embedded plugin context by starting a Neovim subprocess, forking the Ribosome main loop and registering the supplied handlers, using the supplied custom effect stack.

This is a basic version of what ribosome-test provides, which uses polysemy-test and hedgehog for a comprehensive testing framework.

The parameters have the same meaning as for remote plugins.

runEmbedPluginIO_ :: PluginConfig () -> [RpcHandler (EmbedStack ())] -> Sem (EmbedStack ()) () -> IO () Source #

Run a Sem in an embedded plugin context by starting a Neovim subprocess, forking the Ribosome main loop and registering the supplied handlers.

Like runEmbedPluginIO, but without extra effects.