Roadmap
-
[x] Figure out how plugins can quit
- https://github.com/KillTheMule/nvim-rs/issues/2
-
[ ] Rewrite the API to be type save, and hide
rmpv::Valuefrom the user- Can probably be done for outgoing requests by recursively creating values
- Fixed args are easy, but something like
nvim_call_functionprobably needs going through a trait
- Fixed args are easy, but something like
- Incoming Responses can be done like fixed args
- Incoming Notifications/Requests might be impossible.
- Check out
rmp-serdeor so, so maybe the user has to just declare a struct
- Check out
- https://github.com/KillTheMule/nvim-rs/issues/8
- Can probably be done for outgoing requests by recursively creating values
-
[x] 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
- It does, see https://neovim.io/doc/user/api.html#api-global-events. Maybe not so usefull since there seems little to do where you don't want direct error feedback
- https://github.com/KillTheMule/nvim-rs/issues/7
- Does neovim actually recognize this? Read the docs! Maybe everything's a requests anyways, then don't bother
-
[x] Figure out what to do if the handler needs some cleanup logic
- https://github.com/KillTheMule/nvim-rs/issues/3
-
[x] Consider error handling
- Maybe get away from
Box<dyn Error>in favor of a small enum? - https://github.com/KillTheMule/nvim-rs/issues/6
- Maybe get away from
-
[x] Can we merge
RequesterintoNeovim? Could avoid doubling the API -
[ ] Need more tests
- [ ] Test all connection types on all OSes
- [ ] Test exttypes
- [ ] Check https://docs.rs/loom/0.2.14/loom/
-
[ ] 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
futuresas far as possible. - See what we really need to expose from
crate::runtime
- Use stuff from
-
[ ] Consider public API.
- Right now, everything's just the way it would compile
-
[ ] Check rust's API guidelines
- https://github.com/KillTheMule/nvim-rs/issues/9
-
[ ] Document stuff
- [x] Document the library
- I consider this done initially, from now on everything new should be directly documented, and we should be fine.
- [ ] More examples
- [x] Document the library
-
[ ] 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!