-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell plugin backend for neovim -- -- This package provides a plugin provider for neovim. It allows you to -- write plugins for one of the great editors of our time in the best -- programming language of our time! ;-) -- -- You should find all the documentation you need inside the -- Neovim module. Most other modules are considered internal, so -- don't be annoyed if using things from there may break your code! -- -- The following modules may also be of interest and they should not -- change their API: Neovim.Quickfix -- -- If you want to write unit tests that interact with neovim, -- Neovim.Test provides some useful functions for that. -- -- If you are keen to debug nvim-hs or a module you are writing, -- take a look at the Neovim.Debug module. -- -- If you spot any errors or if you have great ideas, feel free to open -- an issue on github. @package nvim-hs @version 0.2.4 -- | This plugin only exists due to cyclic dependencies. module Neovim.Plugin.Startup -- | This data type contains internal fields of nvim-hs that may be -- useful for plugin authors. It is available via ask inside the -- plugin startup code. data StartupConfig cfg StartupConfig :: Maybe (Params cfg) -> [(String, Maybe String)] -> StartupConfig cfg -- | The configuration options for Config.Dyre. This is always set -- if nvim-hs has been started via Config.Dyre. Be sure to -- set up the ghcEnvironmentVariables correctly if you issue a -- recompilation via the Config.Dyre API. [dyreParams] :: StartupConfig cfg -> Maybe (Params cfg) -- | The GHC environment variables with which nvim-hs has been -- started. This are mainly of significance if you want to use the same -- environment for compilation or a REPL that nvim-hs runs on. -- -- These variables have to be used if you want to invoke functionality of -- Config.Dyre targeting nvim-hs. [ghcEnvironmentVariables] :: StartupConfig cfg -> [(String, Maybe String)] module Neovim.Log -- | Disable logging to stderr. disableLogger :: IO a -> IO a -- | Initialize the root logger to avoid stderr and set it to log the given -- file instead. Simply wrap the main entry point with this function to -- initialze the logger. -- --
--   main = withLogger "/home/dude/nvim.log" Debug $ do
--       putStrLn "Hello, World!"
--   
withLogger :: FilePath -> Priority -> IO a -> IO a module Neovim.Exceptions -- | Exceptions specific to nvim-hs. data NeovimException -- | Simply error message that is passed to neovim. It should currently -- only contain one line of text. ErrorMessage :: Doc -> NeovimException -- | Error that can be returned by a remote API call. A call of -- fromObject on this value could be converted to a value of -- NeovimExceptionGen. ErrorResult :: Object -> NeovimException instance GHC.Show.Show Neovim.Exceptions.NeovimException instance GHC.Exception.Exception Neovim.Exceptions.NeovimException instance Data.String.IsString Neovim.Exceptions.NeovimException instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Exceptions.NeovimException module Neovim.Compat.Megaparsec type Parser = Parsec Void String module Neovim.Classes -- | Conversion from Object files to Haskell types and back with -- respect to neovim's interpretation. -- -- The NFData constraint has been added to allow forcing results -- of function evaluations in order to catch exceptions from pure code. -- This adds more stability to the plugin provider and seems to be a -- cleaner approach. class NFData o => NvimObject o where fromObjectUnsafe o = case fromObject o of { Left e -> error . show $ text "Not the expected object:" <+> (text . show) o <+> lparen <> e <> rparen Right obj -> obj } fromObject = return . fromObjectUnsafe fromObject' = either (throwIO . ErrorMessage) return . fromObject toObject :: NvimObject o => o -> Object fromObjectUnsafe :: NvimObject o => Object -> o fromObject :: NvimObject o => Object -> Either Doc o fromObject' :: (NvimObject o, MonadBase IO io) => Object -> io o -- | A generic vim dictionary is a simply a map from strings to objects. -- This type alias is sometimes useful as a type annotation especially if -- the OverloadedStrings extension is enabled. type Dictionary = Map ByteString Object -- | Convenient operator to create a list of Object from normal -- values. (+:) :: (NvimObject o) => o -> [Object] -> [Object] infixr 5 +: -- | Representable types of kind *. This class is derivable in GHC with the -- DeriveGeneric flag on. class Generic a -- | Convert a Doc-ument to a messagepack Object. This is -- more a convenience method to transport error message from and to -- neovim. It generally does not hold that 'docToObject . docFromObject' -- = id. docToObject :: Doc -> Object -- | See docToObject. docFromObject :: Object -> Either Doc Doc instance Neovim.Classes.NvimObject () instance Neovim.Classes.NvimObject GHC.Types.Bool instance Neovim.Classes.NvimObject GHC.Types.Double instance Neovim.Classes.NvimObject GHC.Integer.Type.Integer instance Neovim.Classes.NvimObject GHC.Int.Int64 instance Neovim.Classes.NvimObject GHC.Int.Int32 instance Neovim.Classes.NvimObject GHC.Int.Int16 instance Neovim.Classes.NvimObject GHC.Int.Int8 instance Neovim.Classes.NvimObject GHC.Types.Word instance Neovim.Classes.NvimObject GHC.Word.Word64 instance Neovim.Classes.NvimObject GHC.Word.Word32 instance Neovim.Classes.NvimObject GHC.Word.Word16 instance Neovim.Classes.NvimObject GHC.Word.Word8 instance Neovim.Classes.NvimObject GHC.Types.Int instance Neovim.Classes.NvimObject [GHC.Types.Char] instance Neovim.Classes.NvimObject o => Neovim.Classes.NvimObject [o] instance Neovim.Classes.NvimObject o => Neovim.Classes.NvimObject (GHC.Base.Maybe o) instance (Neovim.Classes.NvimObject l, Neovim.Classes.NvimObject r) => Neovim.Classes.NvimObject (Data.Either.Either l r) instance (GHC.Classes.Ord key, Neovim.Classes.NvimObject key, Neovim.Classes.NvimObject val) => Neovim.Classes.NvimObject (Data.Map.Base.Map key val) instance Neovim.Classes.NvimObject Data.Text.Internal.Text instance Neovim.Classes.NvimObject Data.ByteString.Internal.ByteString instance Neovim.Classes.NvimObject Data.MessagePack.Object instance (Neovim.Classes.NvimObject o1, Neovim.Classes.NvimObject o2) => Neovim.Classes.NvimObject (o1, o2) instance (Neovim.Classes.NvimObject o1, Neovim.Classes.NvimObject o2, Neovim.Classes.NvimObject o3) => Neovim.Classes.NvimObject (o1, o2, o3) instance (Neovim.Classes.NvimObject o1, Neovim.Classes.NvimObject o2, Neovim.Classes.NvimObject o3, Neovim.Classes.NvimObject o4) => Neovim.Classes.NvimObject (o1, o2, o3, o4) instance (Neovim.Classes.NvimObject o1, Neovim.Classes.NvimObject o2, Neovim.Classes.NvimObject o3, Neovim.Classes.NvimObject o4, Neovim.Classes.NvimObject o5) => Neovim.Classes.NvimObject (o1, o2, o3, o4, o5) instance (Neovim.Classes.NvimObject o1, Neovim.Classes.NvimObject o2, Neovim.Classes.NvimObject o3, Neovim.Classes.NvimObject o4, Neovim.Classes.NvimObject o5, Neovim.Classes.NvimObject o6) => Neovim.Classes.NvimObject (o1, o2, o3, o4, o5, o6) instance (Neovim.Classes.NvimObject o1, Neovim.Classes.NvimObject o2, Neovim.Classes.NvimObject o3, Neovim.Classes.NvimObject o4, Neovim.Classes.NvimObject o5, Neovim.Classes.NvimObject o6, Neovim.Classes.NvimObject o7) => Neovim.Classes.NvimObject (o1, o2, o3, o4, o5, o6, o7) instance (Neovim.Classes.NvimObject o1, Neovim.Classes.NvimObject o2, Neovim.Classes.NvimObject o3, Neovim.Classes.NvimObject o4, Neovim.Classes.NvimObject o5, Neovim.Classes.NvimObject o6, Neovim.Classes.NvimObject o7, Neovim.Classes.NvimObject o8) => Neovim.Classes.NvimObject (o1, o2, o3, o4, o5, o6, o7, o8) instance (Neovim.Classes.NvimObject o1, Neovim.Classes.NvimObject o2, Neovim.Classes.NvimObject o3, Neovim.Classes.NvimObject o4, Neovim.Classes.NvimObject o5, Neovim.Classes.NvimObject o6, Neovim.Classes.NvimObject o7, Neovim.Classes.NvimObject o8, Neovim.Classes.NvimObject o9) => Neovim.Classes.NvimObject (o1, o2, o3, o4, o5, o6, o7, o8, o9) module Neovim.Plugin.Classes -- | Functionality specific functional description entries. -- -- All fields which are directly specified in these constructors are not -- optional, but can partialy be generated via the Template Haskell -- functions. The last field is a data type that contains all relevant -- options with sensible defaults, hence def can be used as an -- argument. data FunctionalityDescription -- | Exported function. Callable via call name(arg1,arg2). -- -- Function :: FunctionName -> Synchronous -> FunctionalityDescription -- | Exported Command. Callable via :Name arg1 arg2. -- -- Command :: FunctionName -> CommandOptions -> FunctionalityDescription -- | Exported autocommand. Will call the given function if the type and -- filter match. -- -- NB: Since we are registering this on the Haskell side of things, the -- number of accepted arguments should be 0. -- -- Autocmd :: ByteString -> FunctionName -> AutocmdOptions -> FunctionalityDescription -- | Essentially just a string. newtype FunctionName F :: ByteString -> FunctionName -- | This option detemines how neovim should behave when calling some -- functionality on a remote host. data Synchronous -- | Call the functionality entirely for its side effects and do not wait -- for it to finish. Calling a functionality with this flag set is -- completely asynchronous and nothing is really expected to happen. This -- is why a call like this is called notification on the neovim side of -- things. Async :: Synchronous -- | Call the function and wait for its result. This is only synchronous on -- the neovim side. This means that the GUI will (probably) not allow any -- user input until a reult is received. Sync :: Synchronous -- | Options for commands. -- -- Some command can also be described by using the OverloadedString -- extensions. This means that you can write a literal String -- inside your source file in place for a CommandOption value. See -- the documentation for each value on how these strings should look like -- (Both versions are compile time checked.) data CommandOption -- | Stringliteral "sync" or "async" CmdSync :: Synchronous -> CommandOption -- | Register passed to the command. -- -- Stringliteral: "\"" CmdRegister :: CommandOption -- | Command takes a specific amount of arguments -- -- Automatically set via template haskell functions. You really shouldn't -- use this option yourself unless you have to. CmdNargs :: String -> CommandOption -- | Determines how neovim passes the range. -- -- Stringliterals: "%" for WholeFile, "," for line and ",123" for -- 123 lines. CmdRange :: RangeSpecification -> CommandOption -- | Command handles a count. The argument defines the default count. -- -- Stringliteral: string of numbers (e.g. "132") CmdCount :: Word -> CommandOption -- | Command handles a bang -- -- Stringliteral: "!" CmdBang :: CommandOption -- | Newtype wrapper for a list of CommandOption. Any properly -- constructed object of this type is sorted and only contains zero or -- one object for each possible option. data CommandOptions -- | Specification of a range that acommand can operate on. data RangeSpecification -- | The line the cursor is at when the command is invoked. CurrentLine :: RangeSpecification -- | Let the command operate on every line of the file. WholeFile :: RangeSpecification -- | Let the command operate on each line in the given range. RangeCount :: Int -> RangeSpecification -- | You can use this type as the first argument for a function which is -- intended to be exported as a command. It holds information about the -- special attributes a command can take. data CommandArguments CommandArguments :: Maybe Bool -> Maybe (Int, Int) -> Maybe Int -> Maybe String -> CommandArguments -- | Nothing means that the function was not defined to handle a -- bang, otherwise it means that the bang was passed (Just -- True) or that it was not passed when called -- (Just False). [bang] :: CommandArguments -> Maybe Bool -- | Range passed from neovim. Only set if CmdRange was used in the -- export declaration of the command. -- -- Example: -- -- [range] :: CommandArguments -> Maybe (Int, Int) -- | Count passed by neovim. Only set if CmdCount was used in the -- export declaration of the command. [count] :: CommandArguments -> Maybe Int -- | Register that the command can/should/must use. [register] :: CommandArguments -> Maybe String getCommandOptions :: CommandOptions -> [CommandOption] -- | Smart constructor for CommandOptions. This sorts the command -- options and removes duplicate entries for semantically the same thing. -- Note that the smallest option stays for whatever ordering is defined. -- It is best to simply not define the same thing multiple times. mkCommandOptions :: [CommandOption] -> CommandOptions -- | Options that can be used to register an autocmd. See :h -- :autocmd or any referenced neovim help-page from the fields of -- this data type. data AutocmdOptions AutocmdOptions :: String -> Bool -> Maybe String -> AutocmdOptions -- | Pattern to match on. (default: "*") [acmdPattern] :: AutocmdOptions -> String -- | Nested autocmd. (default: False) -- -- See :h autocmd-nested [acmdNested] :: AutocmdOptions -> Bool -- | Group in which the autocmd should be registered. [acmdGroup] :: AutocmdOptions -> Maybe String -- | Conveniennce class to extract a name from some value. class HasFunctionName a name :: HasFunctionName a => a -> FunctionName instance GHC.Generics.Generic Neovim.Plugin.Classes.FunctionalityDescription instance GHC.Classes.Ord Neovim.Plugin.Classes.FunctionalityDescription instance GHC.Classes.Eq Neovim.Plugin.Classes.FunctionalityDescription instance GHC.Read.Read Neovim.Plugin.Classes.FunctionalityDescription instance GHC.Show.Show Neovim.Plugin.Classes.FunctionalityDescription instance GHC.Generics.Generic Neovim.Plugin.Classes.AutocmdOptions instance GHC.Classes.Ord Neovim.Plugin.Classes.AutocmdOptions instance GHC.Classes.Eq Neovim.Plugin.Classes.AutocmdOptions instance GHC.Read.Read Neovim.Plugin.Classes.AutocmdOptions instance GHC.Show.Show Neovim.Plugin.Classes.AutocmdOptions instance GHC.Generics.Generic Neovim.Plugin.Classes.CommandArguments instance GHC.Read.Read Neovim.Plugin.Classes.CommandArguments instance GHC.Show.Show Neovim.Plugin.Classes.CommandArguments instance GHC.Classes.Ord Neovim.Plugin.Classes.CommandArguments instance GHC.Classes.Eq Neovim.Plugin.Classes.CommandArguments instance GHC.Generics.Generic Neovim.Plugin.Classes.CommandOptions instance GHC.Read.Read Neovim.Plugin.Classes.CommandOptions instance GHC.Show.Show Neovim.Plugin.Classes.CommandOptions instance GHC.Classes.Ord Neovim.Plugin.Classes.CommandOptions instance GHC.Classes.Eq Neovim.Plugin.Classes.CommandOptions instance GHC.Generics.Generic Neovim.Plugin.Classes.CommandOption instance GHC.Read.Read Neovim.Plugin.Classes.CommandOption instance GHC.Show.Show Neovim.Plugin.Classes.CommandOption instance GHC.Classes.Ord Neovim.Plugin.Classes.CommandOption instance GHC.Classes.Eq Neovim.Plugin.Classes.CommandOption instance GHC.Generics.Generic Neovim.Plugin.Classes.RangeSpecification instance GHC.Read.Read Neovim.Plugin.Classes.RangeSpecification instance GHC.Show.Show Neovim.Plugin.Classes.RangeSpecification instance GHC.Classes.Ord Neovim.Plugin.Classes.RangeSpecification instance GHC.Classes.Eq Neovim.Plugin.Classes.RangeSpecification instance GHC.Generics.Generic Neovim.Plugin.Classes.Synchronous instance GHC.Enum.Enum Neovim.Plugin.Classes.Synchronous instance GHC.Classes.Ord Neovim.Plugin.Classes.Synchronous instance GHC.Classes.Eq Neovim.Plugin.Classes.Synchronous instance GHC.Read.Read Neovim.Plugin.Classes.Synchronous instance GHC.Show.Show Neovim.Plugin.Classes.Synchronous instance GHC.Generics.Generic Neovim.Plugin.Classes.FunctionName instance GHC.Read.Read Neovim.Plugin.Classes.FunctionName instance GHC.Show.Show Neovim.Plugin.Classes.FunctionName instance GHC.Classes.Ord Neovim.Plugin.Classes.FunctionName instance GHC.Classes.Eq Neovim.Plugin.Classes.FunctionName instance Control.DeepSeq.NFData Neovim.Plugin.Classes.FunctionName instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.Classes.FunctionName instance Control.DeepSeq.NFData Neovim.Plugin.Classes.FunctionalityDescription instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.Classes.FunctionalityDescription instance Control.DeepSeq.NFData Neovim.Plugin.Classes.Synchronous instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.Classes.Synchronous instance Data.String.IsString Neovim.Plugin.Classes.Synchronous instance Neovim.Classes.NvimObject Neovim.Plugin.Classes.Synchronous instance Control.DeepSeq.NFData Neovim.Plugin.Classes.CommandOption instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.Classes.CommandOption instance Data.String.IsString Neovim.Plugin.Classes.CommandOption instance Control.DeepSeq.NFData Neovim.Plugin.Classes.CommandOptions instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.Classes.CommandOptions instance Neovim.Classes.NvimObject Neovim.Plugin.Classes.CommandOptions instance Control.DeepSeq.NFData Neovim.Plugin.Classes.RangeSpecification instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.Classes.RangeSpecification instance Neovim.Classes.NvimObject Neovim.Plugin.Classes.RangeSpecification instance Control.DeepSeq.NFData Neovim.Plugin.Classes.CommandArguments instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.Classes.CommandArguments instance Data.Default.Class.Default Neovim.Plugin.Classes.CommandArguments instance Neovim.Classes.NvimObject Neovim.Plugin.Classes.CommandArguments instance Control.DeepSeq.NFData Neovim.Plugin.Classes.AutocmdOptions instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.Classes.AutocmdOptions instance Data.Default.Class.Default Neovim.Plugin.Classes.AutocmdOptions instance Neovim.Classes.NvimObject Neovim.Plugin.Classes.AutocmdOptions instance Neovim.Plugin.Classes.HasFunctionName Neovim.Plugin.Classes.FunctionalityDescription module Neovim.Plugin.IPC.Classes -- | Taken from xmonad and based on ideas in /An Extensible -- Dynamically-Typed Hierarchy of Exceptions/, Simon Marlow, 2006. -- -- User-extensible messages must be put into a value of this type, so -- that it can be sent to other plugins. data SomeMessage SomeMessage :: msg -> SomeMessage -- | This class allows type safe casting of SomeMessage to an actual -- message. The cast is successful if the type you're expecting matches -- the type in the SomeMessage wrapper. This way, you can -- subscribe to an arbitrary message type withouth having to pattern -- match on the constructors. This also allows plugin authors to create -- their own message types without having to change the core code of -- nvim-hs. class Typeable message => Message message where fromMessage (SomeMessage message) = cast message -- | Try to convert a given message to a value of the message type we are -- interested in. Will evaluate to Nothing for any other type. fromMessage :: Message message => SomeMessage -> Maybe message -- | Haskell representation of supported Remote Procedure Call messages. data FunctionCall -- | Method name, parameters, callback, timestamp FunctionCall :: FunctionName -> [Object] -> (TMVar (Either Object Object)) -> UTCTime -> FunctionCall -- | A request is a data type containing the method to call, its arguments -- and an identifier used to map the result to the function that has been -- called. data Request Request :: FunctionName -> !Int64 -> [Object] -> Request -- | Name of the function to call. [reqMethod] :: Request -> FunctionName -- | Identifier to map the result to a function call invocation. [reqId] :: Request -> !Int64 -- | Arguments for the function. [reqArgs] :: Request -> [Object] -- | A notification is similar to a Request. It essentially does the -- same thing, but the function is only called for its side effects. This -- type of message is sent by neovim if the caller there does not care -- about the result of the computation. data Notification Notification :: FunctionName -> [Object] -> Notification -- | Name of the function to call. [notMethod] :: Notification -> FunctionName -- | Arguments for the function. [notArgs] :: Notification -> [Object] -- | This is the simplest representation of UTC. It consists of the day -- number, and a time offset from midnight. Note that if a day has a leap -- second added to it, it will have 86401 seconds. data UTCTime :: * -- | Get the current UTC time from the system clock. getCurrentTime :: IO UTCTime instance GHC.Generics.Generic Neovim.Plugin.IPC.Classes.Notification instance GHC.Show.Show Neovim.Plugin.IPC.Classes.Notification instance GHC.Classes.Ord Neovim.Plugin.IPC.Classes.Notification instance GHC.Classes.Eq Neovim.Plugin.IPC.Classes.Notification instance GHC.Generics.Generic Neovim.Plugin.IPC.Classes.Request instance GHC.Show.Show Neovim.Plugin.IPC.Classes.Request instance GHC.Classes.Ord Neovim.Plugin.IPC.Classes.Request instance GHC.Classes.Eq Neovim.Plugin.IPC.Classes.Request instance Neovim.Plugin.IPC.Classes.Message Neovim.Plugin.IPC.Classes.FunctionCall instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.IPC.Classes.FunctionCall instance Control.DeepSeq.NFData Neovim.Plugin.IPC.Classes.Request instance Neovim.Plugin.IPC.Classes.Message Neovim.Plugin.IPC.Classes.Request instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.IPC.Classes.Request instance Control.DeepSeq.NFData Neovim.Plugin.IPC.Classes.Notification instance Neovim.Plugin.IPC.Classes.Message Neovim.Plugin.IPC.Classes.Notification instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Plugin.IPC.Classes.Notification -- | This module reexports publicly available means to communicate between -- different plugins (or more generally threads running in the same -- plugin provider). module Neovim.Plugin.IPC -- | Taken from xmonad and based on ideas in /An Extensible -- Dynamically-Typed Hierarchy of Exceptions/, Simon Marlow, 2006. -- -- User-extensible messages must be put into a value of this type, so -- that it can be sent to other plugins. data SomeMessage SomeMessage :: msg -> SomeMessage -- | Try to convert a given message to a value of the message type we are -- interested in. Will evaluate to Nothing for any other type. fromMessage :: Message message => SomeMessage -> Maybe message -- | To shorten function and data type names, import this qualfied as -- Internal. module Neovim.Context.Internal -- | 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. newtype Neovim r st a Neovim :: ResourceT (StateT st (ReaderT (Config r st) IO)) a -> Neovim r st a [unNeovim] :: Neovim r st a -> ResourceT (StateT st (ReaderT (Config r st) IO)) a -- | User facing instance declaration for the reader state. -- | Same as ask for the InternalConfig. ask' :: Neovim r st (Config r st) -- | Same as asks for the InternalConfig. asks' :: (Config r st -> a) -> Neovim r st a -- | Convenience alias for Neovim () (). type Neovim' = Neovim () () exceptionHandlers :: [Handler IO (Either Doc a)] -- | Initialize a Neovim context by supplying an -- InternalEnvironment. runNeovim :: NFData a => Config r st -> st -> Neovim r st a -> IO (Either Doc (a, st)) runNeovimInternal :: ((a, st) -> IO (a, st)) -> Config r st -> st -> Neovim r st a -> IO (Either Doc (a, st)) -- | 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. FIXME This function is pretty -- much unused and mayhave undesired effects, namely that you cannot -- register autocmds in the forked thread. forkNeovim :: NFData a => ir -> ist -> Neovim ir ist a -> Neovim r st ThreadId -- | Create a new unique function name. To prevent possible name clashes, -- digits are stripped from the given suffix. newUniqueFunctionName :: Neovim r st FunctionName -- | This data type is used to dispatch a remote function call to the -- appopriate recipient. data FunctionType -- | Stateless functions are simply executed with the sent -- arguments. Stateless :: ([Object] -> Neovim' Object) -> FunctionType -- | Stateful functions are handled within a special thread, the -- TQueue is the communication endpoint for the arguments we have -- to pass. Stateful :: (TQueue SomeMessage) -> FunctionType -- | Type of the values stored in the function map. type FunctionMapEntry = (FunctionalityDescription, FunctionType) -- | A function map is a map containing the names of functions as keys and -- some context dependent value which contains all the necessary -- information to execute that function in the intended way. -- -- This type is only used internally and handles two distinct cases. One -- case is a direct function call, wich is simply a function that accepts -- a list of Object values and returns a result in the -- Neovim context. The second case is calling a function that has -- a persistent state. This is mediated to a thread that reads from a -- TQueue. (NB: persistent currently means, that state is stored -- for as long as the plugin provider is running and not restarted.) type FunctionMap = Map FunctionName FunctionMapEntry -- | Create a new function map from the given list of -- FunctionMapEntry values. mkFunctionMap :: [FunctionMapEntry] -> FunctionMap -- | A wrapper for a reader value that contains extra fields required to -- communicate with the messagepack-rpc components and provide necessary -- data to provide other globally available operations. -- -- Note that you most probably do not want to change the fields prefixed -- with an underscore. data Config r st Config :: TQueue SomeMessage -> MVar StateTransition -> TMVar (Either String Int) -> TVar Integer -> TMVar FunctionMap -> Maybe (PluginSettings r st) -> r -> Config r st -- | A queue of messages that the event handler will propagate to -- appropriate threads and handlers. [eventQueue] :: Config r st -> TQueue SomeMessage -- | The main thread will wait for this MVar to be filled with a -- value and then perform an action appropriate for the value of type -- StateTransition. [transitionTo] :: Config r st -> MVar StateTransition -- | Since nvim-hs must have its Neovim.RPC.SocketReader and -- Neovim.RPC.EventHandler running to determine the actual channel -- id (i.e. the Int value here) this field can only be set -- properly later. Hence, the value of this field is put in an -- TMVar. Name that is used to identify this provider. Assigning -- such a name is done in the neovim config (e.g. ~/.nvim/nvimrc). [providerName] :: Config r st -> TMVar (Either String Int) -- | This TVar is used to generate uniqe function names on the side -- of nvim-hs. This is useful if you don't want to overwrite -- existing functions or if you create autocmd functions. [uniqueCounter] :: Config r st -> TVar Integer -- | This map is used to dispatch received messagepack function calls to -- it's appropriate targets. [globalFunctionMap] :: Config r st -> TMVar FunctionMap -- | In a registered functionality this field contains a function (and -- possibly some context dependent values) to register new functionality. [pluginSettings] :: Config r st -> Maybe (PluginSettings r st) -- | Plugin author supplyable custom configuration. Queried on the -- user-facing side with ask or asks. [customConfig] :: Config r st -> r -- | Convenient helper to create a new config for the given state and -- read-only config. -- -- Sets the pluginSettings field to Nothing. retypeConfig :: r -> st -> Config anotherR anotherSt -> Config r st -- | This GADT is used to share information between stateless and stateful -- plugin threads since they work fundamentally in the same way. They -- both contain a function to register some functionality in the plugin -- provider as well as some values which are specific to the one or the -- other context. data PluginSettings r st [StatelessSettings] :: (FunctionalityDescription -> ([Object] -> Neovim' Object) -> Neovim' (Maybe FunctionMapEntry)) -> PluginSettings () () [StatefulSettings] :: (FunctionalityDescription -> ([Object] -> Neovim r st Object) -> TQueue SomeMessage -> TVar (Map FunctionName ([Object] -> Neovim r st Object)) -> Neovim r st (Maybe FunctionMapEntry)) -> TQueue SomeMessage -> TVar (Map FunctionName ([Object] -> Neovim r st Object)) -> PluginSettings r st -- | Create a new InternalConfig object by providing the minimal -- amount of necessary information. -- -- This function should only be called once per nvim-hs session -- since the arguments are shared across processes. newConfig :: IO (Maybe String) -> IO r -> IO (Config r context) -- | The state that the plugin provider wants to transition to. data StateTransition -- | Quit the plugin provider. Quit :: StateTransition -- | Restart the plugin provider. Restart :: StateTransition -- | The plugin provider failed to start or some other error occured. Failure :: Doc -> StateTransition -- | The plugin provider started successfully. InitSuccess :: StateTransition instance Control.Monad.Trans.Resource.Internal.MonadResource (Neovim.Context.Internal.Neovim r st) instance Control.Monad.Catch.MonadMask (Neovim.Context.Internal.Neovim r st) instance Control.Monad.Catch.MonadCatch (Neovim.Context.Internal.Neovim r st) instance Control.Monad.Catch.MonadThrow (Neovim.Context.Internal.Neovim r st) instance Control.Monad.State.Class.MonadState st (Neovim.Context.Internal.Neovim r st) instance Control.Monad.IO.Class.MonadIO (Neovim.Context.Internal.Neovim r st) instance GHC.Base.Monad (Neovim.Context.Internal.Neovim r st) instance GHC.Base.Applicative (Neovim.Context.Internal.Neovim r st) instance GHC.Base.Functor (Neovim.Context.Internal.Neovim r st) instance GHC.Show.Show Neovim.Context.Internal.StateTransition instance Control.Monad.Base.MonadBase GHC.Types.IO (Neovim.Context.Internal.Neovim r st) instance Control.Monad.Reader.Class.MonadReader r (Neovim.Context.Internal.Neovim r st) instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.Context.Internal.FunctionType module Neovim.Context -- | Create a new unique function name. To prevent possible name clashes, -- digits are stripped from the given suffix. newUniqueFunctionName :: Neovim r st FunctionName -- | 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 Neovim r st a -- | Convenience alias for Neovim () (). type Neovim' = Neovim () () -- | Exceptions specific to nvim-hs. data NeovimException -- | Simply error message that is passed to neovim. It should currently -- only contain one line of text. ErrorMessage :: Doc -> NeovimException -- | Error that can be returned by a remote API call. A call of -- fromObject on this value could be converted to a value of -- NeovimExceptionGen. ErrorResult :: Object -> NeovimException -- | A function map is a map containing the names of functions as keys and -- some context dependent value which contains all the necessary -- information to execute that function in the intended way. -- -- This type is only used internally and handles two distinct cases. One -- case is a direct function call, wich is simply a function that accepts -- a list of Object values and returns a result in the -- Neovim context. The second case is calling a function that has -- a persistent state. This is mediated to a thread that reads from a -- TQueue. (NB: persistent currently means, that state is stored -- for as long as the plugin provider is running and not restarted.) type FunctionMap = Map FunctionName FunctionMapEntry -- | Type of the values stored in the function map. type FunctionMapEntry = (FunctionalityDescription, FunctionType) -- | Create a new function map from the given list of -- FunctionMapEntry values. mkFunctionMap :: [FunctionMapEntry] -> FunctionMap -- | Initialize a Neovim context by supplying an -- InternalEnvironment. runNeovim :: NFData a => Config r st -> st -> Neovim r st a -> IO (Either Doc (a, st)) -- | 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. FIXME This function is pretty -- much unused and mayhave undesired effects, namely that you cannot -- register autocmds in the forked thread. forkNeovim :: NFData a => ir -> ist -> Neovim ir ist a -> Neovim r st ThreadId -- | throw specialized to a Pretty value. err :: Pretty err => err -> Neovim r st a errOnInvalidResult :: (NvimObject o) => Neovim r st (Either NeovimException Object) -> Neovim r st o -- | Initiate a restart of the plugin provider. restart :: Neovim r st () -- | Initiate the termination of the plugin provider. quit :: Neovim r st () -- | Retrieves the monad environment. ask :: MonadReader r m => m r -- | Retrieves a function of the current environment. asks :: MonadReader r m => (r -> a) -> m a -- | Return the state from the internals of the monad. get :: MonadState s m => m s -- | Gets specific component of the state, using a projection function -- supplied. gets :: MonadState s m => (s -> a) -> m a -- | Replace the state inside the monad. put :: MonadState s m => s -> m () -- | Monadic state transformer. -- -- Maps an old state to a new state inside a state monad. The old state -- is thrown away. -- --
--   Main> :t modify ((+1) :: Int -> Int)
--   modify (...) :: (MonadState Int a) => a ()
--   
-- -- This says that modify (+1) acts over any Monad that is a -- member of the MonadState class, with an Int state. modify :: MonadState s m => (s -> s) -> m () -- | Is used within a monadic computation to begin exception processing. throwError :: MonadError e m => forall a. e -> m a module Neovim.Plugin.Internal -- | This data type is used in the plugin registration to properly register -- the functions. newtype ExportedFunctionality r st EF :: (FunctionalityDescription, [Object] -> Neovim r st Object) -> ExportedFunctionality r st -- | This datatype contains the initial state (mutable and immutable) for -- the functionalities defined here. data StatefulFunctionality r st StatefulFunctionality :: r -> st -> [ExportedFunctionality r st] -> StatefulFunctionality r st [readOnly] :: StatefulFunctionality r st -> r [writable] :: StatefulFunctionality r st -> st [functionalities] :: StatefulFunctionality r st -> [ExportedFunctionality r st] -- | Extract the function of an ExportedFunctionality. getFunction :: ExportedFunctionality r st -> [Object] -> Neovim r st Object -- | Extract the description of an ExportedFunctionality. getDescription :: ExportedFunctionality r st -> FunctionalityDescription -- | Plugin values are wraped inside this data type via -- wrapPlugin so that we can put plugins in an ordinary list. data NeovimPlugin NeovimPlugin :: (Plugin r st) -> NeovimPlugin -- | This data type contains meta information for the plugin manager. data Plugin r st Plugin :: [ExportedFunctionality () ()] -> [StatefulFunctionality r st] -> Plugin r st [exports] :: Plugin r st -> [ExportedFunctionality () ()] [statefulExports] :: Plugin r st -> [StatefulFunctionality r st] -- | Wrap a Plugin in some nice blankets, so that we can put them in -- a simple list. wrapPlugin :: Applicative m => Plugin r st -> m NeovimPlugin instance Neovim.Plugin.Classes.HasFunctionName (Neovim.Plugin.Internal.ExportedFunctionality r st) module Neovim.Config -- | This data type contains information about the configuration of neovim. -- See the fields' documentation for what you possibly want to change. -- Also, the tutorial in the Neovim module should get you started. data NeovimConfig Config :: [Neovim (StartupConfig NeovimConfig) () NeovimPlugin] -> Maybe (FilePath, Priority) -> Maybe String -> NeovimConfig -- | The list of plugins. The IO type inside the list allows the plugin -- author to run some arbitrary startup code before creating a value of -- type NeovimPlugin. [plugins] :: NeovimConfig -> [Neovim (StartupConfig NeovimConfig) () NeovimPlugin] -- | Set the general logging options. [logOptions] :: NeovimConfig -> Maybe (FilePath, Priority) -- | Internally used field. Changing this has no effect. -- -- Used by Dyre for storing compilation errors. [errorMessage] :: NeovimConfig -> Maybe String module Neovim.RPC.Common -- | Things shared between the socket reader and the event handler. data RPCConfig RPCConfig :: TVar (Map Int64 (UTCTime, TMVar (Either Object Object))) -> RPCConfig -- | 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. [recipients] :: RPCConfig -> TVar (Map Int64 (UTCTime, TMVar (Either Object Object))) -- | Create a new basic configuration containing a communication channel -- for remote procedure call events and an empty lookup table for -- functions to mediate. newRPCConfig :: (Applicative io, MonadIO io) => io RPCConfig -- | Simple data type defining the kind of socket the socket reader should -- use. data SocketType -- | Use the handle for receiving msgpack-rpc messages. This is suitable -- for an embedded neovim which is used in test cases. Stdout :: Handle -> SocketType -- | Read the connection information from the environment variable -- NVIM_LISTEN_ADDRESS. Environment :: SocketType -- | Use a unix socket. UnixSocket :: FilePath -> SocketType -- | Use an IP socket. First argument is the port and the second is the -- host name. TCP :: Int -> String -> SocketType -- | Create a Handle from the given socket description. -- -- The handle is not automatically closed. createHandle :: (Functor io, MonadIO io) => SocketType -> io Handle -- | Close the handle and print a warning if the conduit chain has been -- interrupted prematurely. cleanUpHandle :: (MonadIO io) => Handle -> Bool -> io () module Neovim.Util -- | Execute the given action with a changed set of environment variables -- and restore the original state of the environment afterwards. withCustomEnvironment :: (MonadMask io, MonadIO io) => [(String, Maybe String)] -> io a -> io a -- | when with a monadic predicate. whenM :: (Monad m) => m Bool -> m () -> m () -- | unless with a monadic predicate. unlessM :: (Monad m) => m Bool -> m () -> m () oneLineErrorMessage :: Doc -> String -- | Import this module qualified as MsgpackRPC module Neovim.RPC.Classes -- | See -- https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md -- for details about the msgpack rpc specification. data Message -- | Request in the sense of the msgpack rpc specification -- -- Parameters * Message identifier that has to be put in the response to -- this request * Function name * Function arguments Request :: Request -> Message -- | Response in the sense of the msgpack rpc specifcation -- -- Parameters * Mesage identifier which matches a request * Either -- an error Object or a result Object Response :: !Int64 -> (Either Object Object) -> Message -- | Notification in the sense of the msgpack rpc specification Notification :: Notification -> Message instance GHC.Generics.Generic Neovim.RPC.Classes.Message instance GHC.Show.Show Neovim.RPC.Classes.Message instance GHC.Classes.Ord Neovim.RPC.Classes.Message instance GHC.Classes.Eq Neovim.RPC.Classes.Message instance Control.DeepSeq.NFData Neovim.RPC.Classes.Message instance Neovim.Plugin.IPC.Classes.Message Neovim.RPC.Classes.Message instance Neovim.Classes.NvimObject Neovim.RPC.Classes.Message instance Text.PrettyPrint.ANSI.Leijen.Pretty Neovim.RPC.Classes.Message module Neovim.RPC.FunctionCall -- | Helper function that concurrently puts a Message in the event -- queue and returns an STM action that returns the result. acall :: (NvimObject result) => FunctionName -> [Object] -> Neovim r st (STM (Either NeovimException result)) -- | Helper function similar to acall that throws a runtime -- exception if the result is an error object. acall' :: (NvimObject result) => FunctionName -> [Object] -> Neovim r st (STM result) -- | Call a neovim function synchronously. This function blocks until the -- result is available. scall :: (NvimObject result) => FunctionName -> [Object] -> Neovim r st (Either NeovimException result) -- | Helper function similar to scall that throws a runtime -- exception if the result is an error object. scall' :: NvimObject result => FunctionName -> [Object] -> Neovim r st result -- | Similar to scall, but throw a NeovimException instead of -- returning it. scallThrow :: (NvimObject result) => FunctionName -> [Object] -> Neovim r st result -- | Lifted variant of atomically. atomically' :: (MonadIO io) => STM result -> io result -- | Wait for the result of the STM action. -- -- This action possibly blocks as it is an alias for ioSTM -> -- ioSTM >>= liftIO . atomically. wait :: Neovim r st (STM result) -> Neovim r st result -- | Variant of wait that discards the result. wait' :: Neovim r st (STM result) -> Neovim r st () -- | Wait for the result of the STM action and call err . -- (loc++) . show if the action returned an error. waitErr :: (Pretty e) => String -> Neovim r st (STM (Either e result)) -> Neovim r st result -- | waitErr that discards the result. waitErr' :: (Pretty e) => String -> Neovim r st (STM (Either e result)) -> Neovim r st () -- | Send the result back to the neovim instance. respond :: (NvimObject result) => Request -> Either String result -> Neovim r st () module Neovim.RPC.EventHandler -- | This function will establish a connection to the given socket and -- write msgpack-rpc requests to it. runEventHandler :: Handle -> Config RPCConfig Int64 -> IO () instance Control.Monad.Reader.Class.MonadReader (Neovim.Context.Internal.Config Neovim.RPC.Common.RPCConfig GHC.Int.Int64) Neovim.RPC.EventHandler.EventHandler instance Control.Monad.IO.Class.MonadIO Neovim.RPC.EventHandler.EventHandler instance Control.Monad.State.Class.MonadState GHC.Int.Int64 Neovim.RPC.EventHandler.EventHandler instance GHC.Base.Monad Neovim.RPC.EventHandler.EventHandler instance GHC.Base.Applicative Neovim.RPC.EventHandler.EventHandler instance GHC.Base.Functor Neovim.RPC.EventHandler.EventHandler module Neovim.API.Parser -- | This data type represents the top-level structure of the nvim -- --api-info output. data NeovimAPI NeovimAPI :: [(String, Int64)] -> [(String, Int64)] -> [NeovimFunction] -> NeovimAPI -- | The error types are defined by a name and an identifier. [errorTypes] :: NeovimAPI -> [(String, Int64)] -- | Extension types defined by neovim. [customTypes] :: NeovimAPI -> [(String, Int64)] -- | The remotely executable functions provided by the neovim api. [functions] :: NeovimAPI -> [NeovimFunction] -- | This data type contains simple information about a function as -- received throudh the nvim --api-info command. data NeovimFunction NeovimFunction :: String -> [(NeovimType, String)] -> Bool -> Bool -> NeovimType -> NeovimFunction -- | function name [name] :: NeovimFunction -> String -- | A list of type name and variable name. [parameters] :: NeovimFunction -> [(NeovimType, String)] -- | Indicator whether the function can fail/throws exceptions. [canFail] :: NeovimFunction -> Bool -- | Indicator whether the this function is asynchronous. [async] :: NeovimFunction -> Bool -- | Functions return type. [returnType] :: NeovimFunction -> NeovimType data NeovimType SimpleType :: String -> NeovimType NestedType :: NeovimType -> (Maybe Int) -> NeovimType Void :: NeovimType -- | Run nvim --api-info and parse its output. parseAPI :: IO (Either Doc NeovimAPI) instance GHC.Show.Show Neovim.API.Parser.NeovimAPI instance GHC.Show.Show Neovim.API.Parser.NeovimFunction instance GHC.Classes.Eq Neovim.API.Parser.NeovimType instance GHC.Show.Show Neovim.API.Parser.NeovimType module Neovim.API.TH -- | Generate the API types and functions provided by nvim -- --api-info. -- -- The provided map allows the use of different Haskell types for the -- types defined in the API. The types must be an instance of -- NvimObject and they must form an isomorphism with the sent -- messages types. Currently, it provides a Convenient way to replace the -- String type with Text, ByteString or -- String. generateAPI :: Map String (Q Type) -> Q [Dec] -- | Define an exported function by providing a custom name and referencing -- the function you want to export. -- -- Note that the name must start with an upper case letter. -- -- Example: $(function "MyExportedFunction" 'myDefinedFunction) -- Sync function :: String -> Name -> Q Exp -- | Define an exported function. This function works exactly like -- function, but it generates the exported name automatically by -- converting the first letter to upper case. function' :: Name -> Q Exp -- | Similarly to function, this function is used to export a -- command with a custom name. -- -- Note that commands must start with an upper case letter. -- -- Due to limitations on the side of (neo)vim, commands can only have one -- of the following five signatures, where you can replace String -- with ByteString or Text if you wish: -- -- -- -- Example: $(command "RememberThePrime" 'someFunction) -- [CmdBang] -- -- Note that the list of command options (i.e. the last argument) removes -- duplicate options by means of some internally convenient sorting. You -- should simply not define the same option twice. command :: String -> Name -> Q Exp -- | Define an exported command. This function works exactly like -- command, but it generates the command name by converting the -- first letter to upper case. command' :: Name -> Q Exp autocmd :: Name -> Q Exp -- | Default type mappings for the requested API. defaultAPITypeToHaskellTypeMap :: Map String (Q Type) instance GHC.Read.Read Neovim.API.TH.ArgType instance GHC.Show.Show Neovim.API.TH.ArgType instance GHC.Classes.Ord Neovim.API.TH.ArgType instance GHC.Classes.Eq Neovim.API.TH.ArgType -- | Note that this module is completely generated. If you're reading this -- on hackage, the actual functions of this module may be different from -- what is available to you. All the functions in this module depend on -- the neovim version that was used when this package was compiled. module Neovim.API.String data NeovimExceptionGen NeovimException :: !ByteString -> NeovimExceptionGen NeovimValidation :: !ByteString -> NeovimExceptionGen data Buffer Buffer :: !ByteString -> Buffer data Tabpage Tabpage :: !ByteString -> Tabpage data Window Window :: !ByteString -> Window window_is_valid' :: Window -> forall r st. Neovim r st Bool window_is_valid :: Window -> forall r st. Neovim r st (Either NeovimException Bool) window_get_tabpage' :: Window -> forall r st. Neovim r st Tabpage window_get_tabpage :: Window -> forall r st. Neovim r st (Either NeovimException Tabpage) window_get_position' :: Window -> forall r st. Neovim r st (Int64, Int64) window_get_position :: Window -> forall r st. Neovim r st (Either NeovimException (Int64, Int64)) window_set_option' :: Window -> String -> Object -> forall r st. Neovim r st () window_set_option :: Window -> String -> Object -> forall r st. Neovim r st (Either NeovimException ()) window_get_option' :: Window -> String -> forall r st. Neovim r st Object window_get_option :: Window -> String -> forall r st. Neovim r st (Either NeovimException Object) window_get_var' :: Window -> String -> forall r st. Neovim r st Object window_get_var :: Window -> String -> forall r st. Neovim r st (Either NeovimException Object) window_set_width' :: Window -> Int64 -> forall r st. Neovim r st () window_set_width :: Window -> Int64 -> forall r st. Neovim r st (Either NeovimException ()) window_get_width' :: Window -> forall r st. Neovim r st Int64 window_get_width :: Window -> forall r st. Neovim r st (Either NeovimException Int64) window_set_height' :: Window -> Int64 -> forall r st. Neovim r st () window_set_height :: Window -> Int64 -> forall r st. Neovim r st (Either NeovimException ()) window_get_height' :: Window -> forall r st. Neovim r st Int64 window_get_height :: Window -> forall r st. Neovim r st (Either NeovimException Int64) window_set_cursor' :: Window -> (Int64, Int64) -> forall r st. Neovim r st () window_set_cursor :: Window -> (Int64, Int64) -> forall r st. Neovim r st (Either NeovimException ()) window_get_cursor' :: Window -> forall r st. Neovim r st (Int64, Int64) window_get_cursor :: Window -> forall r st. Neovim r st (Either NeovimException (Int64, Int64)) window_get_buffer' :: Window -> forall r st. Neovim r st Buffer window_get_buffer :: Window -> forall r st. Neovim r st (Either NeovimException Buffer) vim_get_api_info' :: forall r st. Neovim r st [Object] vim_get_api_info :: forall r st. Neovim r st (Either NeovimException [Object]) vim_get_color_map' :: forall r st. Neovim r st (Map Object Object) vim_get_color_map :: forall r st. Neovim r st (Either NeovimException (Map Object Object)) vim_name_to_color' :: String -> forall r st. Neovim r st Int64 vim_name_to_color :: String -> forall r st. Neovim r st (Either NeovimException Int64) vim_unsubscribe' :: String -> forall r st. Neovim r st () vim_unsubscribe :: String -> forall r st. Neovim r st (Either NeovimException ()) vim_subscribe' :: String -> forall r st. Neovim r st () vim_subscribe :: String -> forall r st. Neovim r st (Either NeovimException ()) vim_set_current_tabpage' :: Tabpage -> forall r st. Neovim r st () vim_set_current_tabpage :: Tabpage -> forall r st. Neovim r st (Either NeovimException ()) vim_get_current_tabpage' :: forall r st. Neovim r st Tabpage vim_get_current_tabpage :: forall r st. Neovim r st (Either NeovimException Tabpage) vim_get_tabpages' :: forall r st. Neovim r st [Tabpage] vim_get_tabpages :: forall r st. Neovim r st (Either NeovimException [Tabpage]) vim_set_current_window' :: Window -> forall r st. Neovim r st () vim_set_current_window :: Window -> forall r st. Neovim r st (Either NeovimException ()) vim_get_current_window' :: forall r st. Neovim r st Window vim_get_current_window :: forall r st. Neovim r st (Either NeovimException Window) vim_get_windows' :: forall r st. Neovim r st [Window] vim_get_windows :: forall r st. Neovim r st (Either NeovimException [Window]) vim_set_current_buffer' :: Buffer -> forall r st. Neovim r st () vim_set_current_buffer :: Buffer -> forall r st. Neovim r st (Either NeovimException ()) vim_get_current_buffer' :: forall r st. Neovim r st Buffer vim_get_current_buffer :: forall r st. Neovim r st (Either NeovimException Buffer) vim_get_buffers' :: forall r st. Neovim r st [Buffer] vim_get_buffers :: forall r st. Neovim r st (Either NeovimException [Buffer]) vim_report_error' :: String -> forall r st. Neovim r st () vim_report_error :: String -> forall r st. Neovim r st (Either NeovimException ()) vim_err_write' :: String -> forall r st. Neovim r st () vim_err_write :: String -> forall r st. Neovim r st (Either NeovimException ()) vim_out_write' :: String -> forall r st. Neovim r st () vim_out_write :: String -> forall r st. Neovim r st (Either NeovimException ()) vim_set_option' :: String -> Object -> forall r st. Neovim r st () vim_set_option :: String -> Object -> forall r st. Neovim r st (Either NeovimException ()) vim_get_option' :: String -> forall r st. Neovim r st Object vim_get_option :: String -> forall r st. Neovim r st (Either NeovimException Object) vim_get_vvar' :: String -> forall r st. Neovim r st Object vim_get_vvar :: String -> forall r st. Neovim r st (Either NeovimException Object) vim_get_var' :: String -> forall r st. Neovim r st Object vim_get_var :: String -> forall r st. Neovim r st (Either NeovimException Object) vim_del_current_line' :: forall r st. Neovim r st () vim_del_current_line :: forall r st. Neovim r st (Either NeovimException ()) vim_set_current_line' :: String -> forall r st. Neovim r st () vim_set_current_line :: String -> forall r st. Neovim r st (Either NeovimException ()) vim_get_current_line' :: forall r st. Neovim r st String vim_get_current_line :: forall r st. Neovim r st (Either NeovimException String) vim_change_directory' :: String -> forall r st. Neovim r st () vim_change_directory :: String -> forall r st. Neovim r st (Either NeovimException ()) vim_list_runtime_paths' :: forall r st. Neovim r st [String] vim_list_runtime_paths :: forall r st. Neovim r st (Either NeovimException [String]) vim_strwidth' :: String -> forall r st. Neovim r st Int64 vim_strwidth :: String -> forall r st. Neovim r st (Either NeovimException Int64) vim_call_function' :: String -> [Object] -> forall r st. Neovim r st Object vim_call_function :: String -> [Object] -> forall r st. Neovim r st (Either NeovimException Object) vim_eval' :: String -> forall r st. Neovim r st Object vim_eval :: String -> forall r st. Neovim r st (Either NeovimException Object) vim_command_output' :: String -> forall r st. Neovim r st String vim_command_output :: String -> forall r st. Neovim r st (Either NeovimException String) vim_replace_termcodes' :: String -> Bool -> Bool -> Bool -> forall r st. Neovim r st String vim_replace_termcodes :: String -> Bool -> Bool -> Bool -> forall r st. Neovim r st (Either NeovimException String) vim_input' :: String -> forall r st. Neovim r st Int64 vim_input :: String -> forall r st. Neovim r st (Either NeovimException Int64) vim_feedkeys' :: String -> String -> Bool -> forall r st. Neovim r st () vim_feedkeys :: String -> String -> Bool -> forall r st. Neovim r st (Either NeovimException ()) vim_command' :: String -> forall r st. Neovim r st () vim_command :: String -> forall r st. Neovim r st (Either NeovimException ()) ui_try_resize' :: Int64 -> Int64 -> forall r st. Neovim r st Object ui_try_resize :: Int64 -> Int64 -> forall r st. Neovim r st (Either NeovimException Object) ui_detach' :: forall r st. Neovim r st () ui_detach :: forall r st. Neovim r st (Either NeovimException ()) tabpage_is_valid' :: Tabpage -> forall r st. Neovim r st Bool tabpage_is_valid :: Tabpage -> forall r st. Neovim r st (Either NeovimException Bool) tabpage_get_window' :: Tabpage -> forall r st. Neovim r st Window tabpage_get_window :: Tabpage -> forall r st. Neovim r st (Either NeovimException Window) tabpage_get_var' :: Tabpage -> String -> forall r st. Neovim r st Object tabpage_get_var :: Tabpage -> String -> forall r st. Neovim r st (Either NeovimException Object) tabpage_get_windows' :: Tabpage -> forall r st. Neovim r st [Window] tabpage_get_windows :: Tabpage -> forall r st. Neovim r st (Either NeovimException [Window]) buffer_clear_highlight' :: Buffer -> Int64 -> Int64 -> Int64 -> forall r st. Neovim r st () buffer_clear_highlight :: Buffer -> Int64 -> Int64 -> Int64 -> forall r st. Neovim r st (Either NeovimException ()) buffer_add_highlight' :: Buffer -> Int64 -> String -> Int64 -> Int64 -> Int64 -> forall r st. Neovim r st Int64 buffer_add_highlight :: Buffer -> Int64 -> String -> Int64 -> Int64 -> Int64 -> forall r st. Neovim r st (Either NeovimException Int64) buffer_get_mark' :: Buffer -> String -> forall r st. Neovim r st (Int64, Int64) buffer_get_mark :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException (Int64, Int64)) buffer_is_valid' :: Buffer -> forall r st. Neovim r st Bool buffer_is_valid :: Buffer -> forall r st. Neovim r st (Either NeovimException Bool) buffer_set_name' :: Buffer -> String -> forall r st. Neovim r st () buffer_set_name :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException ()) buffer_get_name' :: Buffer -> forall r st. Neovim r st String buffer_get_name :: Buffer -> forall r st. Neovim r st (Either NeovimException String) buffer_get_number' :: Buffer -> forall r st. Neovim r st Int64 buffer_get_number :: Buffer -> forall r st. Neovim r st (Either NeovimException Int64) buffer_set_option' :: Buffer -> String -> Object -> forall r st. Neovim r st () buffer_set_option :: Buffer -> String -> Object -> forall r st. Neovim r st (Either NeovimException ()) buffer_get_option' :: Buffer -> String -> forall r st. Neovim r st Object buffer_get_option :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException Object) buffer_get_var' :: Buffer -> String -> forall r st. Neovim r st Object buffer_get_var :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException Object) buffer_set_lines' :: Buffer -> Int64 -> Int64 -> Bool -> [String] -> forall r st. Neovim r st () buffer_set_lines :: Buffer -> Int64 -> Int64 -> Bool -> [String] -> forall r st. Neovim r st (Either NeovimException ()) buffer_get_lines' :: Buffer -> Int64 -> Int64 -> Bool -> forall r st. Neovim r st [String] buffer_get_lines :: Buffer -> Int64 -> Int64 -> Bool -> forall r st. Neovim r st (Either NeovimException [String]) buffer_line_count' :: Buffer -> forall r st. Neovim r st Int64 buffer_line_count :: Buffer -> forall r st. Neovim r st (Either NeovimException Int64) nvim_win_is_valid' :: Window -> forall r st. Neovim r st Bool nvim_win_is_valid :: Window -> forall r st. Neovim r st (Either NeovimException Bool) nvim_win_get_number' :: Window -> forall r st. Neovim r st Int64 nvim_win_get_number :: Window -> forall r st. Neovim r st (Either NeovimException Int64) nvim_win_get_tabpage' :: Window -> forall r st. Neovim r st Tabpage nvim_win_get_tabpage :: Window -> forall r st. Neovim r st (Either NeovimException Tabpage) nvim_win_get_position' :: Window -> forall r st. Neovim r st (Int64, Int64) nvim_win_get_position :: Window -> forall r st. Neovim r st (Either NeovimException (Int64, Int64)) nvim_win_set_option' :: Window -> String -> Object -> forall r st. Neovim r st () nvim_win_set_option :: Window -> String -> Object -> forall r st. Neovim r st (Either NeovimException ()) nvim_win_get_option' :: Window -> String -> forall r st. Neovim r st Object nvim_win_get_option :: Window -> String -> forall r st. Neovim r st (Either NeovimException Object) window_del_var' :: Window -> String -> forall r st. Neovim r st Object window_del_var :: Window -> String -> forall r st. Neovim r st (Either NeovimException Object) window_set_var' :: Window -> String -> Object -> forall r st. Neovim r st Object window_set_var :: Window -> String -> Object -> forall r st. Neovim r st (Either NeovimException Object) nvim_win_del_var' :: Window -> String -> forall r st. Neovim r st () nvim_win_del_var :: Window -> String -> forall r st. Neovim r st (Either NeovimException ()) nvim_win_set_var' :: Window -> String -> Object -> forall r st. Neovim r st () nvim_win_set_var :: Window -> String -> Object -> forall r st. Neovim r st (Either NeovimException ()) nvim_win_get_var' :: Window -> String -> forall r st. Neovim r st Object nvim_win_get_var :: Window -> String -> forall r st. Neovim r st (Either NeovimException Object) nvim_win_set_width' :: Window -> Int64 -> forall r st. Neovim r st () nvim_win_set_width :: Window -> Int64 -> forall r st. Neovim r st (Either NeovimException ()) nvim_win_get_width' :: Window -> forall r st. Neovim r st Int64 nvim_win_get_width :: Window -> forall r st. Neovim r st (Either NeovimException Int64) nvim_win_set_height' :: Window -> Int64 -> forall r st. Neovim r st () nvim_win_set_height :: Window -> Int64 -> forall r st. Neovim r st (Either NeovimException ()) nvim_win_get_height' :: Window -> forall r st. Neovim r st Int64 nvim_win_get_height :: Window -> forall r st. Neovim r st (Either NeovimException Int64) nvim_win_set_cursor' :: Window -> (Int64, Int64) -> forall r st. Neovim r st () nvim_win_set_cursor :: Window -> (Int64, Int64) -> forall r st. Neovim r st (Either NeovimException ()) nvim_win_get_cursor' :: Window -> forall r st. Neovim r st (Int64, Int64) nvim_win_get_cursor :: Window -> forall r st. Neovim r st (Either NeovimException (Int64, Int64)) nvim_win_get_buf' :: Window -> forall r st. Neovim r st Buffer nvim_win_get_buf :: Window -> forall r st. Neovim r st (Either NeovimException Buffer) nvim_call_atomic' :: [Object] -> forall r st. Neovim r st [Object] nvim_call_atomic :: [Object] -> forall r st. Neovim r st (Either NeovimException [Object]) nvim_get_api_info' :: forall r st. Neovim r st [Object] nvim_get_api_info :: forall r st. Neovim r st (Either NeovimException [Object]) nvim_get_mode' :: forall r st. Neovim r st (Map Object Object) nvim_get_mode :: forall r st. Neovim r st (Either NeovimException (Map Object Object)) nvim_get_color_map' :: forall r st. Neovim r st (Map Object Object) nvim_get_color_map :: forall r st. Neovim r st (Either NeovimException (Map Object Object)) nvim_get_color_by_name' :: String -> forall r st. Neovim r st Int64 nvim_get_color_by_name :: String -> forall r st. Neovim r st (Either NeovimException Int64) nvim_unsubscribe' :: String -> forall r st. Neovim r st () nvim_unsubscribe :: String -> forall r st. Neovim r st (Either NeovimException ()) nvim_subscribe' :: String -> forall r st. Neovim r st () nvim_subscribe :: String -> forall r st. Neovim r st (Either NeovimException ()) nvim_set_current_tabpage' :: Tabpage -> forall r st. Neovim r st () nvim_set_current_tabpage :: Tabpage -> forall r st. Neovim r st (Either NeovimException ()) nvim_get_current_tabpage' :: forall r st. Neovim r st Tabpage nvim_get_current_tabpage :: forall r st. Neovim r st (Either NeovimException Tabpage) nvim_list_tabpages' :: forall r st. Neovim r st [Tabpage] nvim_list_tabpages :: forall r st. Neovim r st (Either NeovimException [Tabpage]) nvim_set_current_win' :: Window -> forall r st. Neovim r st () nvim_set_current_win :: Window -> forall r st. Neovim r st (Either NeovimException ()) nvim_get_current_win' :: forall r st. Neovim r st Window nvim_get_current_win :: forall r st. Neovim r st (Either NeovimException Window) nvim_list_wins' :: forall r st. Neovim r st [Window] nvim_list_wins :: forall r st. Neovim r st (Either NeovimException [Window]) nvim_set_current_buf' :: Buffer -> forall r st. Neovim r st () nvim_set_current_buf :: Buffer -> forall r st. Neovim r st (Either NeovimException ()) nvim_get_current_buf' :: forall r st. Neovim r st Buffer nvim_get_current_buf :: forall r st. Neovim r st (Either NeovimException Buffer) nvim_list_bufs' :: forall r st. Neovim r st [Buffer] nvim_list_bufs :: forall r st. Neovim r st (Either NeovimException [Buffer]) nvim_err_writeln' :: String -> forall r st. Neovim r st () nvim_err_writeln :: String -> forall r st. Neovim r st (Either NeovimException ()) nvim_err_write' :: String -> forall r st. Neovim r st () nvim_err_write :: String -> forall r st. Neovim r st (Either NeovimException ()) nvim_out_write' :: String -> forall r st. Neovim r st () nvim_out_write :: String -> forall r st. Neovim r st (Either NeovimException ()) nvim_set_option' :: String -> Object -> forall r st. Neovim r st () nvim_set_option :: String -> Object -> forall r st. Neovim r st (Either NeovimException ()) nvim_get_option' :: String -> forall r st. Neovim r st Object nvim_get_option :: String -> forall r st. Neovim r st (Either NeovimException Object) nvim_get_vvar' :: String -> forall r st. Neovim r st Object nvim_get_vvar :: String -> forall r st. Neovim r st (Either NeovimException Object) vim_del_var' :: String -> forall r st. Neovim r st Object vim_del_var :: String -> forall r st. Neovim r st (Either NeovimException Object) vim_set_var' :: String -> Object -> forall r st. Neovim r st Object vim_set_var :: String -> Object -> forall r st. Neovim r st (Either NeovimException Object) nvim_del_var' :: String -> forall r st. Neovim r st () nvim_del_var :: String -> forall r st. Neovim r st (Either NeovimException ()) nvim_set_var' :: String -> Object -> forall r st. Neovim r st () nvim_set_var :: String -> Object -> forall r st. Neovim r st (Either NeovimException ()) nvim_get_var' :: String -> forall r st. Neovim r st Object nvim_get_var :: String -> forall r st. Neovim r st (Either NeovimException Object) nvim_del_current_line' :: forall r st. Neovim r st () nvim_del_current_line :: forall r st. Neovim r st (Either NeovimException ()) nvim_set_current_line' :: String -> forall r st. Neovim r st () nvim_set_current_line :: String -> forall r st. Neovim r st (Either NeovimException ()) nvim_get_current_line' :: forall r st. Neovim r st String nvim_get_current_line :: forall r st. Neovim r st (Either NeovimException String) nvim_set_current_dir' :: String -> forall r st. Neovim r st () nvim_set_current_dir :: String -> forall r st. Neovim r st (Either NeovimException ()) nvim_list_runtime_paths' :: forall r st. Neovim r st [String] nvim_list_runtime_paths :: forall r st. Neovim r st (Either NeovimException [String]) nvim_strwidth' :: String -> forall r st. Neovim r st Int64 nvim_strwidth :: String -> forall r st. Neovim r st (Either NeovimException Int64) nvim_call_function' :: String -> [Object] -> forall r st. Neovim r st Object nvim_call_function :: String -> [Object] -> forall r st. Neovim r st (Either NeovimException Object) nvim_eval' :: String -> forall r st. Neovim r st Object nvim_eval :: String -> forall r st. Neovim r st (Either NeovimException Object) nvim_command_output' :: String -> forall r st. Neovim r st String nvim_command_output :: String -> forall r st. Neovim r st (Either NeovimException String) nvim_replace_termcodes' :: String -> Bool -> Bool -> Bool -> forall r st. Neovim r st String nvim_replace_termcodes :: String -> Bool -> Bool -> Bool -> forall r st. Neovim r st (Either NeovimException String) nvim_input' :: String -> forall r st. Neovim r st Int64 nvim_input :: String -> forall r st. Neovim r st (Either NeovimException Int64) nvim_feedkeys' :: String -> String -> Bool -> forall r st. Neovim r st () nvim_feedkeys :: String -> String -> Bool -> forall r st. Neovim r st (Either NeovimException ()) nvim_command' :: String -> forall r st. Neovim r st () nvim_command :: String -> forall r st. Neovim r st (Either NeovimException ()) nvim_ui_set_option' :: String -> Object -> forall r st. Neovim r st () nvim_ui_set_option :: String -> Object -> forall r st. Neovim r st (Either NeovimException ()) nvim_ui_try_resize' :: Int64 -> Int64 -> forall r st. Neovim r st () nvim_ui_try_resize :: Int64 -> Int64 -> forall r st. Neovim r st (Either NeovimException ()) nvim_ui_detach' :: forall r st. Neovim r st () nvim_ui_detach :: forall r st. Neovim r st (Either NeovimException ()) ui_attach' :: Int64 -> Int64 -> Bool -> forall r st. Neovim r st () ui_attach :: Int64 -> Int64 -> Bool -> forall r st. Neovim r st (Either NeovimException ()) nvim_ui_attach' :: Int64 -> Int64 -> Map Object Object -> forall r st. Neovim r st () nvim_ui_attach :: Int64 -> Int64 -> Map Object Object -> forall r st. Neovim r st (Either NeovimException ()) nvim_tabpage_is_valid' :: Tabpage -> forall r st. Neovim r st Bool nvim_tabpage_is_valid :: Tabpage -> forall r st. Neovim r st (Either NeovimException Bool) nvim_tabpage_get_number' :: Tabpage -> forall r st. Neovim r st Int64 nvim_tabpage_get_number :: Tabpage -> forall r st. Neovim r st (Either NeovimException Int64) nvim_tabpage_get_win' :: Tabpage -> forall r st. Neovim r st Window nvim_tabpage_get_win :: Tabpage -> forall r st. Neovim r st (Either NeovimException Window) tabpage_del_var' :: Tabpage -> String -> forall r st. Neovim r st Object tabpage_del_var :: Tabpage -> String -> forall r st. Neovim r st (Either NeovimException Object) tabpage_set_var' :: Tabpage -> String -> Object -> forall r st. Neovim r st Object tabpage_set_var :: Tabpage -> String -> Object -> forall r st. Neovim r st (Either NeovimException Object) nvim_tabpage_del_var' :: Tabpage -> String -> forall r st. Neovim r st () nvim_tabpage_del_var :: Tabpage -> String -> forall r st. Neovim r st (Either NeovimException ()) nvim_tabpage_set_var' :: Tabpage -> String -> Object -> forall r st. Neovim r st () nvim_tabpage_set_var :: Tabpage -> String -> Object -> forall r st. Neovim r st (Either NeovimException ()) nvim_tabpage_get_var' :: Tabpage -> String -> forall r st. Neovim r st Object nvim_tabpage_get_var :: Tabpage -> String -> forall r st. Neovim r st (Either NeovimException Object) nvim_tabpage_list_wins' :: Tabpage -> forall r st. Neovim r st [Window] nvim_tabpage_list_wins :: Tabpage -> forall r st. Neovim r st (Either NeovimException [Window]) nvim_buf_clear_highlight' :: Buffer -> Int64 -> Int64 -> Int64 -> forall r st. Neovim r st () nvim_buf_clear_highlight :: Buffer -> Int64 -> Int64 -> Int64 -> forall r st. Neovim r st (Either NeovimException ()) nvim_buf_add_highlight' :: Buffer -> Int64 -> String -> Int64 -> Int64 -> Int64 -> forall r st. Neovim r st Int64 nvim_buf_add_highlight :: Buffer -> Int64 -> String -> Int64 -> Int64 -> Int64 -> forall r st. Neovim r st (Either NeovimException Int64) nvim_buf_get_mark' :: Buffer -> String -> forall r st. Neovim r st (Int64, Int64) nvim_buf_get_mark :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException (Int64, Int64)) buffer_insert' :: Buffer -> Int64 -> [String] -> forall r st. Neovim r st () buffer_insert :: Buffer -> Int64 -> [String] -> forall r st. Neovim r st (Either NeovimException ()) nvim_buf_is_valid' :: Buffer -> forall r st. Neovim r st Bool nvim_buf_is_valid :: Buffer -> forall r st. Neovim r st (Either NeovimException Bool) nvim_buf_set_name' :: Buffer -> String -> forall r st. Neovim r st () nvim_buf_set_name :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException ()) nvim_buf_get_name' :: Buffer -> forall r st. Neovim r st String nvim_buf_get_name :: Buffer -> forall r st. Neovim r st (Either NeovimException String) nvim_buf_get_number' :: Buffer -> forall r st. Neovim r st Int64 nvim_buf_get_number :: Buffer -> forall r st. Neovim r st (Either NeovimException Int64) nvim_buf_set_option' :: Buffer -> String -> Object -> forall r st. Neovim r st () nvim_buf_set_option :: Buffer -> String -> Object -> forall r st. Neovim r st (Either NeovimException ()) nvim_buf_get_option' :: Buffer -> String -> forall r st. Neovim r st Object nvim_buf_get_option :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException Object) buffer_del_var' :: Buffer -> String -> forall r st. Neovim r st Object buffer_del_var :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException Object) buffer_set_var' :: Buffer -> String -> Object -> forall r st. Neovim r st Object buffer_set_var :: Buffer -> String -> Object -> forall r st. Neovim r st (Either NeovimException Object) nvim_buf_del_var' :: Buffer -> String -> forall r st. Neovim r st () nvim_buf_del_var :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException ()) nvim_buf_set_var' :: Buffer -> String -> Object -> forall r st. Neovim r st () nvim_buf_set_var :: Buffer -> String -> Object -> forall r st. Neovim r st (Either NeovimException ()) nvim_buf_get_changedtick' :: Buffer -> forall r st. Neovim r st Int64 nvim_buf_get_changedtick :: Buffer -> forall r st. Neovim r st (Either NeovimException Int64) nvim_buf_get_var' :: Buffer -> String -> forall r st. Neovim r st Object nvim_buf_get_var :: Buffer -> String -> forall r st. Neovim r st (Either NeovimException Object) nvim_buf_set_lines' :: Buffer -> Int64 -> Int64 -> Bool -> [String] -> forall r st. Neovim r st () nvim_buf_set_lines :: Buffer -> Int64 -> Int64 -> Bool -> [String] -> forall r st. Neovim r st (Either NeovimException ()) buffer_set_line_slice' :: Buffer -> Int64 -> Int64 -> Bool -> Bool -> [String] -> forall r st. Neovim r st () buffer_set_line_slice :: Buffer -> Int64 -> Int64 -> Bool -> Bool -> [String] -> forall r st. Neovim r st (Either NeovimException ()) nvim_buf_get_lines' :: Buffer -> Int64 -> Int64 -> Bool -> forall r st. Neovim r st [String] nvim_buf_get_lines :: Buffer -> Int64 -> Int64 -> Bool -> forall r st. Neovim r st (Either NeovimException [String]) buffer_get_line_slice' :: Buffer -> Int64 -> Int64 -> Bool -> Bool -> forall r st. Neovim r st [String] buffer_get_line_slice :: Buffer -> Int64 -> Int64 -> Bool -> Bool -> forall r st. Neovim r st (Either NeovimException [String]) buffer_del_line' :: Buffer -> Int64 -> forall r st. Neovim r st () buffer_del_line :: Buffer -> Int64 -> forall r st. Neovim r st (Either NeovimException ()) buffer_set_line' :: Buffer -> Int64 -> String -> forall r st. Neovim r st () buffer_set_line :: Buffer -> Int64 -> String -> forall r st. Neovim r st (Either NeovimException ()) buffer_get_line' :: Buffer -> Int64 -> forall r st. Neovim r st String buffer_get_line :: Buffer -> Int64 -> forall r st. Neovim r st (Either NeovimException String) nvim_buf_line_count' :: Buffer -> forall r st. Neovim r st Int64 nvim_buf_line_count :: Buffer -> forall r st. Neovim r st (Either NeovimException Int64) instance GHC.Generics.Generic Neovim.API.String.Window instance GHC.Show.Show Neovim.API.String.Window instance GHC.Classes.Eq Neovim.API.String.Window instance GHC.Generics.Generic Neovim.API.String.Tabpage instance GHC.Show.Show Neovim.API.String.Tabpage instance GHC.Classes.Eq Neovim.API.String.Tabpage instance GHC.Generics.Generic Neovim.API.String.Buffer instance GHC.Show.Show Neovim.API.String.Buffer instance GHC.Classes.Eq Neovim.API.String.Buffer instance GHC.Generics.Generic Neovim.API.String.NeovimExceptionGen instance GHC.Show.Show Neovim.API.String.NeovimExceptionGen instance GHC.Classes.Eq Neovim.API.String.NeovimExceptionGen instance Control.DeepSeq.NFData Neovim.API.String.NeovimExceptionGen instance GHC.Exception.Exception Neovim.API.String.NeovimExceptionGen instance Neovim.Classes.NvimObject Neovim.API.String.NeovimExceptionGen instance Control.DeepSeq.NFData Neovim.API.String.Buffer instance Control.DeepSeq.NFData Neovim.API.String.Tabpage instance Control.DeepSeq.NFData Neovim.API.String.Window instance Neovim.Classes.NvimObject Neovim.API.String.Buffer instance Neovim.Classes.NvimObject Neovim.API.String.Tabpage instance Neovim.Classes.NvimObject Neovim.API.String.Window module Neovim.Plugin startPluginThreads :: Config StartupConfig () -> [Neovim StartupConfig () NeovimPlugin] -> IO (Either Doc ([FunctionMapEntry], [ThreadId])) type StartupConfig = StartupConfig NeovimConfig -- | Wrap a Plugin in some nice blankets, so that we can put them in -- a simple list. wrapPlugin :: Applicative m => Plugin r st -> m NeovimPlugin -- | Plugin values are wraped inside this data type via -- wrapPlugin so that we can put plugins in an ordinary list. data NeovimPlugin -- | This data type contains meta information for the plugin manager. data Plugin r st Plugin :: [ExportedFunctionality () ()] -> [StatefulFunctionality r st] -> Plugin r st [exports] :: Plugin r st -> [ExportedFunctionality () ()] [statefulExports] :: Plugin r st -> [StatefulFunctionality r st] -- | This option detemines how neovim should behave when calling some -- functionality on a remote host. data Synchronous -- | Call the functionality entirely for its side effects and do not wait -- for it to finish. Calling a functionality with this flag set is -- completely asynchronous and nothing is really expected to happen. This -- is why a call like this is called notification on the neovim side of -- things. Async :: Synchronous -- | Call the function and wait for its result. This is only synchronous on -- the neovim side. This means that the GUI will (probably) not allow any -- user input until a reult is received. Sync :: Synchronous -- | Options for commands. -- -- Some command can also be described by using the OverloadedString -- extensions. This means that you can write a literal String -- inside your source file in place for a CommandOption value. See -- the documentation for each value on how these strings should look like -- (Both versions are compile time checked.) data CommandOption -- | Stringliteral "sync" or "async" CmdSync :: Synchronous -> CommandOption -- | Register passed to the command. -- -- Stringliteral: "\"" CmdRegister :: CommandOption -- | Command takes a specific amount of arguments -- -- Automatically set via template haskell functions. You really shouldn't -- use this option yourself unless you have to. CmdNargs :: String -> CommandOption -- | Determines how neovim passes the range. -- -- Stringliterals: "%" for WholeFile, "," for line and ",123" for -- 123 lines. CmdRange :: RangeSpecification -> CommandOption -- | Command handles a count. The argument defines the default count. -- -- Stringliteral: string of numbers (e.g. "132") CmdCount :: Word -> CommandOption -- | Command handles a bang -- -- Stringliteral: "!" CmdBang :: CommandOption -- | Register an autocmd in the current context. This means that, if you -- are currently in a stateful plugin, the function will be called in the -- current thread and has access to the configuration and state of this -- thread. If you need that information, but do not want to block the -- other functions in this thread, you have to manually fork a thread and -- make the state you need available there. If you don't care abou the -- state (or your function has been appield to all the necessary state -- (e.g. a TVar to share the rusult), then you can also call -- addAutocmd' which will register a stateless function that only -- interacts with other threads by means of concurrency abstractions. -- -- Note that the function you pass must be fully applied. -- -- Note beside: This function is equivalent to addAutocmd' if -- called from a stateless plugin thread. addAutocmd :: ByteString -> AutocmdOptions -> (Neovim r st ()) -> Neovim r st (Maybe (Either (Neovim anyR anySt ()) ReleaseKey)) -- | Add a stateless autocmd. -- -- See addAutocmd for more details. addAutocmd' :: ByteString -> AutocmdOptions -> Neovim' () -> Neovim r st (Maybe ReleaseKey) -- | Register a functoinality in a stateless context. registerInStatelessContext :: (FunctionMapEntry -> Neovim r st ()) -> FunctionalityDescription -> ([Object] -> Neovim' Object) -> Neovim r st (Maybe FunctionMapEntry) registerInStatefulContext :: (FunctionMapEntry -> Neovim r st ()) -> FunctionalityDescription -> ([Object] -> Neovim r st Object) -> TQueue SomeMessage -> TVar (Map FunctionName ([Object] -> Neovim r st Object)) -> Neovim r st (Maybe FunctionMapEntry) module Neovim.RPC.SocketReader -- | This function will establish a connection to the given socket and read -- msgpack-rpc events from it. runSocketReader :: Handle -> Config RPCConfig st -> IO () parseParams :: FunctionalityDescription -> [Object] -> [Object] module Neovim.Main logger :: String data CommandLineOptions Opt :: Maybe String -> Maybe (String, Int) -> Maybe FilePath -> Bool -> Maybe (FilePath, Priority) -> CommandLineOptions [providerName] :: CommandLineOptions -> Maybe String [hostPort] :: CommandLineOptions -> Maybe (String, Int) [unix] :: CommandLineOptions -> Maybe FilePath [env] :: CommandLineOptions -> Bool [logOpts] :: CommandLineOptions -> Maybe (FilePath, Priority) optParser :: Parser CommandLineOptions opts :: ParserInfo CommandLineOptions -- | This is essentially the main function for nvim-hs, at least if -- you want to use Config.Dyre for the configuration. neovim :: NeovimConfig -> IO () -- | A TransitionHandler function receives the ThreadIds of -- all running threads which have been started by the plugin provider as -- well as the Config with the custom field set to -- RPCConfig. These information can be used to properly clean up a -- session and then do something else. The transition handler is first -- called after the plugin provider has started. type TransitionHandler a = [ThreadId] -> Config RPCConfig () -> IO a -- | This main functions can be used to create a custom executable without -- using the Config.Dyre library while still using the -- nvim-hs specific configuration facilities. realMain :: TransitionHandler a -> Maybe (Params NeovimConfig) -> NeovimConfig -> IO () -- | Generic main function. Most arguments are optional or have sane -- defaults. runPluginProvider :: CommandLineOptions -> Maybe NeovimConfig -> TransitionHandler a -> Maybe (Params NeovimConfig) -> IO a -- | If the plugin provider is started with dyre, this handler is used to -- handle a restart. finishDyre :: TransitionHandler () instance Data.Default.Class.Default Neovim.Main.CommandLineOptions module Neovim.Quickfix -- | This is a wrapper around neovim's setqflist(). -- strType can be any string that you can append to (hence -- Monoid) that is also an instance of NvimObject. You can -- e.g. use the plain old String. setqflist :: (Monoid strType, NvimObject strType) => [QuickfixListItem strType] -> QuickfixAction -> Neovim r st () -- | Quickfix list item. The parameter names should mostly conform to those -- in :h setqflist(). Some fields are merged to explicitly state -- mutually exclusive elements or some other behavior of the fields. -- -- see quickfixListItem for creating a value of this type without -- typing too much. data QuickfixListItem strType QFItem :: Either Int strType -> Either Int strType -> Maybe (Int, Bool) -> Maybe Int -> strType -> QuickfixErrorType -> QuickfixListItem strType -- | Since the filename is only used if no buffer can be specified, this -- field is a merge of bufnr and filename. [bufOrFile] :: QuickfixListItem strType -> Either Int strType -- | Line number or search pattern to locate the error. [lnumOrPattern] :: QuickfixListItem strType -> Either Int strType -- | A tuple of a column number and a boolean indicating which kind of -- indexing should be used. True means that the visual column -- should be used. False means to use the byte index. [col] :: QuickfixListItem strType -> Maybe (Int, Bool) -- | Error number. [nr] :: QuickfixListItem strType -> Maybe Int -- | Description of the error. [text] :: QuickfixListItem strType -> strType -- | Type of error. [errorType] :: QuickfixListItem strType -> QuickfixErrorType -- | Simple error type enum. data QuickfixErrorType Warning :: QuickfixErrorType Error :: QuickfixErrorType -- | Create a QuickfixListItem by providing the minimal amount of -- arguments needed. quickfixListItem :: (Monoid strType) => Either Int strType -> Either Int strType -> QuickfixListItem strType data QuickfixAction -- | Add items to the current list (or create a new one if none exists). Append :: QuickfixAction -- | Replace current list (or create a new one if none exists). Replace :: QuickfixAction -- | Create a new list. New :: QuickfixAction instance GHC.Generics.Generic Neovim.Quickfix.QuickfixAction instance GHC.Show.Show Neovim.Quickfix.QuickfixAction instance GHC.Enum.Bounded Neovim.Quickfix.QuickfixAction instance GHC.Enum.Enum Neovim.Quickfix.QuickfixAction instance GHC.Classes.Ord Neovim.Quickfix.QuickfixAction instance GHC.Classes.Eq Neovim.Quickfix.QuickfixAction instance GHC.Generics.Generic (Neovim.Quickfix.QuickfixListItem strType) instance GHC.Show.Show strType => GHC.Show.Show (Neovim.Quickfix.QuickfixListItem strType) instance GHC.Classes.Eq strType => GHC.Classes.Eq (Neovim.Quickfix.QuickfixListItem strType) instance GHC.Generics.Generic Neovim.Quickfix.QuickfixErrorType instance GHC.Enum.Bounded Neovim.Quickfix.QuickfixErrorType instance GHC.Enum.Enum Neovim.Quickfix.QuickfixErrorType instance GHC.Read.Read Neovim.Quickfix.QuickfixErrorType instance GHC.Show.Show Neovim.Quickfix.QuickfixErrorType instance GHC.Classes.Ord Neovim.Quickfix.QuickfixErrorType instance GHC.Classes.Eq Neovim.Quickfix.QuickfixErrorType instance Control.DeepSeq.NFData strType => Control.DeepSeq.NFData (Neovim.Quickfix.QuickfixListItem strType) instance Control.DeepSeq.NFData Neovim.Quickfix.QuickfixErrorType instance Neovim.Classes.NvimObject Neovim.Quickfix.QuickfixErrorType instance (GHC.Base.Monoid strType, Neovim.Classes.NvimObject strType) => Neovim.Classes.NvimObject (Neovim.Quickfix.QuickfixListItem strType) instance Control.DeepSeq.NFData Neovim.Quickfix.QuickfixAction instance Neovim.Classes.NvimObject Neovim.Quickfix.QuickfixAction module Neovim.Plugin.ConfigHelper.Internal -- | Simple function that will return Pong if the plugin -- provider is running. pingNvimhs :: Neovim' String -- | Recompile the plugin provider and put comile errors in the quickfix -- list. recompileNvimhs :: Neovim (Params NeovimConfig, [(String, Maybe String)]) [QuickfixListItem String] () -- | Note that restarting the plugin provider implies compilation because -- Dyre does this automatically. However, if the recompilation fails, the -- previously compiled binary is executed. This essentially means that -- restarting may take more time then you might expect. -- -- If you provide a bang to the command, the cache directory of -- nvim-hs is forcibly removed. restartNvimhs :: CommandArguments -> Neovim (Params NeovimConfig, [(String, Maybe String)]) [QuickfixListItem String] () parseQuickfixItems :: String -> [QuickfixListItem String] pQuickfixListItem :: Parser (QuickfixListItem String) pSeverity :: Parser QuickfixErrorType pShortDesrciption :: Parser String pLongDescription :: Parser String tabOrSpace :: Parser Char blankLine :: Parser () -- | Skip anything until the next location information appears. -- -- The result will be a triple of filename, line number and column -- -- Try to parse location information. -- --
--   /some/path/to/a/file.hs:42:88:
--   
pLocation :: Parser (String, Int, Int) pInt :: Parser Int module Neovim.Plugin.ConfigHelper plugin :: Neovim (StartupConfig NeovimConfig) () NeovimPlugin -- | This module should contain all the things you need to write neovim -- plugins in your favorite language! :-) -- -- The documentation in this module should provide every information you -- need to start writing plugins. module Neovim -- | 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 Neovim r st a -- | Convenience alias for Neovim () (). type Neovim' = Neovim () () -- | This is essentially the main function for nvim-hs, at least if -- you want to use Config.Dyre for the configuration. neovim :: NeovimConfig -> IO () -- | This data type contains information about the configuration of neovim. -- See the fields' documentation for what you possibly want to change. -- Also, the tutorial in the Neovim module should get you started. data NeovimConfig Config :: [Neovim (StartupConfig NeovimConfig) () NeovimPlugin] -> Maybe (FilePath, Priority) -> Maybe String -> NeovimConfig -- | The list of plugins. The IO type inside the list allows the plugin -- author to run some arbitrary startup code before creating a value of -- type NeovimPlugin. [plugins] :: NeovimConfig -> [Neovim (StartupConfig NeovimConfig) () NeovimPlugin] -- | Set the general logging options. [logOptions] :: NeovimConfig -> Maybe (FilePath, Priority) -- | Internally used field. Changing this has no effect. -- -- Used by Dyre for storing compilation errors. [errorMessage] :: NeovimConfig -> Maybe String -- | Default configuration options for nvim-hs. If you want to keep -- the default plugins enabled, you can define your config like this: -- --
--   main = neovim defaultConfig
--            { plugins = myPlugins ++ plugins defaultConfig
--            }
--   
defaultConfig :: NeovimConfig -- | This data type contains internal fields of nvim-hs that may be -- useful for plugin authors. It is available via ask inside the -- plugin startup code. data StartupConfig cfg StartupConfig :: Maybe (Params cfg) -> [(String, Maybe String)] -> StartupConfig cfg -- | The configuration options for Config.Dyre. This is always set -- if nvim-hs has been started via Config.Dyre. Be sure to -- set up the ghcEnvironmentVariables correctly if you issue a -- recompilation via the Config.Dyre API. [dyreParams] :: StartupConfig cfg -> Maybe (Params cfg) -- | The GHC environment variables with which nvim-hs has been -- started. This are mainly of significance if you want to use the same -- environment for compilation or a REPL that nvim-hs runs on. -- -- These variables have to be used if you want to invoke functionality of -- Config.Dyre targeting nvim-hs. [ghcEnvironmentVariables] :: StartupConfig cfg -> [(String, Maybe String)] -- | The default value for this type. def :: Default a => a -- | Plugin values are wraped inside this data type via -- wrapPlugin so that we can put plugins in an ordinary list. data NeovimPlugin NeovimPlugin :: (Plugin r st) -> NeovimPlugin -- | This datatype contains the initial state (mutable and immutable) for -- the functionalities defined here. data StatefulFunctionality r st StatefulFunctionality :: r -> st -> [ExportedFunctionality r st] -> StatefulFunctionality r st [readOnly] :: StatefulFunctionality r st -> r [writable] :: StatefulFunctionality r st -> st [functionalities] :: StatefulFunctionality r st -> [ExportedFunctionality r st] -- | This data type contains meta information for the plugin manager. data Plugin r st Plugin :: [ExportedFunctionality () ()] -> [StatefulFunctionality r st] -> Plugin r st [exports] :: Plugin r st -> [ExportedFunctionality () ()] [statefulExports] :: Plugin r st -> [StatefulFunctionality r st] -- | Conversion from Object files to Haskell types and back with -- respect to neovim's interpretation. -- -- The NFData constraint has been added to allow forcing results -- of function evaluations in order to catch exceptions from pure code. -- This adds more stability to the plugin provider and seems to be a -- cleaner approach. class NFData o => NvimObject o where fromObjectUnsafe o = case fromObject o of { Left e -> error . show $ text "Not the expected object:" <+> (text . show) o <+> lparen <> e <> rparen Right obj -> obj } fromObject = return . fromObjectUnsafe fromObject' = either (throwIO . ErrorMessage) return . fromObject toObject :: NvimObject o => o -> Object fromObjectUnsafe :: NvimObject o => Object -> o fromObject :: NvimObject o => Object -> Either Doc o fromObject' :: (NvimObject o, MonadBase IO io) => Object -> io o -- | Convenient operator to create a list of Object from normal -- values. (+:) :: (NvimObject o) => o -> [Object] -> [Object] infixr 5 +: -- | A generic vim dictionary is a simply a map from strings to objects. -- This type alias is sometimes useful as a type annotation especially if -- the OverloadedStrings extension is enabled. type Dictionary = Map ByteString Object data Object :: * ObjectNil :: Object -- | Unsigned integers from the MsgPack protocol: uint 8, uint 16, uint 32, -- uint 64 ObjectUInt :: Word64 -> Object -- | Signed integers and fixnums from the MsgPack protocol: positive -- fixnum, negative fixnum, int 8, int 16, int 32, int 64 ObjectInt :: Int64 -> Object ObjectBool :: Bool -> Object ObjectFloat :: Float -> Object ObjectDouble :: Double -> Object ObjectString :: ByteString -> Object ObjectBinary :: ByteString -> Object ObjectArray :: [Object] -> Object ObjectMap :: Map Object Object -> Object ObjectExt :: ~Int8 -> ByteString -> Object -- | Wrap a Plugin in some nice blankets, so that we can put them in -- a simple list. wrapPlugin :: Applicative m => Plugin r st -> m NeovimPlugin -- | Define an exported function by providing a custom name and referencing -- the function you want to export. -- -- Note that the name must start with an upper case letter. -- -- Example: $(function "MyExportedFunction" 'myDefinedFunction) -- Sync function :: String -> Name -> Q Exp -- | Define an exported function. This function works exactly like -- function, but it generates the exported name automatically by -- converting the first letter to upper case. function' :: Name -> Q Exp -- | Similarly to function, this function is used to export a -- command with a custom name. -- -- Note that commands must start with an upper case letter. -- -- Due to limitations on the side of (neo)vim, commands can only have one -- of the following five signatures, where you can replace String -- with ByteString or Text if you wish: -- -- -- -- Example: $(command "RememberThePrime" 'someFunction) -- [CmdBang] -- -- Note that the list of command options (i.e. the last argument) removes -- duplicate options by means of some internally convenient sorting. You -- should simply not define the same option twice. command :: String -> Name -> Q Exp -- | Define an exported command. This function works exactly like -- command, but it generates the command name by converting the -- first letter to upper case. command' :: Name -> Q Exp autocmd :: Name -> Q Exp -- | This option detemines how neovim should behave when calling some -- functionality on a remote host. data Synchronous -- | Call the functionality entirely for its side effects and do not wait -- for it to finish. Calling a functionality with this flag set is -- completely asynchronous and nothing is really expected to happen. This -- is why a call like this is called notification on the neovim side of -- things. Async :: Synchronous -- | Call the function and wait for its result. This is only synchronous on -- the neovim side. This means that the GUI will (probably) not allow any -- user input until a reult is received. Sync :: Synchronous -- | Options for commands. -- -- Some command can also be described by using the OverloadedString -- extensions. This means that you can write a literal String -- inside your source file in place for a CommandOption value. See -- the documentation for each value on how these strings should look like -- (Both versions are compile time checked.) data CommandOption -- | Stringliteral "sync" or "async" CmdSync :: Synchronous -> CommandOption -- | Register passed to the command. -- -- Stringliteral: "\"" CmdRegister :: CommandOption -- | Determines how neovim passes the range. -- -- Stringliterals: "%" for WholeFile, "," for line and ",123" for -- 123 lines. CmdRange :: RangeSpecification -> CommandOption -- | Command handles a count. The argument defines the default count. -- -- Stringliteral: string of numbers (e.g. "132") CmdCount :: Word -> CommandOption -- | Command handles a bang -- -- Stringliteral: "!" CmdBang :: CommandOption -- | Specification of a range that acommand can operate on. data RangeSpecification -- | The line the cursor is at when the command is invoked. CurrentLine :: RangeSpecification -- | Let the command operate on every line of the file. WholeFile :: RangeSpecification -- | Let the command operate on each line in the given range. RangeCount :: Int -> RangeSpecification -- | You can use this type as the first argument for a function which is -- intended to be exported as a command. It holds information about the -- special attributes a command can take. data CommandArguments CommandArguments :: Maybe Bool -> Maybe (Int, Int) -> Maybe Int -> Maybe String -> CommandArguments -- | Nothing means that the function was not defined to handle a -- bang, otherwise it means that the bang was passed (Just -- True) or that it was not passed when called -- (Just False). [bang] :: CommandArguments -> Maybe Bool -- | Range passed from neovim. Only set if CmdRange was used in the -- export declaration of the command. -- -- Example: -- -- [range] :: CommandArguments -> Maybe (Int, Int) -- | Count passed by neovim. Only set if CmdCount was used in the -- export declaration of the command. [count] :: CommandArguments -> Maybe Int -- | Register that the command can/should/must use. [register] :: CommandArguments -> Maybe String -- | Options that can be used to register an autocmd. See :h -- :autocmd or any referenced neovim help-page from the fields of -- this data type. data AutocmdOptions AutocmdOptions :: String -> Bool -> Maybe String -> AutocmdOptions -- | Pattern to match on. (default: "*") [acmdPattern] :: AutocmdOptions -> String -- | Nested autocmd. (default: False) -- -- See :h autocmd-nested [acmdNested] :: AutocmdOptions -> Bool -- | Group in which the autocmd should be registered. [acmdGroup] :: AutocmdOptions -> Maybe String -- | Register an autocmd in the current context. This means that, if you -- are currently in a stateful plugin, the function will be called in the -- current thread and has access to the configuration and state of this -- thread. If you need that information, but do not want to block the -- other functions in this thread, you have to manually fork a thread and -- make the state you need available there. If you don't care abou the -- state (or your function has been appield to all the necessary state -- (e.g. a TVar to share the rusult), then you can also call -- addAutocmd' which will register a stateless function that only -- interacts with other threads by means of concurrency abstractions. -- -- Note that the function you pass must be fully applied. -- -- Note beside: This function is equivalent to addAutocmd' if -- called from a stateless plugin thread. addAutocmd :: ByteString -> AutocmdOptions -> (Neovim r st ()) -> Neovim r st (Maybe (Either (Neovim anyR anySt ()) ReleaseKey)) -- | Add a stateless autocmd. -- -- See addAutocmd for more details. addAutocmd' :: ByteString -> AutocmdOptions -> Neovim' () -> Neovim r st (Maybe ReleaseKey) -- | Retrieves the monad environment. ask :: MonadReader r m => m r -- | Retrieves a function of the current environment. asks :: MonadReader r m => (r -> a) -> m a -- | Replace the state inside the monad. put :: MonadState s m => s -> m () -- | Return the state from the internals of the monad. get :: MonadState s m => m s -- | Gets specific component of the state, using a projection function -- supplied. gets :: MonadState s m => (s -> a) -> m a -- | Monadic state transformer. -- -- Maps an old state to a new state inside a state monad. The old state -- is thrown away. -- --
--   Main> :t modify ((+1) :: Int -> Int)
--   modify (...) :: (MonadState Int a) => a ()
--   
-- -- This says that modify (+1) acts over any Monad that is a -- member of the MonadState class, with an Int state. modify :: MonadState s m => (s -> s) -> m () -- | Wait for the result of the STM action. -- -- This action possibly blocks as it is an alias for ioSTM -> -- ioSTM >>= liftIO . atomically. wait :: Neovim r st (STM result) -> Neovim r st result -- | Variant of wait that discards the result. wait' :: Neovim r st (STM result) -> Neovim r st () -- | Wait for the result of the STM action and call err . -- (loc++) . show if the action returned an error. waitErr :: (Pretty e) => String -> Neovim r st (STM (Either e result)) -> Neovim r st result -- | waitErr that discards the result. waitErr' :: (Pretty e) => String -> Neovim r st (STM (Either e result)) -> Neovim r st () -- | throw specialized to a Pretty value. err :: Pretty err => err -> Neovim r st a -- | The abstract data type Doc represents pretty documents. -- -- Doc is an instance of the Show class. (show -- doc) pretty prints document doc with a page width of 100 -- characters and a ribbon width of 40 characters. -- --
--   show (text "hello" <$> text "world")
--   
-- -- Which would return the string "hello\nworld", i.e. -- --
--   hello
--   world
--   
data Doc :: * -- | The member prettyList is only used to define the instance -- Pretty a => Pretty [a]. In normal circumstances only the -- pretty function is used. class Pretty a pretty :: Pretty a => a -> Doc prettyList :: Pretty a => [a] -> Doc errOnInvalidResult :: (NvimObject o) => Neovim r st (Either NeovimException Object) -> Neovim r st o -- | The document (text s) contains the literal string s. -- The string shouldn't contain any newline ('\n') characters. -- If the string contains newline characters, the function string -- should be used. text :: String -> Doc -- | Exceptions specific to nvim-hs. data NeovimException -- | Simply error message that is passed to neovim. It should currently -- only contain one line of text. ErrorMessage :: Doc -> NeovimException -- | Lift a computation from the IO monad. liftIO :: MonadIO m => forall a. IO a -> m a -- | Execute the given action with a changed set of environment variables -- and restore the original state of the environment afterwards. withCustomEnvironment :: (MonadMask io, MonadIO io) => [(String, Maybe String)] -> io a -> io a -- | when with a monadic predicate. whenM :: (Monad m) => m Bool -> m () -> m () -- | unless with a monadic predicate. unlessM :: (Monad m) => m Bool -> m () -> m () -- | Convert a Doc-ument to a messagepack Object. This is -- more a convenience method to transport error message from and to -- neovim. It generally does not hold that 'docToObject . docFromObject' -- = id. docToObject :: Doc -> Object -- | See docToObject. docFromObject :: Object -> Either Doc Doc -- | Priorities are used to define how important a log message is. Users -- can filter log messages based on priorities. -- -- These have their roots on the traditional syslog system. The standard -- definitions are given below, but you are free to interpret them -- however you like. They are listed here in ascending importance order. data Priority :: * -- | Debug messages DEBUG :: Priority -- | Information INFO :: Priority -- | Normal runtime conditions NOTICE :: Priority -- | General Warnings WARNING :: Priority -- | General Errors ERROR :: Priority -- | Severe situations CRITICAL :: Priority -- | Take immediate action ALERT :: Priority -- | System is unusable EMERGENCY :: Priority module Neovim.Debug -- | 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. debug :: r -> st -> Neovim r st a -> IO (Either Doc (a, st)) -- | Run a Neovim' function. -- --
--   debug' a = fmap fst $ debug () () a
--   
-- -- See documentation for debug. debug' :: Neovim' a -> IO (Either Doc a) -- | 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: -- --
--   λ Right (tids, cfg) <- develMain Nothing
--   
--   λ runNeovim' cfg $ vim_call_function "getqflist" []
--   Right (Right (ObjectArray []))
--   
--   λ :r
--   
--   λ Right (tids, cfg) <- develMain Nothing
--   
develMain :: Maybe NeovimConfig -> IO (Either Doc ([ThreadId], Config RPCConfig ())) -- | Quit a previously started plugin provider. quitDevelMain :: Config r st -> IO () -- | Restart the development plugin provider. restartDevelMain :: Config RPCConfig () -> Maybe NeovimConfig -> IO (Either Doc ([ThreadId], Config RPCConfig ())) -- | Print the global function map to the console. printGlobalFunctionMap :: Config r st -> IO () -- | Initialize a Neovim context by supplying an -- InternalEnvironment. runNeovim :: NFData a => Config r st -> st -> Neovim r st a -> IO (Either Doc (a, st)) -- | Convenience function to run a stateless Neovim function. runNeovim' :: NFData a => Config r st -> Neovim' a -> IO (Either Doc a) module Neovim.Test -- | Run the given Neovim action according to the given parameters. -- The embedded neovim instance is started without a config (i.e. it is -- passed -u NONE). -- -- If you want to run your tests purely from haskell, you have to setup -- the desired state of neovim with the help of the functions in -- Neovim.API.String. testWithEmbeddedNeovim :: Maybe FilePath -> Seconds -> r -> st -> Neovim r st a -> IO () -- | Type synonym for Word. newtype Seconds Seconds :: Word -> Seconds