edit.ts ×5

Frontier kind: Code frontier

unlabeled · c_6f20bfb426ed

874 tests · 6302 LOC · 35 files · introduces 0 tests · 25 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges25 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1039 ranges6302 lines · 35 files · Browse complete extent
All tests (intent)
874 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 25 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/core/edits/edit.ts 25 introduced LOC · 5 ranges

Open complete file

133 break;
134 }
135 > // else we intersect, because the new end of edit1 is after or equal to our start edit.ts
136 >
137 > if (!firstIntersecting) {
138 > firstIntersecting = r1;
139 > }
140 > lastIntersecting = r1;
141 > edit1Queue.shift();
142 >
143 > edit1ToEdit2 += r1.getNewLength() - r1.replaceRange.length;
144 > }
145
146 if (!firstIntersecting) {
147 result.push(r2.delta(-edit1ToEdit2));
148 } else {
149 > const newReplaceRangeStart = Math.min(firstIntersecting.replaceRange.start, r2.replaceRange.start - firstEdit1ToEdit2); edit.ts
150 >
151 > const prefixLength = r2.replaceRange.start - (firstIntersecting.replaceRange.start + firstEdit1ToEdit2);
152 > if (prefixLength > 0) {
153 const prefix = firstIntersecting.slice(OffsetRange.emptyAt(newReplaceRangeStart), new OffsetRange(0, prefixLength));
154 result.push(prefix);
155 }
156 > if (!lastIntersecting) { edit.ts
157 throw new BugIndicatingError(`Invariant violation: lastIntersecting is undefined`);
158 }
159 > const suffixLength = (lastIntersecting.replaceRange.endExclusive + edit1ToEdit2) - r2.replaceRange.endExclusive; edit.ts
160 > if (suffixLength > 0) {
161 const e = lastIntersecting.slice(
162 OffsetRange.ofStartAndLength(lastIntersecting.replaceRange.endExclusive, 0),
166 edit1ToEdit2 -= e.getNewLength() - e.replaceRange.length;
167 }
168 > edit.ts
169 > const newReplaceRange = new OffsetRange(
170 > newReplaceRangeStart,
171 > r2.replaceRange.endExclusive - edit1ToEdit2
172 > );
173 > const middle = r2.slice(newReplaceRange, new OffsetRange(0, r2.getNewLength()));
174 > result.push(middle);
175 > }
176 }
177