languageBracketsConfiguration.ts ×7

Frontier kind: Code frontier

unlabeled · c_3632806ccbf5

55 tests · 17713 LOC · 73 files · introduces 0 tests · 50 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges50 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1939 ranges17713 lines · 73 files · Browse complete extent
All tests (intent)
55 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.

3 files ranked by introduced lines: 50 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/languages/supports/languageBracketsConfiguration.ts 41 introduced LOC · 7 ranges

Open complete file

23 const bracketPairs = config.brackets ? filterValidBrackets(config.brackets) : [];
24 const openingBracketInfos = new CachedFunction((bracket: string) => {
25 > const closing = new Set<ClosingBracketKind>(); languageBracketsConfiguration.ts
26 >
27 > return {
28 > info: new OpeningBracketKind(this, bracket, closing),
29 > closing,
30 > };
31 });
32 const closingBracketInfos = new CachedFunction((bracket: string) => {
33 > const opening = new Set<OpeningBracketKind>(); languageBracketsConfiguration.ts
34 > const openingColorized = new Set<OpeningBracketKind>();
35 > return {
36 > info: new ClosingBracketKind(this, bracket, opening, openingColorized),
37 > opening,
38 > openingColorized,
39 > };
40 });
41
42 for (const [open, close] of bracketPairs) {
43 > const opening = openingBracketInfos.get(open); languageBracketsConfiguration.ts
44 > const closing = closingBracketInfos.get(close);
45 >
46 > opening.closing.add(closing.info);
47 > closing.opening.add(opening.info);
48 > }
49
50 // Treat colorized brackets as brackets, and mark them as colorized.
101 }
102
103 > function filterValidBrackets(bracketPairs: [string, string][]): [string, string][] { languageBracketsConfiguration.ts
104 > return bracketPairs.filter(([open, close]) => open !== '' && close !== '');
105 > }
106
107 export type BracketKind = OpeningBracketKind | ClosingBracketKind;
109 export class BracketKindBase {
110 constructor(
111 > protected readonly config: LanguageBracketsConfiguration, languageBracketsConfiguration.ts
112 > public readonly bracketText: string,
113 > ) { }
114
115 public get languageId(): string {
122
123 constructor(
124 > config: LanguageBracketsConfiguration, languageBracketsConfiguration.ts
125 > bracketText: string,
126 > public readonly openedBrackets: ReadonlySet<ClosingBracketKind>,
127 > ) {
128 > super(config, bracketText);
129 > }
130 }
131
134
135 constructor(
136 > config: LanguageBracketsConfiguration, languageBracketsConfiguration.ts
137 > bracketText: string,
138 > /**
139 > * Non empty array of all opening brackets this bracket closes.
140 > */
141 > public readonly openingBrackets: ReadonlySet<OpeningBracketKind>,
142 > private readonly openingColorizedBrackets: ReadonlySet<OpeningBracketKind>,
143 > ) {
144 > super(config, bracketText);
145 > }
146
147 /**
src/vs/base/common/cache.ts 8 introduced LOC · 2 ranges

Open complete file

108
109 public get(arg: TArg): TComputed {
110 > const key = this._computeKey(arg); cache.ts
111 > if (this._map2.has(key)) {
112 return this._map2.get(key)!;
113 }
114 > cache.ts
115 > const value = this._fn(arg);
116 > this._map.set(arg, value);
117 > this._map2.set(key, value);
118 > return value;
119 > }
120 }
121
src/vs/editor/common/languages/languageConfigurationRegistry.ts 1 introduced LOC · 1 range

Open complete file

372 this.underlyingConfig.indentationRules ||
373 this.underlyingConfig.onEnterRules
374 > ? new OnEnterSupport(this.underlyingConfig) languageConfigurationRegistry.ts
375 : null;
376 this.comments = ResolvedLanguageConfiguration._handleComments(this.underlyingConfig);