Closed hoschi closed 10 months ago
Unfortunately, this repo isn't very well maintained at the moment. If you'd like to help out and add support for the latest Nvim features, I'd gladly give you write access.
Sadly I haven't time either :(
@mhartington Are you familiar with how new APIs like this are generated with this library? I'd like to update this but can't seem to find how that's done.
APIs from the library have a mapping back to the original nvim API.
so things like nvim_buf_set_extmark(0, g:mark_ns, 0, 0, 2, {})
Would probably be implemented like setLines
https://github.com/neovim/node-client/blob/master/packages/neovim/src/api/Buffer.ts#L103-L125
setExtMark(nameSpace, line, col, opts = {}) {
return this.request(`${this.prefix}set_extmark`, [
this,
nameSpace,
line,
col,
opts,
]);
}
The main take away is that each method in the classes must map back to an API from neovim.
Right, but are those written by hand and not generated (via reading the output from $ nvim --api-info
)?
Correct, they are written by hand. I'm not sure there was ever a way to generate the API programmatically.
Okay, thank you! I think I might write something to generate them then . . .
I think there is (or was) a script to generate the TS interfaces.
I haven't had much time to work on this, but I wanted to have some automation to compare against the neovim API and create GH issues for missing methods.
See https://github.com/neovim/node-client/pull/199#issuecomment-1628814410
Nvim APIs from node-client should be auto-generated. Anything else is not sustainable.
Meanwhile, clients can use neovim.request('nvim_buf_get_extmarks', [...])
and any other :help api
function using neovim.request()
.
Do I miss something or is the support for extended marks missing? From the Neovim docs I would expect that
Buffer
gets new methods/properties, e.g.setExtmark()
.