src/vs/workbench/contrib/preferences/common/smartSnippetInserter.ts/SmartSnippetInserter/offsetToPosition
class SmartSnippetInserter:	private static offsetToPosition(model: ITextModel, offset: number): Position {
		let offsetBeforeLine = 0;
		const eolLength = model.getEOL().length;
		const lineCount = model.getLineCount();
		for (let lineNumber = 1; lineNumber <= lineCount; lineNumber++) {
			const lineTotalLength = model.getLineContent(lineNumber).length + eolLength;
			const offsetAfterLine = offsetBeforeLine + lineTotalLength;

			if (offsetAfterLine > offset) {
				return new Position(
					lineNumber,
					offset - offsetBeforeLine + 1
				);
			}
			offsetBeforeLine = offsetAfterLine;
		}
		return new Position(
			lineCount,
			model.getLineMaxColumn(lineCount)
		);
	}