Skip to content

Commit

Permalink
Allow to get internall ext type value
Browse files Browse the repository at this point in the history
  • Loading branch information
daa84 committed May 28, 2017
1 parent d8addb7 commit 3035707
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "neovim-lib"
version = "0.4.1"
version = "0.4.2"
authors = ["daa84 <[email protected]>"]
license = "LGPL-3.0"
description = "msgpack-rpc neovim client"
Expand Down
7 changes: 6 additions & 1 deletion bindings/neovim_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -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> {
Expand Down
23 changes: 19 additions & 4 deletions src/neovim_api.rs
Original file line number Diff line number Diff line change
@@ -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,
}
Expand All @@ -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<u64, CallError> {
neovim
Expand Down Expand Up @@ -191,7 +196,7 @@ impl Buffer {
}
}

#[derive(PartialEq, Clone)]
#[derive(PartialEq, Clone, Debug)]
pub struct Window {
code_data: Value,
}
Expand All @@ -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<Buffer, CallError> {
neovim
Expand Down Expand Up @@ -343,7 +353,7 @@ impl Window {
}
}

#[derive(PartialEq, Clone)]
#[derive(PartialEq, Clone, Debug)]
pub struct Tabpage {
code_data: Value,
}
Expand All @@ -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<Vec<Window>, CallError> {
neovim
Expand Down

0 comments on commit 3035707

Please sign in to comment.