Skip to content

Commit 05b1725

Browse files
committed
Fixed missing whitespace in jsDoc comments. Fixes #12236
1 parent 65bb78d commit 05b1725

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/compiler/parser.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6358,7 +6358,9 @@ namespace ts {
63586358
case SyntaxKind.WhitespaceTrivia:
63596359
// only collect whitespace if we're already saving comments or have just crossed the comment indent margin
63606360
const whitespace = scanner.getTokenText();
6361-
if (state === JSDocState.SavingComments || margin !== undefined && indent + whitespace.length > margin) {
6361+
if (state === JSDocState.SavingComments) {
6362+
comments.push(whitespace);
6363+
} else if (margin !== undefined && indent + whitespace.length > margin) {
63626364
comments.push(whitespace.slice(margin - indent - 1));
63636365
}
63646366
indent += whitespace.length;

0 commit comments

Comments
 (0)