108
if (maxCacheableLength === null || !lengthIsZero(maxCacheableLength)) {
109
const cachedNode = this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset), curNode => {
110
>
// The edit could extend the ending token, thus we cannot re-use nodes that touch the edit.
parser.ts
111
>
// If there is no edit anymore, we can re-use the node in any case.
112
>
if (maxCacheableLength !== null && !lengthLessThan(curNode.length, maxCacheableLength)) {
113
>
// Either the node contains edited text or touches edited text.
114
>
// In the latter case, brackets might have been extended (`end` -> `ending`), so even touching nodes cannot be reused.
115
>
return false;
116
>
}
117
const canBeReused = curNode.canBeReused(openedBracketIds);
118
return canBeReused;