This commit is contained in:
Jean Pierre
2018-03-22 16:19:53 -05:00
committed by Ramya Rao
parent 15ee956bf9
commit af21dc7925

View File

@@ -17,6 +17,7 @@ export class DocumentStreamReader {
private document: TextDocument;
private start: Position;
private _eof: Position;
private _sof: Position;
public pos: Position;
private _eol: string;
@@ -24,10 +25,18 @@ export class DocumentStreamReader {
this.document = document;
this.start = this.pos = pos ? pos : new Position(0, 0);
this._sof = limit ? limit.start : new Position(0, 0);
this._eof = limit ? limit.end : new Position(this.document.lineCount - 1, this._lineLength(this.document.lineCount - 1));
this._eol = this.document.eol === EndOfLine.LF ? '\n' : '\r\n';
}
/**
* Returns true only if the stream is at the start of the file.
*/
sof(): boolean {
return this.pos.isBeforeOrEqual(this._sof);
}
/**
* Returns true only if the stream is at the end of the file.
*/