function splitLargeTokens(lineContent, tokens) {
        var lastTokenEndIndex = 0;
        var result = [], resultLen = 0;
        for (var i = 0, len = tokens.length; i < len; i++) {
            var token = tokens[i];
            var tokenEndIndex = token.endIndex;
            var diff = (tokenEndIndex - lastTokenEndIndex);
            if (diff > 50 /* LongToken */) {
                var tokenType = token.type;
                var piecesCount = Math.ceil(diff / 50 /* LongToken */);
                for (var j = 1; j < piecesCount; j++) {
                    var pieceEndIndex = lastTokenEndIndex + (j * 50 /* LongToken */);
                    var lastCharInPiece = lineContent.charCodeAt(pieceEndIndex - 1);
                    if (strings.isHighSurrogate(lastCharInPiece)) {
                        // Don't cut in the middle of a surrogate pair
                        pieceEndIndex--;
                    }
                    result[resultLen++] = new LinePart(pieceEndIndex, tokenType);
                }
                result[resultLen++] = new LinePart(tokenEndIndex, tokenType);
            }
            else {
                result[resultLen++] = token;
            }
            lastTokenEndIndex = tokenEndIndex;
        }
        return result;
    }
See https://github.com/Microsoft/vscode/issues/6885.
It appears that having very large spans causes very slow reading of character positions.
So here we try to avoid that.