Yes space after multiline comments

This commit is contained in:
Yuval Greenfield 2017-09-26 12:09:58 -07:00
parent ff0961b85e
commit dcd2ddd0b7
15 changed files with 25 additions and 22 deletions

View File

@ -274,6 +274,9 @@ namespace ts {
if (hasTrailingNewLine) {
writer.writeLine();
}
else if (_kind === SyntaxKind.MultiLineCommentTrivia) {
writer.write(" ");
}
}
function emitLeadingCommentsOfPosition(pos: number) {

View File

@ -59,4 +59,4 @@ interface B<TBase extends Base> extends A {
}
var b: B<Derived> = null;
var z: Derived = b.foo();
*/
*/

View File

@ -8,4 +8,4 @@ var bar;
var x;
/*
var bar;
*/
*/

View File

@ -11,7 +11,7 @@ var array = [
var array = [
/* element 1*/
1
/* end of element 1 */,
/* end of element 1 */ ,
2
/* end of element 2 */
];

View File

@ -12,8 +12,8 @@ var array = [
var array = [
/* element 1*/
1
/* end of element 1 */,
/* end of element 1 */ ,
2
/* end of element 2 */,
/* end of element 2 */ ,
,
];

View File

@ -7,5 +7,5 @@ function f() {
//// [commentOnBlock1.js]
// asdf
function f() {
/*asdf*/{ }
/*asdf*/ { }
}

View File

@ -29,4 +29,4 @@ function () { });
foo(/*c7*/ function () { });
foo(
/*c7*/
/*c8*/function () { });
/*c8*/ function () { });

View File

@ -17,7 +17,7 @@ foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b);
foo(/*c3*/ function () { }, /*d2*/ function () { }, /*e2*/ a + /*e3*/ b);
foo(/*c3*/ function () { }, /*d3*/ function () { }, /*e3*/ (a + b));
foo(
/*c4*/function () { },
/*d4*/function () { },
/*c4*/ function () { },
/*d4*/ function () { },
/*e4*/
/*e5*/"hello");
/*e5*/ "hello");

View File

@ -178,7 +178,7 @@ jsDocMultiLine();
*New line1
*New Line2*/
/** Shoul mege this line as well
* and this too*//** Another this one too*/
* and this too*/ /** Another this one too*/
function jsDocMultiLineMerge() {
}
jsDocMultiLineMerge();
@ -188,23 +188,23 @@ function jsDocMixedComments1() {
}
jsDocMixedComments1();
/// Triple slash comment
/** jsdoc comment *//*** another jsDocComment*/
/** jsdoc comment */ /*** another jsDocComment*/
function jsDocMixedComments2() {
}
jsDocMixedComments2();
/** jsdoc comment *//*** another jsDocComment*/
/** jsdoc comment */ /*** another jsDocComment*/
/// Triple slash comment
function jsDocMixedComments3() {
}
jsDocMixedComments3();
/** jsdoc comment *//*** another jsDocComment*/
/** jsdoc comment */ /*** another jsDocComment*/
/// Triple slash comment
/// Triple slash comment 2
function jsDocMixedComments4() {
}
jsDocMixedComments4();
/// Triple slash comment 1
/** jsdoc comment *//*** another jsDocComment*/
/** jsdoc comment */ /*** another jsDocComment*/
/// Triple slash comment
/// Triple slash comment 2
function jsDocMixedComments5() {

View File

@ -86,8 +86,8 @@ function blah3(a // trailing commen single line
) {
}
lambdaFoo = function (a, b) { return a * b; }; // This is trailing comment
/*leading comment*/(function () { return 0; }); // Needs to be wrapped in parens to be a valid expression (not declaration)
/*leading comment*/(function () { return 0; }); //trailing comment
/*leading comment*/ (function () { return 0; }); // Needs to be wrapped in parens to be a valid expression (not declaration)
/*leading comment*/ (function () { return 0; }); //trailing comment
function blah4(/*1*/ a /*2*/, /*3*/ b /*4*/) {
}
function foo1() {

View File

@ -18,7 +18,7 @@ var resolve = {
id: /*! @ngInject */ function (details) { return details.id; },
id1: /* c1 */ "hello",
id2:
/*! @ngInject */function (details) { return details.id; },
/*! @ngInject */ function (details) { return details.id; },
id3:
/*! @ngInject */
function (details) { return details.id; },

View File

@ -56,4 +56,4 @@ var c: C<number>;
var cc: C<C<number>>;
c = c.m(cc);
*/
*/

View File

@ -5,4 +5,4 @@
//// [parserSkippedTokens10.js]
/*existing trivia*/;
/*existing trivia*/ ;

View File

@ -78,4 +78,4 @@ declare module MsPortal.Controls.Base.ItemList {
class ViewModel<TValue> extends ItemValue<TValue> {
}
}
*/
*/

View File

@ -26,4 +26,4 @@
*/
/*CHECK#1/