From 8bd0a47c825d659587b1f1e43fe3dcd8541b96a7 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 10 Nov 2016 13:11:32 -0800 Subject: [PATCH] Retain space after first word in multiline jsdoc For words that were shorter than the jsdoc indent level, the space was omitted previously. --- src/compiler/parser.ts | 1 + tests/cases/fourslash/jsDocFunctionSignatures8.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 92a3dcbef11..dce53510c87 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -6238,6 +6238,7 @@ namespace ts { } if (token() === SyntaxKind.NewLineTrivia) { state = JSDocState.BeginningOfLine; + indent = 0; nextJSDocToken(); } while (token() !== SyntaxKind.EndOfFileToken) { diff --git a/tests/cases/fourslash/jsDocFunctionSignatures8.ts b/tests/cases/fourslash/jsDocFunctionSignatures8.ts index 3dbe38e34df..6853c70daf2 100644 --- a/tests/cases/fourslash/jsDocFunctionSignatures8.ts +++ b/tests/cases/fourslash/jsDocFunctionSignatures8.ts @@ -3,6 +3,7 @@ // @Filename: Foo.js /////** //// * Represents a person +//// * a b multiline test //// * @constructor //// * @param {string} name The name of the person //// * @param {number} age The age of the person @@ -13,4 +14,4 @@ ////} ////var p = new Pers/**/on(); goTo.marker(); -verify.quickInfoIs("function Person(name: string, age: number): void", "Represents a person"); +verify.quickInfoIs("function Person(name: string, age: number): void", "Represents a person\na b multiline test");