Skip to content

Commit f06dddc

Browse files
Simplify helper function.
1 parent f4da5d7 commit f06dddc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/services/utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ module ts {
3434

3535
export function getLineStartPositionForPosition(position: number, sourceFile: SourceFile): number {
3636
var lineStarts = sourceFile.getLineStarts();
37-
var line = sourceFile.getOneBasedLineAndCharacterOfPosition(position).line;
38-
return lineStarts[line - 1];
37+
var line = sourceFile.getZeroBasedLineAndCharacterOfPosition(position).line;
38+
return lineStarts[line];
3939
}
4040

4141
export function rangeContainsRange(r1: TextRange, r2: TextRange): boolean {

0 commit comments

Comments
 (0)