app

package
v0.0.0-...-7b31a5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2017 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(registerHandlers func(a *App) error)

Main implements the main function for a Nvim helper application.

Helper applications call the Main function to run the application. The Main function creates a Nvim client, calls the supplied function to register handlers plugin and then runs the server loop to handle requests from Nvim.

Applications should use the default logger in the standard log package to write to Nvim's log.

Types

type App

type App struct {
	Nvim *nvim.Nvim
	// contains filtered or unexported fields
}

App represents a helper application for Neovim plugins.

func New

func New(v *nvim.Nvim) *App

New returns an initialized helper application.

func (*App) Handle

func (a *App) Handle(serviceMethod string, fn interface{})

Handle registers fn as a MessagePack RPC handler for the named method. The function signature for fn is one of

 func([v *nvim.Nvim,] {args}) ({resultType}, error)
 func([v *nvim.Nvim,] {args}) error
	func([v *nvim.Nvim,] {args})

where {args} is zero or more arguments and {resultType} is the type of a return value. Call the handler from Nvim using the rpcnotify and rpcrequest functions:

:help rpcrequest()
:help rpcnotify()

TODO: document eval

type Eval

type Eval struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL