Skip to content

Commit effcf2a

Browse files
author
Andy
authored
Fix test for overlapping changes (microsoft#22741)
1 parent 3a3f57a commit effcf2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/textChanges.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ namespace ts.textChanges {
634634
// order changes by start position
635635
const normalized = stableSort(changesInFile, (a, b) => a.range.pos - b.range.pos);
636636
// verify that change intervals do not overlap, except possibly at end points.
637-
for (let i = 0; i < normalized.length - 2; i++) {
637+
for (let i = 0; i < normalized.length - 1; i++) {
638638
Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", () =>
639639
`${JSON.stringify(normalized[i].range)} and ${JSON.stringify(normalized[i + 1].range)}`);
640640
}

0 commit comments

Comments
 (0)