lineHeights.ts ×11

Frontier kind: Code frontier

unlabeled · c_218bd162a43f

35 tests · 12801 LOC · 38 files · introduces 0 tests · 38 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges38 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1249 ranges12801 lines · 38 files · Browse complete extent
All tests (intent)
35 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: 38 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/viewLayout/lineHeights.ts 38 introduced LOC · 11 ranges

Open complete file

204 continue;
205 }
206 > const candidateInsertionIndex = this._binarySearchOverOrderedCustomLinesArray(pendingChange.lineNumber); lineHeights.ts
207 const insertionIndex = candidateInsertionIndex >= 0 ? candidateInsertionIndex : -(candidateInsertionIndex + 1);
208 this._orderedCustomLines.splice(insertionIndex, 0, pendingChange);
214 return;
215 }
216 > const newDecorationIDToSpecialLine = new ArrayMap<string, CustomLine>(); lineHeights.ts
217 > const newOrderedSpecialLines: CustomLine[] = [];
218 >
219 > for (let i = 0; i < this._invalidIndex; i++) {
220 const customLine = this._orderedCustomLines[i];
221 newOrderedSpecialLines.push(customLine);
222 newDecorationIDToSpecialLine.add(customLine.decorationId, customLine);
223 }
225 > let numberOfDeletions = 0;
226 let previousSpecialLine: CustomLine | undefined = (this._invalidIndex > 0) ? newOrderedSpecialLines[this._invalidIndex - 1] : undefined;
227 for (let i = this._invalidIndex; i < this._orderedCustomLines.length; i++) {
228 > const customLine = this._orderedCustomLines[i]; lineHeights.ts
229 > if (customLine.deleted) {
230 numberOfDeletions++;
231 continue;
232 }
233 > customLine.index = i - numberOfDeletions; lineHeights.ts
234 > if (previousSpecialLine && previousSpecialLine.lineNumber === customLine.lineNumber) {
235 customLine.maximumSpecialHeight = previousSpecialLine.maximumSpecialHeight;
236 customLine.prefixSum = previousSpecialLine.prefixSum;
237 > } else { lineHeights.ts
238 > let maximumSpecialHeight = customLine.specialHeight;
239 > for (let j = i; j < this._orderedCustomLines.length; j++) {
240 > const nextSpecialLine = this._orderedCustomLines[j];
241 > if (nextSpecialLine.deleted) {
242 continue;
243 }
244 > if (nextSpecialLine.lineNumber !== customLine.lineNumber) { lineHeights.ts
245 break;
246 }
247 > maximumSpecialHeight = Math.max(maximumSpecialHeight, nextSpecialLine.specialHeight); lineHeights.ts
248 > }
249 > customLine.maximumSpecialHeight = maximumSpecialHeight;
250 >
251 > let prefixSum: number;
252 > if (previousSpecialLine) {
253 prefixSum = previousSpecialLine.prefixSum + previousSpecialLine.maximumSpecialHeight + this._defaultLineHeight * (customLine.lineNumber - previousSpecialLine.lineNumber - 1);
254 > } else { lineHeights.ts
255 > prefixSum = this._defaultLineHeight * (customLine.lineNumber - 1);
256 > }
257 > customLine.prefixSum = prefixSum;
258 > }
259 > previousSpecialLine = customLine;
260 > newOrderedSpecialLines.push(customLine);
261 > newDecorationIDToSpecialLine.add(customLine.decorationId, customLine);
262 > }
263 > this._orderedCustomLines = newOrderedSpecialLines;
264 > this._decorationIDToCustomLine = newDecorationIDToSpecialLine;
265 > this._invalidIndex = Infinity;
266 }
267
430 private _binarySearchOverOrderedCustomLinesArray(lineNumber: number): number {
431 return binarySearch2(this._orderedCustomLines.length, (index) => {
432 > const line = this._orderedCustomLines[index]; lineHeights.ts
433 > if (line.lineNumber === lineNumber) {
434 return 0;
435 > } else if (line.lineNumber < lineNumber) { lineHeights.ts
436 return -1;
437 } else {