mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-24 13:42:14 +00:00
give class members 2 spaces indentation in .d.ts files
This commit is contained in:
parent
f8dabfcae9
commit
019a0863c4
@ -845,7 +845,7 @@ impl<'a> Context<'a> {
|
|||||||
",
|
",
|
||||||
name,
|
name,
|
||||||
));
|
));
|
||||||
ts_dst.push_str("free(): void;\n");
|
ts_dst.push_str(" free(): void;\n");
|
||||||
dst.push_str(&class.contents);
|
dst.push_str(&class.contents);
|
||||||
ts_dst.push_str(&class.typescript);
|
ts_dst.push_str(&class.typescript);
|
||||||
dst.push_str("}\n");
|
dst.push_str("}\n");
|
||||||
@ -2399,6 +2399,8 @@ impl<'a, 'b> SubContext<'a, 'b> {
|
|||||||
.contents
|
.contents
|
||||||
.push_str(&format_doc_comments(&export.comments, Some(js_doc)));
|
.push_str(&format_doc_comments(&export.comments, Some(js_doc)));
|
||||||
|
|
||||||
|
class.typescript.push_str(" "); // Indentation
|
||||||
|
|
||||||
if export.is_constructor {
|
if export.is_constructor {
|
||||||
if class.has_constructor {
|
if class.has_constructor {
|
||||||
bail!("found duplicate constructor `{}`", export.function.name);
|
bail!("found duplicate constructor `{}`", export.function.name);
|
||||||
@ -2596,7 +2598,7 @@ impl<'a, 'b> SubContext<'a, 'b> {
|
|||||||
.argument(&descriptor)?
|
.argument(&descriptor)?
|
||||||
.ret(&Descriptor::Unit)?;
|
.ret(&Descriptor::Unit)?;
|
||||||
ts_dst.push_str(&format!(
|
ts_dst.push_str(&format!(
|
||||||
"{}{}: {};\n",
|
" {}{}: {};\n",
|
||||||
if field.readonly { "readonly " } else { "" },
|
if field.readonly { "readonly " } else { "" },
|
||||||
field.name,
|
field.name,
|
||||||
&cx.js_arguments[0].1
|
&cx.js_arguments[0].1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user