indent argument lists if they are on different line with parent

This commit is contained in:
Vladimir Matveev 2014-10-30 15:35:28 -07:00
parent e830ae28b7
commit 31e256f23f

View File

@ -281,7 +281,13 @@ module ts.formatting {
var tokenInfo = formattingScanner.readTokenInfo(node);
if (tokenInfo.token.kind === listStartToken) {
// make sure that this token does not belong to the child
doConsumeTokenAndAdvanceScanner(tokenInfo, node, nodeIndentation);
var startTokenIndentation = nodeIndentation;
var tokenStartLine = sourceFile.getLineAndCharacterFromPosition(tokenInfo.token.pos).line;
if (node.parent.kind !== SyntaxKind.SourceFile && tokenStartLine !== nodeStartLine) {
var indentation = nodeIndentation.getIndentation() + options.IndentSize;
startTokenIndentation = getDynamicIndentation(node, indentation, indentation, nodeIndentation);
}
doConsumeTokenAndAdvanceScanner(tokenInfo, node, startTokenIndentation);
}
}
}
@ -301,6 +307,7 @@ module ts.formatting {
}
}
}
}
);