src/vs/editor/contrib/indentation/browser/indentUtils.ts/getSpaceCnt
export function getSpaceCnt(str: string, tabSize: number) {
	let spacesCnt = 0;

	for (let i = 0; i < str.length; i++) {
		if (str.charAt(i) === '\t') {
			spacesCnt += tabSize;
		} else {
			spacesCnt++;
		}
	}

	return spacesCnt;
}