From 3035707bce019cf97f76673cc4eeede4c3bd02c9 Mon Sep 17 00:00:00 2001 From: daa Date: Sun, 28 May 2017 11:20:56 +0300 Subject: [PATCH] Allow to get internall ext type value --- Cargo.toml | 2 +- bindings/neovim_api.rs | 7 ++++++- src/neovim_api.rs | 23 +++++++++++++++++++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5a91bb6..96e39aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "neovim-lib" -version = "0.4.1" +version = "0.4.2" authors = ["daa84 "] license = "LGPL-3.0" description = "msgpack-rpc neovim client" diff --git a/bindings/neovim_api.rs b/bindings/neovim_api.rs index b97f8f2..62f3109 100644 --- a/bindings/neovim_api.rs +++ b/bindings/neovim_api.rs @@ -4,7 +4,7 @@ use neovim::*; use rpc::*; {% for etype in exttypes %} -#[derive(PartialEq, Clone)] +#[derive(PartialEq, Clone, Debug)] pub struct {{ etype.name }} { code_data: Value, } @@ -16,6 +16,11 @@ impl {{ etype.name }} { } } + /// Internal value, that represent type + pub fn get_value(&self) -> &Value { + &self.code_data + } + {% for f in functions if f.ext and f.name.startswith(etype.prefix) %} /// since: {{f.since}} pub fn {{f.name|replace(etype.prefix, '')}}(&self, neovim: &mut Neovim, {{f.argstring}}) -> Result<{{f.return_type.native_type_ret}}, CallError> { diff --git a/src/neovim_api.rs b/src/neovim_api.rs index 1cdbf26..8ab2afc 100644 --- a/src/neovim_api.rs +++ b/src/neovim_api.rs @@ -1,9 +1,9 @@ -// Auto generated 2017-05-27 23:22:04.468883 +// Auto generated 2017-05-28 11:18:20.638588 use neovim::*; use rpc::*; -#[derive(PartialEq, Clone)] +#[derive(PartialEq, Clone, Debug)] pub struct Buffer { code_data: Value, } @@ -13,6 +13,11 @@ impl Buffer { Buffer { code_data: code_data } } + /// Internal value, that represent type + pub fn get_value(&self) -> &Value { + &self.code_data + } + /// since: 1 pub fn line_count(&self, neovim: &mut Neovim) -> Result { neovim @@ -191,7 +196,7 @@ impl Buffer { } } -#[derive(PartialEq, Clone)] +#[derive(PartialEq, Clone, Debug)] pub struct Window { code_data: Value, } @@ -201,6 +206,11 @@ impl Window { Window { code_data: code_data } } + /// Internal value, that represent type + pub fn get_value(&self) -> &Value { + &self.code_data + } + /// since: 1 pub fn get_buf(&self, neovim: &mut Neovim) -> Result { neovim @@ -343,7 +353,7 @@ impl Window { } } -#[derive(PartialEq, Clone)] +#[derive(PartialEq, Clone, Debug)] pub struct Tabpage { code_data: Value, } @@ -353,6 +363,11 @@ impl Tabpage { Tabpage { code_data: code_data } } + /// Internal value, that represent type + pub fn get_value(&self) -> &Value { + &self.code_data + } + /// since: 1 pub fn list_wins(&self, neovim: &mut Neovim) -> Result, CallError> { neovim