We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f90cde4 commit 925582dCopy full SHA for 925582d
src/server/scriptInfo.ts
@@ -622,7 +622,10 @@ namespace ts.server {
622
}
623
624
positionToLineOffset(position: number): protocol.Location {
625
- return this.textStorage.positionToLineOffset(position);
+ const location = this.textStorage.positionToLineOffset(position);
626
+ Debug.assert(typeof location.line === "number" && location.line > 0, `Expected line ${location.line} to be greater than 0.`);
627
+ Debug.assert(typeof location.offset === "number" && location.offset > 0, `Expected offset ${location.offset} to be greater than 0.`);
628
+ return location;
629
630
631
public isJavaScript() {
0 commit comments