KillTheMule/nvim-rs

Roadmap

KillTheMule opened this issue · 2 comments

  • Figure out how plugins can quit

  • Rewrite the API to be type save, and hide rmpv::Value from the user

    • Can probably be done for outgoing requests by recursively creating values
      • Fixed args are easy, but something like nvim_call_function probably needs going through a trait
    • Incoming Responses can be done like fixed args
    • Incoming Notifications/Requests might be impossible.
      • Check out rmp-serde or so, so maybe the user has to just declare a struct
    • #8
  • Consider making a difference between requests and notifications, and send out notifications with the proper message type, and don't wait for a response

    • Does neovim actually recognize this? Read the docs! Maybe everything's a requests anyways, then don't bother
    • #7
  • Figure out what to do if the handler needs some cleanup logic

  • Consider error handling

    • Maybe get away from Box<dyn Error> in favor of a small enum?
    • #6
  • Can we merge Requester into Neovim? Could avoid doubling the API

  • Need more tests

  • We need Tokio right now. What can we do to stay "as generic as possible", so we can move to other executors when the possibility arrives?

    • Use stuff from futures as far as possible.
    • See what we really need to expose from crate::runtime
  • Consider public API.

    • Right now, everything's just the way it would compile
  • Check rust's API guidelines

  • Document stuff

    • Document the library
      • I consider this done initially, from now on everything new should be directly documented, and we should be fine.
    • More examples
  • Consider logging

    • Maybe tokio's tracing is an idea?

First, thank you for your effort of creating this project. I've also been discovering neovim rpc in Rust and neovim-lib was not satisfying enough.

For

Rewrite the API to be type save, and hide rmpv::Value from the user

You can rely on rmpv::Value with serde feature and deserialize Value (or ValueRef) into user-defined struct. Your lib could also pre-define popular structs as well. Here is an example of me using in my project:
https://github.com/unrealhoang/lspc/blob/master/src/neovim.rs#L301-L312

Ahh very cool, I was hoping for something like this. Seems like it's an achievable goal to hide Value from the user :) Thanks!