diff.ts ×5

Frontier kind: Code frontier

unlabeled · c_cf544c618ef7

78 tests · 6242 LOC · 31 files · introduces 0 tests · 30 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges30 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
912 ranges6242 lines · 31 files · Browse complete extent
All tests (intent)
78 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: 30 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/common/diff/diff.ts 30 introduced LOC · 5 ranges

Open complete file

202 */
203 public getChanges(): DiffChange[] {
204 > if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { diff.ts
205 > // Finish up on whatever is left
206 > this.MarkNextChange();
207 > }
208 >
209 > return this.m_changes;
210 > }
211
212 /**
515 ];
516 } else {
517 > // Now walk backward through the reverse diagonals history diff.ts
518 > changeHelper = new DiffChangeHelper();
519 > diagonalMin = diagonalReverseStart;
520 > diagonalMax = diagonalReverseEnd;
521 > diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset;
522 > lastOriginalIndex = Constants.MAX_SAFE_SMALL_INTEGER;
523 > historyIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;
524 >
525 > do {
526 > // Get the diagonal index from the relative diagonal number
527 > const diagonal = diagonalRelative + diagonalReverseBase;
528 >
529 > // Figure out where we came from
530 > if (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {
531 // Horizontal line (the element is a deletion))
532 originalIndex = reversePoints[diagonal + 1] - 1;
538 changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);
539 diagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration
540 > } else { diff.ts
541 // Vertical line (the element is an insertion)
542 originalIndex = reversePoints[diagonal - 1];
549 diagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration
550 }
551 > diff.ts
552 > if (historyIndex >= 0) {
553 reversePoints = this.m_reverseHistory[historyIndex];
554 diagonalReverseBase = reversePoints[0]; //We stored this in the first spot
556 diagonalMax = reversePoints.length - 1;
557 }
558 > } while (--historyIndex >= -1); diff.ts
559 >
560 > // There are cases where the reverse history will find diffs that
561 > // are correct, but not intuitive, so we need shift them.
562 > reverseChanges = changeHelper.getChanges();
563 > }
564
565 return this.ConcatenateChanges(forwardChanges, reverseChanges);