neovim/node-client

Generate API from `nvim_api_info`

rhysd opened this issue · 3 comments

rhysd commented

This issue was derived from #199.

Since we don't have sufficient velocity to follow the API changes and additions of Neovim, some APIs are missing in this package. And some APIs may be outdated (e.g. lack of some optional parameters).

To keep API of this package following to the latest Neovim, generating methods of Neovim, Buffer, Window, and Tabpage from the output of nvim_api_info would be great. Then we can run the code generation on CI regularly.

Currently I'm seeing some points which we would need to handle between TypeScript API and Neovim API.

  • Some parameter types are not enough to define strict type definition in TypeScript. For example, an array parameter is just typed as Array in API info and its element type is unknown
  • Naming convention of function names and property names are different. TypeScript (and JavaScript) adopts lowerCamel and Neovim API adopts snake_case. I'd like to convert them to provide natural APIs for TypeScript and JavaScript users.