neovim
neovim copied to clipboard
Finalise the specification of how Go plugins will be written
- Define a struct, e.g.
example.Example
, that implementsneovim.Plugin
- Via
go generate
tool, search for//neovim:wrapper Example Method1
directives to see which methods should have wrappers generated - Sync methods will be defined as:
// n args and m ret vals
// requires two error ret vals as last two return values
//neovim:wrapper Example SyncMethod
func (e *Example) SyncMethod(arg1 string, arg2 int, ...) (ret1 string, ret2 int, ..., error, error) {
...
}
- Async methods will be defined as:
// n args
// single error ret val
//neovim:wrapper Example AsyncMethod
func (e *Example) AsyncMethod(arg1 string, arg2 int, ...) error {
...
}
- Use
msgp
to generate MSGPACK wrappers around the wrappers - Define
neovim
methods that can be called during a plugin'sInit
method to register:- Command
- Autocmd
- Function
- Plain RPC methods?
Further notes here: https://github.com/myitcv/neovim/wiki/Plugin-defined-functions,-commands-and-autocommands