Copyright | (c) Sebastian Witte |
---|---|
License | Apache-2.0 |
Maintainer | woozletoff@gmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- debug :: env -> Neovim env a -> IO (Either (Doc AnsiStyle) a)
- debug' :: Neovim () a -> IO (Either (Doc AnsiStyle) a)
- data NvimHSDebugInstance = NvimHSDebugInstance {
- threads :: [Async ()]
- neovimConfig :: NeovimConfig
- internalConfig :: Config RPCConfig
- develMain :: NeovimConfig -> IO (Maybe NvimHSDebugInstance)
- quitDevelMain :: NvimHSDebugInstance -> IO ()
- restartDevelMain :: NvimHSDebugInstance -> IO (Maybe NvimHSDebugInstance)
- printGlobalFunctionMap :: NvimHSDebugInstance -> IO ()
- runNeovim :: NFData a => Config env -> Neovim env a -> IO (Either (Doc AnsiStyle) a)
- runNeovim' :: NFData a => NvimHSDebugInstance -> Neovim () a -> IO (Either (Doc AnsiStyle) a)
- module Neovim
Documentation
debug :: env -> Neovim env a -> IO (Either (Doc AnsiStyle) a) Source #
Run a Neovim
function.
This function connects to the socket pointed to by the environment variable
$NVIM_LISTEN_ADDRESS
and executes the command. It does not register itself
as a real plugin provider, you can simply call neovim-functions from the
module Neovim.API.String this way.
Tip: If you run a terminal inside a neovim instance, then this variable is automatically set.
data NvimHSDebugInstance Source #
Simple datatype storing neccessary information to start, stop and reload a set of plugins. This is passed to most of the functions in this module for storing state even when the ghci-session has been reloaded.
NvimHSDebugInstance | |
|
develMain :: NeovimConfig -> IO (Maybe NvimHSDebugInstance) Source #
This function is intended to be run _once_ in a ghci session that to give a REPL based workflow when developing a plugin.
Note that the dyre-based reload mechanisms, i.e. the Neovim.Plugin.ConfigHelper plugin, is not started this way.
To use this in ghci, you simply bind the results to some variables. After each reload of ghci, you have to rebind those variables.
Example:
λ di <-develMain
Nothing
λrunNeovim'
di $ vim_call_function "getqflist" []Right
(Right
(ObjectArray
[])) λ :r λ di <-develMain
Nothing
You can also create a GHCI alias to get rid of most the busy-work:
:def! x \_ -> return ":reload\nJust di <- develMain
defaultConfig
{ plugins
= [ myDebugPlugin ] }"
quitDevelMain :: NvimHSDebugInstance -> IO () Source #
Quit a previously started plugin provider.
restartDevelMain :: NvimHSDebugInstance -> IO (Maybe NvimHSDebugInstance) Source #
Restart the development plugin provider.
printGlobalFunctionMap :: NvimHSDebugInstance -> IO () Source #
Print the global function map to the console.
runNeovim :: NFData a => Config env -> Neovim env a -> IO (Either (Doc AnsiStyle) a) Source #
Initialize a Neovim
context by supplying an InternalEnvironment
.
runNeovim' :: NFData a => NvimHSDebugInstance -> Neovim () a -> IO (Either (Doc AnsiStyle) a) Source #
Convenience function to run a stateless Neovim
function.
module Neovim