lineHeights.ts ×13

Frontier kind: Code frontier

unlabeled · c_d472cd4340f5

36 tests · 12757 LOC · 38 files · introduces 0 tests · 43 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges43 lines · 1 files
Tests
0 tests

Contains — complete concept membership

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

src/vs/editor/common/viewLayout/lineHeights.ts 43 introduced LOC · 13 ranges

Open complete file

35
36 constructor(decorationId: string, index: number, lineNumber: number, specialHeight: number, prefixSum: number) {
37 > this.decorationId = decorationId; lineHeights.ts
38 > this.index = index;
39 > this.lineNumber = lineNumber;
40 > this.specialHeight = specialHeight;
41 > this.prefixSum = prefixSum;
42 > this.maximumSpecialHeight = specialHeight;
43 > this.deleted = false;
44 > }
45 }
46
101
102 public insertOrChangeCustomLineHeight(decorationId: string, startLineNumber: number, endLineNumber: number, lineHeight: number): void {
103 > this._pendingChanges.push({ kind: PendingChangeKind.InsertOrChange, decorationId, startLineNumber, endLineNumber, lineHeight }); lineHeights.ts
104 > this._hasPending = true;
105 > }
106
107 public heightForLineNumber(lineNumber: number): number {
154 break;
155 case PendingChangeKind.InsertOrChange:
156 > this._doInsertOrChangeCustomLineHeight(change.decorationId, change.startLineNumber, change.endLineNumber, change.lineHeight, stagedInserts, stagedIdMap); lineHeights.ts
157 > break;
158 case PendingChangeKind.LinesDeleted:
159 this._flushStagedDecorationChanges(stagedInserts, stagedIdMap);
170
171 private _doRemoveCustomLineHeight(decorationID: string, stagedIdMap: ArrayMap<string, CustomLine>): void {
172 > const customLines = this._decorationIDToCustomLine.get(decorationID); lineHeights.ts
173 > if (customLines) {
174 this._decorationIDToCustomLine.delete(decorationID);
175 for (const customLine of customLines) {
178 }
179 }
180 > const stagedLines = stagedIdMap.get(decorationID); lineHeights.ts
181 > if (stagedLines) {
182 stagedIdMap.delete(decorationID);
183 for (const line of stagedLines) {
185 }
186 }
187 > } lineHeights.ts
188
189 private _doInsertOrChangeCustomLineHeight(decorationId: string, startLineNumber: number, endLineNumber: number, lineHeight: number, stagedInserts: CustomLine[], stagedIdMap: ArrayMap<string, CustomLine>): void {
190 > this._doRemoveCustomLineHeight(decorationId, stagedIdMap); lineHeights.ts
191 > for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
192 > const customLine = new CustomLine(decorationId, -1, lineNumber, lineHeight, 0);
193 > stagedInserts.push(customLine);
194 > stagedIdMap.add(decorationId, customLine);
195 > }
196 > }
197
198 private _flushStagedDecorationChanges(stagedInserts: CustomLine[], stagedIdMap: ArrayMap<string, CustomLine>): void {
200 return;
201 }
202 > for (const pendingChange of stagedInserts) { lineHeights.ts
203 > if (pendingChange.deleted) {
204 continue;
205 }
206 const candidateInsertionIndex = this._binarySearchOverOrderedCustomLinesArray(pendingChange.lineNumber);
207 > const insertionIndex = candidateInsertionIndex >= 0 ? candidateInsertionIndex : -(candidateInsertionIndex + 1); lineHeights.ts
208 > this._orderedCustomLines.splice(insertionIndex, 0, pendingChange);
209 > this._invalidIndex = Math.min(this._invalidIndex, insertionIndex);
210 > }
211 > stagedInserts.length = 0;
212 > stagedIdMap.clear();
213 > if (this._invalidIndex === Infinity) {
214 return;
215 }
472
473 add(key: K, value: T) {
474 > const array = this._map.get(key); lineHeights.ts
475 > if (!array) {
476 > this._map.set(key, [value]);
477 > } else {
478 array.push(value);
479 }
480 > } lineHeights.ts
481
482 get(key: K): T[] | undefined {
483 > return this._map.get(key); lineHeights.ts
484 > }
485
486 delete(key: K): void {
489
490 clear(): void {
491 > this._map.clear(); lineHeights.ts
492 > }
493 }