From 05b17255f69b11ca2911762e3a1fb6aa57854dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20Ga=C5=86=C4=A3is?= Date: Mon, 12 Dec 2016 21:40:00 +0200 Subject: [PATCH] Fixed missing whitespace in jsDoc comments. Fixes https://github.com/Microsoft/TypeScript/issues/12236 --- src/compiler/parser.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 4aefa160077..0100f9538bc 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -6358,7 +6358,9 @@ namespace ts { case SyntaxKind.WhitespaceTrivia: // only collect whitespace if we're already saving comments or have just crossed the comment indent margin const whitespace = scanner.getTokenText(); - if (state === JSDocState.SavingComments || margin !== undefined && indent + whitespace.length > margin) { + if (state === JSDocState.SavingComments) { + comments.push(whitespace); + } else if (margin !== undefined && indent + whitespace.length > margin) { comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length;