executionGraph.ts ×5

Frontier kind: Joint frontier

unlabeled · c_d777f8d248fe

3 tests · 3661 LOC · 19 files · introduces 2 tests · 139 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges139 lines · 1 files
Tests
2 tests

Contains — complete concept membership

All code (extent)
492 ranges3661 lines · 19 files · Browse complete extent
All tests (intent)
3 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.

Introduced files, introduced tests, and structurally relevant concept specializationexecutionGraph.ts ×1 · 29 introduced LOCexecutionGraph.ts ×1executionGraph.ts ×2 · 10 introduced LOCexecutionGraph.ts ×2executionGraph.ts ×4 · 132 introduced LOCexecutionGraph.ts ×4uri.test|title=URI URI#file, win-speciale|occurrence=1, charCode.test|title=CharCode has good values|occurrence=1, +2 · 0 introduced LOCuri.test|title=URI URI#f…utils.ts ×3 · 9 introduced LOCutils.ts ×3lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/test/common/executionGraph.ts · 543 LOCcommon/executionGraph.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/nls.ts · 244 LOCvs/nls.tscharCode.test|title=CharCode has good values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1charCode.test|title=Char…executionGraph.test|title=executionGraph renderSwimlanes: degenerate linked-list tree (5 nodes)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderSwimlanes: degenerate linked-list tree (5 nodes)|occurrence=1executionGraph.test|titl…executionGraph.test|title=executionGraph renderSwimlanes: empty history|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderSwimlanes: empty history|occurrence=1executionGraph.test|titl…executionGraph.test|title=executionGraph renderSwimlanes: forest with forks across two roots|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderSwimlanes: forest with forks across two roots|occurrence=1executionGraph.test|titl…executionGraph.test|title=executionGraph renderSwimlanes: single root, linear chain|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderSwimlanes: single root, linear chain|occurrence=1executionGraph.test|titl…path.test|title=Paths (Node Implementation) path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1path.test|title=Paths (N…uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1 · introduced test · mocha: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=1uri.test|title=URI File …uri.test|title=URI URI#file, win-speciale|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1uri.test|title=URI URI#f…Focused concept · executionGraph.ts ×5 · 139 introduced LOCexecutionGraph.ts ×5

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.

2 tests introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 139 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/test/common/executionGraph.ts 139 introduced LOC · 5 ranges

Open complete file

