bracketPairsTree.ts ×5

Frontier kind: Code frontier

unlabeled · c_0843ee84707f

10 tests · 41422 LOC · 238 files · introduces 0 tests · 67 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges67 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5146 ranges41422 lines · 238 files · Browse complete extent
All tests (intent)
10 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.

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

src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.ts 41 introduced LOC · 5 ranges

Open complete file

400
401 if (node.kind === AstNodeKind.Pair) {
402 > let levelPerBracket = 0; bracketPairsTree.ts
403 > if (levelPerBracketType) {
404 > let existing = levelPerBracketType.get(node.openingBracket.text);
405 > if (existing === undefined) {
406 > existing = 0;
407 > }
408 > levelPerBracket = existing;
409 > existing++;
410 > levelPerBracketType.set(node.openingBracket.text, existing);
411 > }
412 >
413 > const openingBracketEnd = lengthAdd(nodeOffsetStart, node.openingBracket.length);
414 > let minIndentation = -1;
415 > if (context.includeMinIndentation) {
416 minIndentation = node.computeMinIndentation(
417 nodeOffsetStart,
419 );
420 }
422 > shouldContinue = context.push(
423 > new BracketPairWithMinIndentationInfo(
424 > lengthsToRange(nodeOffsetStart, nodeOffsetEnd),
425 > lengthsToRange(nodeOffsetStart, openingBracketEnd),
426 > node.closingBracket
427 > ? lengthsToRange(
428 > lengthAdd(openingBracketEnd, node.child?.length || lengthZero),
429 > nodeOffsetEnd
430 > )
431 : undefined,
432 > level, bracketPairsTree.ts
433 > levelPerBracket,
434 > node,
435 > minIndentation
436 > )
437 > );
438 >
439 > nodeOffsetStart = openingBracketEnd;
440 > if (shouldContinue && node.child) {
441 > const child = node.child;
442 > nodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length);
443 > if (
444 > lengthLessThanEqual(nodeOffsetStart, endOffset) &&
445 lengthGreaterThanEqual(nodeOffsetEnd, startOffset)
447 shouldContinue = collectBracketPairs(
448 child,
459 }
460 }
462 >
463 > levelPerBracketType?.set(node.openingBracket.text, levelPerBracket);
464 } else {
465 let curOffset = nodeOffsetStart;
src/vs/editor/common/textModelBracketPairs.ts 26 introduced LOC · 2 ranges

Open complete file

84 export class BracketPairInfo {
85 constructor(
86 > public readonly range: Range, textModelBracketPairs.ts
87 > public readonly openingBracketRange: Range,
88 > public readonly closingBracketRange: Range | undefined,
89 > /** 0-based */
90 > public readonly nestingLevel: number,
91 > public readonly nestingLevelOfEqualBracketType: number,
92 > private readonly bracketPairNode: PairAstNode,
93 >
94 > ) {
95 > }
96
97 public get openingBracketInfo(): OpeningBracketKind {
106 export class BracketPairWithMinIndentationInfo extends BracketPairInfo {
107 constructor(
108 > range: Range, textModelBracketPairs.ts
109 > openingBracketRange: Range,
110 > closingBracketRange: Range | undefined,
111 > /**
112 > * 0-based
113 > */
114 > nestingLevel: number,
115 > nestingLevelOfEqualBracketType: number,
116 > bracketPairNode: PairAstNode,
117 > /**
118 > * -1 if not requested, otherwise the size of the minimum indentation in the bracket pair in terms of visible columns.
119 > */
120 > public readonly minVisibleColumnIndentation: number,
121 > ) {
122 > super(range, openingBracketRange, closingBracketRange, nestingLevel, nestingLevelOfEqualBracketType, bracketPairNode);
123 > }
124 }