intervalTree.ts ×4

Frontier kind: Joint frontier

unlabeled · c_4034cb501a5c

1 test · 41802 LOC · 238 files · introduces 1 test · 43 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges43 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
5289 ranges41802 lines · 238 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/editor/common/model/intervalTree.ts 31 introduced LOC · 4 ranges

Open complete file

269 */
270 public collectNodesFromOwner(ownerId: number): IntervalNode[] {
271 > return collectNodesFromOwner(this, ownerId); intervalTree.ts
272 > }
273
274 /**
636 //#region Searching
637
638 > function collectNodesFromOwner(T: IntervalTree, ownerId: number): IntervalNode[] { intervalTree.ts
639 > let node = T.root;
640 > const result: IntervalNode[] = [];
641 > let resultLen = 0;
642 > while (node !== SENTINEL) {
643 > if (getNodeIsVisited(node)) {
644 > // going up from this node
645 > setNodeIsVisited(node.left, false);
646 > setNodeIsVisited(node.right, false);
647 > node = node.parent;
648 > continue;
649 > }
650 >
651 > if (node.left !== SENTINEL && !getNodeIsVisited(node.left)) {
652 // go left
653 node = node.left;
654 continue;
655 }
657 > // handle current node
658 > if (node.ownerId === ownerId) {
659 > result[resultLen++] = node;
660 > }
661 >
662 > setNodeIsVisited(node, true);
663 >
664 > if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) {
665 // go right
666 node = node.right;
667 continue;
668 }
669 > } intervalTree.ts
670 >
671 > setNodeIsVisited(T.root, false);
672 >
673 > return result;
674 > }
675
676 function collectNodesPostOrder(T: IntervalTree): IntervalNode[] {
src/vs/editor/common/model/textModel.ts 12 introduced LOC · 2 ranges

Open complete file

1779 return;
1780 }
1781 > const nodes = this._decorationsTree.collectNodesFromOwner(ownerId); textModel.ts
1782 > for (let i = 0, len = nodes.length; i < len; i++) {
1783 > const node = nodes[i];
1784 >
1785 > this._decorationsTree.delete(node);
1786 > delete this._decorations[node.id];
1787 > }
1788 }
1789
2292
2293 public collectNodesFromOwner(ownerId: number): IntervalNode[] {
2294 > const r0 = this._decorationsTree0.collectNodesFromOwner(ownerId); textModel.ts
2295 > const r1 = this._decorationsTree1.collectNodesFromOwner(ownerId);
2296 > const r2 = this._injectedTextDecorationsTree.collectNodesFromOwner(ownerId);
2297 > return r0.concat(r1).concat(r2);
2298 > }
2299
2300 public collectNodesPostOrder(): IntervalNode[] {