constructor() {
this._inserts = [];
this._changes = [];
this._removes = [];
}
public insert(x: EditorWhitespace): void {
this._inserts.push(x);
}
public change(x: IPendingChange): void {
Frontier kind: Code frontier
unlabeled · c_eb34dc35104c
11 tests · 13042 LOC · 39 files · introduces 0 tests · 72 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/editor/test/common/viewLayout/linesLayout.test|title=Editor ViewLayout - LinesLayout LinesLayout 1|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/linesLayout.test|title=Editor ViewLayout - LinesLayout LinesLayout Padding|occurrence=1mocha: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: 72 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
constructor() {
this._inserts = [];
this._changes = [];
this._removes = [];
}
public insert(x: EditorWhitespace): void {
this._inserts.push(x);
}
public change(x: IPendingChange): void {
public commit(linesLayout: LinesLayout): void {
return;
}
const inserts = this._inserts;
const changes = this._changes;
const removes = this._removes;
this._hasPending = false;
this._inserts = [];
this._changes = [];
this._removes = [];
linesLayout._commitPendingChanges(inserts, changes, removes);
}
}
constructor(lineCount: number, defaultLineHeight: number, paddingTop: number, paddingBottom: number, customLineHeightData: CustomLineHeightData[]) {
this._pendingChanges = new PendingChanges();
this._lastWhitespaceId = 0;
this._arr = [];
this._prefixSumValidIndex = -1;
this._minWidth = -1; /* marker for not being computed */
this._lineCount = lineCount;
this._paddingTop = paddingTop;
this._paddingBottom = paddingBottom;
this._lineHeightsManager = new LineHeightsManager(defaultLineHeight, customLineHeightData);
}
/**
public changeWhitespace(callback: (accessor: IWhitespaceChangeAccessor) => void): boolean {
try {
const accessor: IWhitespaceChangeAccessor = {
insertWhitespace: (afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): string => {
hadAChange = true;
afterLineNumber = afterLineNumber | 0;
ordinal = ordinal | 0;
heightInPx = heightInPx | 0;
minWidth = minWidth | 0;
const id = this._instanceId + (++this._lastWhitespaceId);
this._pendingChanges.insert(new EditorWhitespace(id, afterLineNumber, ordinal, heightInPx, minWidth));
return id;
},
changeOneWhitespace: (id: string, newAfterLineNumber: number, newHeight: number): void => {
hadAChange = true;
newAfterLineNumber = newAfterLineNumber | 0;
this._pendingChanges.change({ id, newAfterLineNumber, newHeight });
},
hadAChange = true;
this._pendingChanges.remove({ id });
}
callback(accessor);
} finally {
this._pendingChanges.commit(this);
}
return hadAChange;
}
public _commitPendingChanges(inserts: EditorWhitespace[], changes: IPendingChange[], removes: IPendingRemove[]): void {
this._minWidth = -1; /* marker for not being computed */
}
if (inserts.length + changes.length + removes.length <= 1) {
// when only one thing happened, handle it "delicately"
for (const insert of inserts) {
this._insertWhitespace(insert);
}
for (const change of changes) {
this._changeOneWhitespace(change.id, change.newAfterLineNumber, change.newHeight);
}
const index = this._findWhitespaceIndex(remove.id);
if (index === -1) {
this._removeWhitespace(index);
}
}
// simply rebuild the entire datastructure
this._arr = result;
this._prefixSumValidIndex = -1;
private _insertWhitespace(whitespace: EditorWhitespace): void {
const insertIndex = LinesLayout.findInsertionIndex(this._arr, whitespace.afterLineNumber, whitespace.ordinal);
linesLayout.ts
this._arr.splice(insertIndex, 0, whitespace);
this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, insertIndex - 1);
}
private _findWhitespaceIndex(id: string): number {