@internal
(sourceFile, pos1, pos2)
| 10370 | ts.computeLineOfPosition = computeLineOfPosition; |
| 10371 | /** @internal */ |
| 10372 | function getLinesBetweenPositions(sourceFile, pos1, pos2) { |
| 10373 | if (pos1 === pos2) |
| 10374 | return 0; |
| 10375 | var lineStarts = getLineStarts(sourceFile); |
| 10376 | var lower = Math.min(pos1, pos2); |
| 10377 | var isNegative = lower === pos2; |
| 10378 | var upper = isNegative ? pos1 : pos2; |
| 10379 | var lowerLine = computeLineOfPosition(lineStarts, lower); |
| 10380 | var upperLine = computeLineOfPosition(lineStarts, upper, lowerLine); |
| 10381 | return isNegative ? lowerLine - upperLine : upperLine - lowerLine; |
| 10382 | } |
| 10383 | ts.getLinesBetweenPositions = getLinesBetweenPositions; |
| 10384 | function getLineAndCharacterOfPosition(sourceFile, position) { |
| 10385 | return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); |
nothing calls this directly
no test coverage detected
searching dependent graphs…