Skip to content

Commit dcd2ddd

Browse files
committed
Yes space after multiline comments
1 parent ff0961b commit dcd2ddd

15 files changed

+25
-22
lines changed

src/compiler/comments.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ namespace ts {
274274
if (hasTrailingNewLine) {
275275
writer.writeLine();
276276
}
277+
else if (_kind === SyntaxKind.MultiLineCommentTrivia) {
278+
writer.write(" ");
279+
}
277280
}
278281

279282
function emitLeadingCommentsOfPosition(pos: number) {

tests/baselines/reference/baseIndexSignatureResolution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ interface B<TBase extends Base> extends A {
5959
}
6060
var b: B<Derived> = null;
6161
var z: Derived = b.foo();
62-
*/
62+
*/

tests/baselines/reference/commentEmitWithCommentOnLastLine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ var bar;
88
var x;
99
/*
1010
var bar;
11-
*/
11+
*/

tests/baselines/reference/commentOnArrayElement1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var array = [
1111
var array = [
1212
/* element 1*/
1313
1
14-
/* end of element 1 */,
14+
/* end of element 1 */ ,
1515
2
1616
/* end of element 2 */
1717
];

tests/baselines/reference/commentOnArrayElement3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ var array = [
1212
var array = [
1313
/* element 1*/
1414
1
15-
/* end of element 1 */,
15+
/* end of element 1 */ ,
1616
2
17-
/* end of element 2 */,
17+
/* end of element 2 */ ,
1818
,
1919
];

tests/baselines/reference/commentOnBlock1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ function f() {
77
//// [commentOnBlock1.js]
88
// asdf
99
function f() {
10-
/*asdf*/{ }
10+
/*asdf*/ { }
1111
}

tests/baselines/reference/commentsArgumentsOfCallExpression1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ function () { });
2929
foo(/*c7*/ function () { });
3030
foo(
3131
/*c7*/
32-
/*c8*/function () { });
32+
/*c8*/ function () { });

tests/baselines/reference/commentsArgumentsOfCallExpression2.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b);
1717
foo(/*c3*/ function () { }, /*d2*/ function () { }, /*e2*/ a + /*e3*/ b);
1818
foo(/*c3*/ function () { }, /*d3*/ function () { }, /*e3*/ (a + b));
1919
foo(
20-
/*c4*/function () { },
21-
/*d4*/function () { },
20+
/*c4*/ function () { },
21+
/*d4*/ function () { },
2222
/*e4*/
23-
/*e5*/"hello");
23+
/*e5*/ "hello");

tests/baselines/reference/commentsCommentParsing.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jsDocMultiLine();
178178
*New line1
179179
*New Line2*/
180180
/** Shoul mege this line as well
181-
* and this too*//** Another this one too*/
181+
* and this too*/ /** Another this one too*/
182182
function jsDocMultiLineMerge() {
183183
}
184184
jsDocMultiLineMerge();
@@ -188,23 +188,23 @@ function jsDocMixedComments1() {
188188
}
189189
jsDocMixedComments1();
190190
/// Triple slash comment
191-
/** jsdoc comment *//*** another jsDocComment*/
191+
/** jsdoc comment */ /*** another jsDocComment*/
192192
function jsDocMixedComments2() {
193193
}
194194
jsDocMixedComments2();
195-
/** jsdoc comment *//*** another jsDocComment*/
195+
/** jsdoc comment */ /*** another jsDocComment*/
196196
/// Triple slash comment
197197
function jsDocMixedComments3() {
198198
}
199199
jsDocMixedComments3();
200-
/** jsdoc comment *//*** another jsDocComment*/
200+
/** jsdoc comment */ /*** another jsDocComment*/
201201
/// Triple slash comment
202202
/// Triple slash comment 2
203203
function jsDocMixedComments4() {
204204
}
205205
jsDocMixedComments4();
206206
/// Triple slash comment 1
207-
/** jsdoc comment *//*** another jsDocComment*/
207+
/** jsdoc comment */ /*** another jsDocComment*/
208208
/// Triple slash comment
209209
/// Triple slash comment 2
210210
function jsDocMixedComments5() {

tests/baselines/reference/commentsFunction.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ function blah3(a // trailing commen single line
8686
) {
8787
}
8888
lambdaFoo = function (a, b) { return a * b; }; // This is trailing comment
89-
/*leading comment*/(function () { return 0; }); // Needs to be wrapped in parens to be a valid expression (not declaration)
90-
/*leading comment*/(function () { return 0; }); //trailing comment
89+
/*leading comment*/ (function () { return 0; }); // Needs to be wrapped in parens to be a valid expression (not declaration)
90+
/*leading comment*/ (function () { return 0; }); //trailing comment
9191
function blah4(/*1*/ a /*2*/, /*3*/ b /*4*/) {
9292
}
9393
function foo1() {

tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var resolve = {
1818
id: /*! @ngInject */ function (details) { return details.id; },
1919
id1: /* c1 */ "hello",
2020
id2:
21-
/*! @ngInject */function (details) { return details.id; },
21+
/*! @ngInject */ function (details) { return details.id; },
2222
id3:
2323
/*! @ngInject */
2424
function (details) { return details.id; },

tests/baselines/reference/concatError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ var c: C<number>;
5656
var cc: C<C<number>>;
5757
5858
c = c.m(cc);
59-
*/
59+
*/

tests/baselines/reference/parserSkippedTokens10.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66

77
//// [parserSkippedTokens10.js]
8-
/*existing trivia*/;
8+
/*existing trivia*/ ;

tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ declare module MsPortal.Controls.Base.ItemList {
7878
class ViewModel<TValue> extends ItemValue<TValue> {
7979
}
8080
}
81-
*/
81+
*/

tests/baselines/reference/scannerS7.4_A2_T2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
*/
2727
/*CHECK#1/
2828

29-
29+

0 commit comments

Comments
 (0)