diff.ts ×5

Frontier kind: Code frontier

unlabeled · c_53b7ccd4be9c

100 tests · 5997 LOC · 31 files · introduces 0 tests · 18 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges18 lines · 1 files
Tests
0 tests

Contains — complete concept membership

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

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

Open complete file

339
340 if (pretty) {
341 > // We have to clean up the computed diff to be more intuitive diff.ts
342 > // but it turns out this cannot be done correctly until the entire set
343 > // of diffs have been computed
344 > changes = this.PrettifyChanges(changes);
345 > }
346
347 return {
827 */
828 private PrettifyChanges(changes: DiffChange[]): DiffChange[] {
829 > diff.ts
830 > // Shift all the changes down first
831 > for (let i = 0; i < changes.length; i++) {
832 const change = changes[i];
833 const originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length;
860 }
861 }
862 > diff.ts
863 > // Shift changes back up until we hit empty or whitespace-only lines
864 > for (let i = changes.length - 1; i >= 0; i--) {
865 const change = changes[i];
866
918 }
919 }
920 > diff.ts
921 > // There could be multiple longest common substrings.
922 > // Give preference to the ones containing longer lines
923 > if (this._hasStrings) {
924 for (let i = 1, len = changes.length; i < len; i++) {
925 const aChange = changes[i - 1];
954 }
955 }
956 > diff.ts
957 > return changes;
958 > }
959
960 private _findBetterContiguousSequence(originalStart: number, originalLength: number, modifiedStart: number, modifiedLength: number, desiredLength: number): [number, number] | null {