public get oldEnd(): number {
}
public get newLength(): number {
}
public get newEnd(): number {
Frontier kind: Code frontier
unlabeled · c_137662768b35
10 tests · 5693 LOC · 30 files · introduces 0 tests · 73 LOC · 1 file
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.
Every exact file and test below is linked only from the concept that introduces it.
mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1Every collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
1 file ranked by introduced lines: 73 introduced LOC across 18 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
public get oldEnd(): number {
}
public get newLength(): number {
}
public get newEnd(): number {
return currEdits;
}
return compressor.compress();
}
class TextChangeCompressor {
constructor(prevEdits: TextChange[], currEdits: TextChange[]) {
this._currEdits = currEdits;
this._result = [];
this._resultLen = 0;
this._prevLen = this._prevEdits.length;
this._prevDeltaOffset = 0;
this._currLen = this._currEdits.length;
this._currDeltaOffset = 0;
}
public compress(): TextChange[] {
let currIndex = 0;
let prevEdit = this._getPrev(prevIndex);
let currEdit = this._getCurr(currIndex);
while (prevIndex < this._prevLen || currIndex < this._currLen) {
if (prevEdit === null) {
this._acceptCurr(currEdit!);
currEdit = this._getCurr(++currIndex);
continue;
}
if (currEdit === null) {
this._acceptPrev(prevEdit);
prevEdit = this._getPrev(++prevIndex);
continue;
}
if (currEdit.oldEnd <= prevEdit.newPosition) {
this._acceptCurr(currEdit);
currEdit = this._getCurr(++currIndex);
continue;
}
if (prevEdit.newEnd <= currEdit.oldPosition) {
this._acceptPrev(prevEdit);
prevEdit = this._getPrev(++prevIndex);
this._currDeltaOffset += mergeCurr.newLength - mergeCurr.oldLength;
}
const merged = TextChangeCompressor._merge(this._result);
const cleaned = TextChangeCompressor._removeNoOps(merged);
return cleaned;
}
private _acceptCurr(currEdit: TextChange): void {
private _getCurr(currIndex: number): TextChange | null {
}
private _acceptPrev(prevEdit: TextChange): void {
private _getPrev(prevIndex: number): TextChange | null {
}
private static _rebaseCurr(prevDeltaOffset: number, currEdit: TextChange): TextChange {
private static _merge(edits: TextChange[]): TextChange[] {
return edits;
}
const result: TextChange[] = [];
let resultLen = 0;
let prev = edits[0];
for (let i = 1; i < edits.length; i++) {
const curr = edits[i];
if (prev.oldEnd === curr.oldPosition) {
// Merge into `prev`
prev = new TextChange(
prev.newText + curr.newText
);
result[resultLen++] = prev;
prev = curr;
}
result[resultLen++] = prev;
return result;
}
private static _removeNoOps(edits: TextChange[]): TextChange[] {
return edits;
}
const result: TextChange[] = [];
let resultLen = 0;
for (let i = 0; i < edits.length; i++) {
const edit = edits[i];
if (edit.oldText === edit.newText) {
continue;
}
}
return result;
}
}