Add assertion to computePositionOfLineAndCharacter (#17121)

This commit is contained in:
Andy
2017-07-13 06:49:28 -07:00
committed by GitHub
parent 1c93531f0f
commit dbbf051886
2 changed files with 11 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ namespace ts.server {
*/
lineOffsetToPosition(line: number, offset: number): number {
if (!this.svc) {
return computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1);
return computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text);
}
// TODO: assert this offset is actually on the line