neovim-lib icon indicating copy to clipboard operation
neovim-lib copied to clipboard

scorched earth: a useless neovim plugin in rust

Open boxofrox opened this issue 8 years ago • 2 comments

Here's my first completely useless neovim plugin[1] in Rust! I've been using it to test/dictate the design choices in my patches for neovim-lib. It relies on PR #4 and another yet-to-be PR currently in my fork of neovim-lib.

One thing this project brought to light is argument parsing. I wrote a couple functions to extract usize and String from neovim_lib::rpc::Value[2], and I see src/rpc/model.rs defines a couple macros along the same lines. I think it would be worthwhile for neovim_lib to expose this functionality.

Anyway, wanted to submit this for review as a working example and possible template for other plugins.

Cheers!

[1]: https://github.com/boxofrox/neovim-scorched-earth

[2]: https://github.com/boxofrox/neovim-scorched-earth/blob/master/src/args.rs

boxofrox avatar Mar 29 '17 03:03 boxofrox

Hello! Thanks for your project.

About unwrap Value - i have plan to move back to rmpv library Value, Value in this library have methods for extracting simple values, for example as_u64 rmp::Value, together with From converters. Will it solve this issue?

daa84 avatar Mar 29 '17 08:03 daa84

@daa84 yes, I think that will take care of parsing.

boxofrox avatar Mar 29 '17 12:03 boxofrox