mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Trailing comment tests for parameters, fixes the trailing // comments and parameter indentation
This commit is contained in:
@@ -1204,13 +1204,13 @@ module ts {
|
||||
}
|
||||
|
||||
function emitSignatureParameters(node: FunctionDeclaration) {
|
||||
increaseIndent();
|
||||
write("(");
|
||||
if (node) {
|
||||
increaseIndent();
|
||||
emitCommaList(node.parameters, node.parameters.length - (hasRestParameters(node) ? 1 : 0));
|
||||
decreaseIndent();
|
||||
}
|
||||
write(")");
|
||||
decreaseIndent();
|
||||
}
|
||||
|
||||
function emitSignatureAndBody(node: FunctionDeclaration) {
|
||||
@@ -1386,8 +1386,8 @@ module ts {
|
||||
write("function ");
|
||||
emitSignatureAndBody(accessors.getAccessor);
|
||||
emitEnd(accessors.getAccessor);
|
||||
write(",");
|
||||
emitTrailingComments(accessors.getAccessor);
|
||||
write(",");
|
||||
}
|
||||
if (accessors.setAccessor) {
|
||||
writeLine();
|
||||
@@ -1397,8 +1397,8 @@ module ts {
|
||||
write("function ");
|
||||
emitSignatureAndBody(accessors.setAccessor);
|
||||
emitEnd(accessors.setAccessor);
|
||||
write(",");
|
||||
emitTrailingComments(accessors.setAccessor);
|
||||
write(",");
|
||||
}
|
||||
writeLine();
|
||||
write("enumerable: true,");
|
||||
|
||||
@@ -385,12 +385,14 @@ module ts {
|
||||
continue;
|
||||
case CharacterCodes.slash:
|
||||
var nextChar = text.charCodeAt(pos + 1);
|
||||
var hasTrailingNewLine = false;
|
||||
if (nextChar === CharacterCodes.slash || nextChar === CharacterCodes.asterisk) {
|
||||
var startPos = pos;
|
||||
pos += 2;
|
||||
if (nextChar === CharacterCodes.slash) {
|
||||
while (pos < text.length) {
|
||||
if (isLineBreak(text.charCodeAt(pos))) {
|
||||
hasTrailingNewLine = true;
|
||||
break;
|
||||
}
|
||||
pos++;
|
||||
@@ -407,7 +409,7 @@ module ts {
|
||||
}
|
||||
if (collecting) {
|
||||
if (!result) result = [];
|
||||
result.push({ pos: startPos, end: pos });
|
||||
result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine });
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user