197 const { roots, events } = history;
198 if (events.length === 0) { return '(empty history)'; }
199 > if (roots.length === 0) { executionGraph.ts
200 return events.map(e => `[+${e.time}ms] ${e.label}`).join('\n');
201 }
203 > const n = events.length;
204 >
205 > // Parent index per event (-1 = direct child of root).
206 > const parentOf = new Array<number>(n).fill(-1);
207 > const childrenOf: number[][] = Array.from({ length: n }, () => []);
208 > const indexOfEvent = new Map<ExecutionEvent, number>();
209 > for (let i = 0; i < n; i++) { indexOfEvent.set(events[i], i); }
210 > for (let i = 0; i < n; i++) {
211 > const p = events[i].parent;
212 > if (p) {
213 > const pi = indexOfEvent.get(p);
214 > if (pi !== undefined) {
215 > parentOf[i] = pi;
216 > childrenOf[pi].push(i);
217 > }
218 > }
219 > }
220 >
221 > // Is this event the last child of its parent event?
222 > const isLastChild = new Array<boolean>(n).fill(false);
223 > for (let i = 0; i < n; i++) {
224 > const p = parentOf[i];
225 > if (p >= 0 && childrenOf[p][childrenOf[p].length - 1] === i) { isLastChild[i] = true; }
226 > }
227 >
228 > // Slot = visual column index for indentation. By default every child
229 > // gets its own column (slot = parent.slot + 1) so pure last-child chains
230 > // still show their depth structure. Once we pass the depth threshold,
231 > // last-children collapse into their parent's slot to keep deeply nested
232 > // traces from walking off the screen.
233 > const COLLAPSE_DEPTH_THRESHOLD = 6;
234 > const depthOf = new Array<number>(n).fill(0);
235 > const slotOf = new Array<number>(n).fill(0);
236 > for (let i = 0; i < n; i++) {
237 > const p = parentOf[i];
238 > if (p >= 0) {
239 > depthOf[i] = depthOf[p] + 1;
240 > const collapse = isLastChild[i] && depthOf[i] >= COLLAPSE_DEPTH_THRESHOLD;
241 > slotOf[i] = slotOf[p] + (collapse ? 0 : 1);
242 > }
243 > }
244 >
245 > // Display label = label plus the caller stack frame when present,
246 > // e.g. `setTimeout · MyClass.foo (file.ts:42)`. Computed once so width
247 > // math and the per-row render agree. `detailLines` holds any additional
248 > // stack frames beyond the first; they are rendered as continuation rows.
249 > const displayLabelOf = new Array<string>(n);
250 > const detailLinesOf = new Array<readonly string[]>(n);
251 > for (let i = 0; i < n; i++) {
252 > const e = events[i];
253 > const frames = e.detail ? e.detail.split('\n') : [];
254 > displayLabelOf[i] = frames.length > 0 ? `${e.label} · ${frames[0]}` : e.label;
255 > detailLinesOf[i] = frames.slice(1);
256 > }
257 >
258 > // Column width per root: indentation uses slots (last-children collapse
259 > // into their parent's slot), so width must be slot-based to avoid
260 > // reserving empty space for degenerate last-child chains.
261 > const widthOf = new Map<ExecutionRoot, number>();
262 > for (const r of roots) { widthOf.set(r, r.label.length); }
263 > for (let i = 0; i < n; i++) {
264 > const baseIndent = slotOf[i] * 3 + 3;
265 > const maxLen = Math.max(displayLabelOf[i].length, ...detailLinesOf[i].map(l => l.length + 2));
266 > const w = baseIndent + maxLen;
267 > const cur = widthOf.get(events[i].root) ?? 0;
268 > if (w > cur) { widthOf.set(events[i].root, w); }
269 > }
270 >
271 > // Compute time column width based on max time (rounded).
272 const maxTime = n > 0 ? Math.max(...events.map(e => Math.round(e.time))) : 0;
273 const timeColWidth = `+${maxTime}ms`.length;
278 const header: string[] = [];
279 for (const r of roots) {
280 > const w = widthOf.get(r)!; executionGraph.ts
281 > header.push(r.label.padStart(Math.ceil((w + r.label.length) / 2)).padEnd(w));
282 > }
283 > lines.push(`${' '.repeat(timeColWidth)} ${header.join(' ')}`.trimEnd());
284 >
285 > // Compute lastChild index for each event (for drawing continuation lines).
286 > const lastChildOf = new Array<number>(n).fill(-1);
287 > for (let i = 0; i < n; i++) {
288 > const kids = childrenOf[i];
289 > if (kids.length > 0) { lastChildOf[i] = kids[kids.length - 1]; }
290 > }
291 >
292 > // Per-root: set of "active ancestor" event indices (events with children
293 > // whose last child has not yet been rendered, i.e. lastChildOf[a] > i).
294 > const laneStacks = new Map<ExecutionRoot, Set<number>>();
295 > for (const r of roots) { laneStacks.set(r, new Set()); }
296 >
297 > for (let i = 0; i < n; i++) {
298 > const event = events[i];
299 > const timeStr = `+${Math.round(event.time)}ms`.padStart(timeColWidth);
300 >
301 > const parts: string[] = [];
302 > for (const r of roots) {
303 > const w = widthOf.get(r)!;
304 > const stack = laneStacks.get(r)!;
305 >
306 > if (r === event.root) {
307 > // Event line: slot-based indentation, then `├─`/`└─` + label.
308 > // For each slot s in 0..(slot-1), show `│ ` if an ancestor
309 > // at slot s is still active (lastChild > current), else ` `.
310 > const slot = slotOf[i];
311 > const indent: string[] = [];
312 > for (let s = 0; s < slot; s++) {
313 > let hasActive = false;
314 > for (const a of stack) {
315 > if (slotOf[a] === s && lastChildOf[a] > i) { hasActive = true; break; }
316 > }
317 > indent.push(hasActive ? '│ ' : ' ');
318 > }
319 > const prefix = isLastChild[i] ? '└─ ' : '├─ ';
320 > parts.push(`${indent.join('')}${prefix}${displayLabelOf[i]}`.padEnd(w));
321 > } else {
322 // Cross-lane continuation. Draw `│` at each slot occupied by
323 // an active ancestor (lastChild > i). Also show a `|` placeholder
349 parts.push(chars.join('').padEnd(w));
350 }
352 >
353 > lines.push(`${timeStr} ${parts.join(' ')}`.trimEnd());
354 >
355 > // Continuation lines for any extra stack frames. Indented under the
356 > // label, with no time column, no `├─`/`└─` glyph, and `│ `
357 > // continuations for active ancestor lanes (including this event itself
358 > // when it has children that haven't been rendered yet).
359 > const extras = detailLinesOf[i];
360 > if (extras.length > 0) {
361 const slot = slotOf[i];
362 const stackForExtras = laneStacks.get(event.root)!;
398 }
399 }
401 > // Stack maintenance: push this event if it has children, then pop
402 > // any ancestors whose last child was just rendered (propagating up).
403 > const stack = laneStacks.get(event.root)!;
404 > if (childrenOf[i].length > 0) { stack.add(i); }
405 > let cur = i;
406 > while (isLastChild[cur]) {
407 > const p = parentOf[cur];
408 > if (p < 0) { break; }
409 > stack.delete(p);
410 > cur = p;
411 > }
412 > }
413 >
414 > return lines.join('\n');
415 > }
416
417 // -----------------------------------------------------------------------------