concat23Trees.ts ×6

Frontier kind: Code frontier

unlabeled · c_fc50e72f3a0d

867 tests · 6269 LOC · 36 files · introduces 0 tests · 28 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges28 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1011 ranges6269 lines · 36 files · Browse complete extent
All tests (intent)
867 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: 28 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.ts 28 introduced LOC · 6 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- concat23Trees.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { AstNode, AstNodeKind, ListAstNode } from './ast.js';
7 >
8 > /**
9 > * Concatenates a list of (2,3) AstNode's into a single (2,3) AstNode.
10 > * This mutates the items of the input array!
11 > * If all items have the same height, this method has runtime O(items.length).
12 > * Otherwise, it has runtime O(items.length * max(log(items.length), items.max(i => i.height))).
13 > */
14 > export function concat23Trees(items: AstNode[]): AstNode | null {
15 if (items.length === 0) {
16 return null;
64 return result;
65 }
67 > export function concat23TreesOfSameHeight(items: AstNode[], createImmutableLists: boolean = false): AstNode | null {
68 if (items.length === 0) {
69 return null;
85 return ListAstNode.create23(items[0], items[1], length >= 3 ? items[2] : null, createImmutableLists);
86 }
88 function heightDiff(node1: AstNode, node2: AstNode): number {
89 return Math.abs(node1.listHeight - node2.listHeight);
90 }
92 function concat(node1: AstNode, node2: AstNode): AstNode {
93 if (node1.listHeight === node2.listHeight) {
101 }
102 }
104 > /**
105 > * Appends the given node to the end of this (2,3) tree.
106 > * Returns the new root.
107 > */
108 function append(list: ListAstNode, nodeToAppend: AstNode): AstNode {
109 list = list.toMutable();
150 }
151 }
153 > /**
154 > * Prepends the given node to the end of this (2,3) tree.
155 > * Returns the new root.
156 > */
157 function prepend(list: ListAstNode, nodeToAppend: AstNode): AstNode {
158 list = list.toMutable();