autodoc: Fix rendering of enum types (#17058)

This commit is contained in:
Krzysztof Wolicki 2023-09-03 18:34:29 +02:00 committed by GitHub
parent e5c72a32a7
commit 5cc1831ca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2187,11 +2187,15 @@ Happy writing!
yield Tok.enter;
}
}
for (let j = 0; j < indent; j += 1) yield Tok.tab;
yield { src: "_", tag: Tag.identifier };
if (fields_len > 1) {
yield Tok.comma;
yield Tok.enter;
if (enumObj.nonexhaustive) {
for (let j = 0; j < indent; j += 1) yield Tok.tab;
yield { src: "_", tag: Tag.identifier };
if (fields_len > 1) {
yield Tok.comma;
yield Tok.enter;
}
}
if (opts.indent) {
for (let j = 0; j < opts.indent; j += 1) yield Tok.tab;