src/vs/workbench/api/common/extHostNotebookConcatDocument.ts/ExtHostNotebookConcatDocument/getText
class ExtHostNotebookConcatDocument:	getText(range?: vscode.Range): string {
		if (!range) {
			let result = '';
			for (const cell of this._cells) {
				result += cell.document.getText() + '\n';
			}
			// remove last newline again
			result = result.slice(0, -1);
			return result;
		}

		if (range.isEmpty) {
			return '';
		}

		// get start and end locations and create substrings
		const start = this.locationAt(range.start);
		const end = this.locationAt(range.end);

		const startIdx = this._cellUris.get(start.uri);
		const endIdx = this._cellUris.get(end.uri);

		if (startIdx === undefined || endIdx === undefined) {
			return '';
		}

		if (startIdx === endIdx) {
			return this._cells[startIdx].document.getText(new types.Range(start.range.start, end.range.end));
		}

		const parts = [this._cells[startIdx].document.getText(new types.Range(start.range.start, new types.Position(this._cells[startIdx].document.lineCount, 0)))];
		for (let i = startIdx + 1; i < endIdx; i++) {
			parts.push(this._cells[i].document.getText());
		}
		parts.push(this._cells[endIdx].document.getText(new types.Range(new types.Position(0, 0), end.range.end)));
		return parts.join('\n');
	}