Skip to content

Commit edd1469

Browse files
committed
Include docs in generated JS getters/setters
1 parent 164712c commit edd1469

File tree

1 file changed

+4
-3
lines changed
  • crates/cli-support/src/js

1 file changed

+4
-3
lines changed

crates/cli-support/src/js/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,10 +1933,10 @@ impl<'a> Context<'a> {
19331933
let docs = format_doc_comments(&export.comments, Some(raw_docs));
19341934
match export.kind {
19351935
AuxExportKind::Getter { .. } => {
1936-
exported.push_field(name, &js, Some(&ret_ty), true);
1936+
exported.push_field(&docs, name, &js, Some(&ret_ty), true);
19371937
}
19381938
AuxExportKind::Setter { .. } => {
1939-
exported.push_field(name, &js, None, false);
1939+
exported.push_field(&docs, name, &js, None, false);
19401940
}
19411941
AuxExportKind::StaticFunction { .. } => {
19421942
exported.push(&docs, name, "static ", &js, &ts);
@@ -2187,7 +2187,8 @@ impl ExportedClass {
21872187
/// Note that the `ts` is optional and it's expected to just be the field
21882188
/// type, not the full signature. It's currently only available on getters,
21892189
/// but there currently has to always be at least a getter.
2190-
fn push_field(&mut self, field: &str, js: &str, ts: Option<&str>, getter: bool) {
2190+
fn push_field(&mut self, docs: &str, field: &str, js: &str, ts: Option<&str>, getter: bool) {
2191+
self.contents.push_str(docs);
21912192
if getter {
21922193
self.contents.push_str("get ");
21932194
} else {

0 commit comments

Comments
 (0)