executionGraph.ts ×6

Frontier kind: Joint frontier

unlabeled · c_0df59f2802ef

2 tests · 3614 LOC · 19 files · introduces 1 test · 102 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges102 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
491 ranges3614 lines · 19 files · Browse complete extent
All tests (intent)
2 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 ×3 · 3 introduced LOCexecutionGraph.ts ×3executionGraph.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 renderLaneGraph: degenerate linked-list tree (5 nodes)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderLaneGraph: degenerate linked-list tree (5 nodes)|occurrence=1executionGraph.test|titl…executionGraph.test|title=executionGraph renderLaneGraph: forest with forks across two roots|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderLaneGraph: forest with forks across two roots|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 ×6 · 102 introduced LOCexecutionGraph.ts ×6

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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/base/test/common/executionGraph.ts 102 introduced LOC · 6 ranges

Open complete file

434 */
435 export function renderLaneGraph(history: ExecutionHistory): string {
436 > const { events } = history; executionGraph.ts
437 > if (events.length === 0) { return ''; }
438 >
439 > interface Node {
440 > readonly label: string;
441 > readonly parent: Node | undefined;
442 > readonly isSynthetic: boolean;
443 > }
444 >
445 > // Insert synthetic root nodes before their first child.
446 > const nodes: Node[] = [];
447 > const syntheticForRoot = new Map<ExecutionRoot, Node>();
448 > const nodeByEvent = new Map<ExecutionEvent, Node>();
449 >
450 > // Which roots have at least one direct child event?
451 > const rootsWithChildren = new Set<ExecutionRoot>();
452 > for (const e of events) { if (!e.parent) { rootsWithChildren.add(e.root); } }
453 >
454 > for (const e of events) {
455 > if (rootsWithChildren.has(e.root) && !syntheticForRoot.has(e.root)) {
456 > const syn: Node = { label: `+${e.root.label}`, parent: undefined, isSynthetic: true };
457 > syntheticForRoot.set(e.root, syn);
458 > nodes.push(syn);
459 > }
460 > const timeStr = `+${e.time}ms`.padStart(7);
461 > const parent = e.parent ? nodeByEvent.get(e.parent)! : syntheticForRoot.get(e.root);
462 > const node: Node = { label: `[${timeStr}] ${e.label}`, parent, isSynthetic: false };
463 > nodeByEvent.set(e, node);
464 > nodes.push(node);
465 > }
466 >
467 > const n = nodes.length;
468 > const parentOf = new Array<number>(n).fill(-1);
469 > const childrenOf: number[][] = Array.from({ length: n }, () => []);
470 > const indexOfNode = new Map<Node, number>();
471 > for (let i = 0; i < n; i++) { indexOfNode.set(nodes[i], i); }
472 > for (let i = 0; i < n; i++) {
473 > const p = nodes[i].parent;
474 > if (p) {
475 > const pi = indexOfNode.get(p);
476 > if (pi !== undefined) { parentOf[i] = pi; childrenOf[pi].push(i); }
477 > }
478 > }
479 >
480 > // Assign columns: every node with children gets its own column.
481 > const colOf = new Array<number>(n).fill(-1);
482 > let totalCols = 0;
483 > for (let i = 0; i < n; i++) {
484 > if (childrenOf[i].length > 0) { colOf[i] = totalCols++; }
485 > }
486 >
487 > if (totalCols === 0) {
488 return events.map(e => `[+${`${e.time}ms`.padStart(5)}] ${e.label}`).join('\n');
489 }
491 > const active = new Array<number>(totalCols).fill(-1);
492 > const lines: string[] = [];
493 >
494 > for (let i = 0; i < n; i++) {
495 > const node = nodes[i];
496 > const pIdx = parentOf[i];
497 > const connectCol = pIdx >= 0 ? colOf[pIdx] : -1;
498 > const last = pIdx >= 0 && childrenOf[pIdx][childrenOf[pIdx].length - 1] === i;
499 > const opensCol = childrenOf[i].length > 0 ? colOf[i] : -1;
500 > const horizEnd = pIdx >= 0 ? (opensCol >= 0 ? opensCol : totalCols) : -1;
501 >
502 > const chars: string[] = [];
503 > for (let c = 0; c < totalCols; c++) {
504 > const isActive = active[c] >= 0;
505 > const isConnect = c === connectCol;
506 > const isOpen = c === opensCol && !isConnect;
507 > const inHoriz = connectCol >= 0 && c > connectCol && c < horizEnd;
508 >
509 > let g: string, s: string;
510 > if (isConnect) {
511 > g = last ? '└' : '├';
512 > s = '─';
513 > } else if (isOpen && node.isSynthetic) {
514 > g = '+';
515 > s = node.label.slice(1, 2) || '?';
516 > } else if (isOpen && connectCol >= 0) {
517 > g = '╷'; s = '─';
518 > } else if (isOpen) {
519 g = '╷'; s = ' ';
520 > } else if (inHoriz && isActive) { executionGraph.ts
521 g = '┼'; s = '─';
522 > } else if (inHoriz) { executionGraph.ts
523 g = '─'; s = '─';
524 > } else if (isActive) { executionGraph.ts
525 g = '│'; s = ' ';
526 > } else { executionGraph.ts
527 > g = ' '; s = ' ';
528 > }
529 > chars.push(g, s);
530 > }
531 >
532 > if (last) { active[colOf[pIdx]] = -1; }
533 > if (opensCol >= 0) { active[opensCol] = i; }
534 >
535 > if (node.isSynthetic) {
536 > lines.push(chars.join('').trimEnd());
537 > } else {
538 > lines.push(`${chars.join('')}${node.label}`);
539 > }
540 > }
541 >
542 > return lines.join('\n');
543 > }