mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 20:41:24 +00:00
Copy doc comments from Rust to JS (#265)
* backend comments complete * better matching * gen comments * Add example * Move test bindings gen to own fn * move build step into build fn * add fn to read js, refactor gen_bindings/test to allow for this * Add comments test * Update readmes * add comments to travis * fix broken tests * +x on build.sh * fix wbg cmd in build.sh * Address fitzgen's comments
This commit is contained in:
committed by
Nick Fitzgerald
parent
3ad9bac599
commit
19d6cf1488
@ -64,12 +64,14 @@ pub struct Export {
|
||||
pub method: bool,
|
||||
pub constructor: Option<String>,
|
||||
pub function: Function,
|
||||
pub comments: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct Enum {
|
||||
pub name: String,
|
||||
pub variants: Vec<EnumVariant>,
|
||||
pub comments: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
@ -87,12 +89,14 @@ pub struct Function {
|
||||
pub struct Struct {
|
||||
pub name: String,
|
||||
pub fields: Vec<StructField>,
|
||||
pub comments: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct StructField {
|
||||
pub name: String,
|
||||
pub readonly: bool,
|
||||
pub comments: Vec<String>,
|
||||
}
|
||||
|
||||
pub fn new_function(struct_name: &str) -> String {
|
||||
|
Reference in New Issue
Block a user