(pos, indentation, lineAdded)
| 147743 | return lineAction; |
| 147744 | } |
| 147745 | function insertIndentation(pos, indentation, lineAdded) { |
| 147746 | var indentationString = getIndentationString(indentation, options); |
| 147747 | if (lineAdded) { |
| 147748 | // new line is added before the token by the formatting rules |
| 147749 | // insert indentation string at the very beginning of the token |
| 147750 | recordReplace(pos, 0, indentationString); |
| 147751 | } |
| 147752 | else { |
| 147753 | var tokenStart = sourceFile.getLineAndCharacterOfPosition(pos); |
| 147754 | var startLinePosition = ts.getStartPositionOfLine(tokenStart.line, sourceFile); |
| 147755 | if (indentation !== characterToColumn(startLinePosition, tokenStart.character) || indentationIsDifferent(indentationString, startLinePosition)) { |
| 147756 | recordReplace(startLinePosition, tokenStart.character, indentationString); |
| 147757 | } |
| 147758 | } |
| 147759 | } |
| 147760 | function characterToColumn(startLinePosition, characterInLine) { |
| 147761 | var column = 0; |
| 147762 | for (var i = 0; i < characterInLine; i++) { |
no test coverage detected