diff.ts ×3

Frontier kind: Code frontier

unlabeled · c_637d7bb17d74

99 tests · 7667 LOC · 43 files · introduces 0 tests · 27 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges27 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1213 ranges7667 lines · 43 files · Browse complete extent
All tests (intent)
99 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.

2 files ranked by introduced lines: 27 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/diff/legacyLinesDiffComputer.ts 19 introduced LOC · 3 ranges

Open complete file

129 }
130
131 > function computeDiff(originalSequence: ISequence, modifiedSequence: ISequence, continueProcessingPredicate: () => boolean, pretty: boolean): IDiffResult { legacyLinesDiffComputer.ts
132 > const diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);
133 > return diffAlgo.ComputeDiff(pretty);
134 > }
135
136 class LineSequence implements ISequence {
153
154 public getElements(): Int32Array | number[] | string[] {
155 > const elements: string[] = []; legacyLinesDiffComputer.ts
156 > for (let i = 0, len = this.lines.length; i < len; i++) {
157 > elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);
158 > }
159 > return elements;
160 > }
161
162 public getStrictElement(index: number): string {
495 };
496 }
498 > const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);
499 > const rawChanges = diffResult.changes;
500 > const quitEarly = diffResult.quitEarly;
501 >
502 > // The diff is always computed with ignoring trim whitespace
503 > // This ensures we get the prettiest diff
504 >
505 > if (this.shouldIgnoreTrimWhitespace) {
506 const lineChanges: LineChange[] = [];
507 for (let i = 0, length = rawChanges.length; i < length; i++) {
src/vs/base/common/diff/diff.ts 8 introduced LOC · 3 ranges

Open complete file

274
275 if (LcsDiff._isStringArray(elements)) {
276 > const hashes = new Int32Array(elements.length); diff.ts
277 > for (let i = 0, len = elements.length; i < len; i++) {
278 > hashes[i] = stringHash(elements[i], 0);
279 > }
280 > return [elements, hashes, true];
281 > }
282
283 if (elements instanceof Int32Array) {
922 // Give preference to the ones containing longer lines
923 if (this._hasStrings) {
924 > for (let i = 1, len = changes.length; i < len; i++) { diff.ts
925 const aChange = changes[i - 1];
926 const bChange = changes[i];
953 }
954 }
955 > } diff.ts
956
957 return changes;