languageConfigurationRegistry.ts ×8

Frontier kind: Joint frontier

unlabeled · c_e0e523ed9f5c

1 test · 41373 LOC · 240 files · introduces 1 test · 53 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges53 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
5156 ranges41373 lines · 240 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.

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

src/vs/editor/common/languages/languageConfigurationRegistry.ts 53 introduced LOC · 8 ranges

Open complete file

68
69 constructor(
70 > @IConfigurationService private readonly configurationService: IConfigurationService, languageConfigurationRegistry.ts
71 > @ILanguageService private readonly languageService: ILanguageService
72 > ) {
73 > super();
74 >
75 > const languageConfigKeys = new Set(Object.values(customizedLanguageConfigKeys));
76 >
77 > this._register(this.configurationService.onDidChangeConfiguration((e) => {
78 const globalConfigChanged = e.change.keys.some((k) =>
79 languageConfigKeys.has(k)
96 }
97 }
99 >
100 > this._register(this._registry.onDidChange((e) => {
101 this.configurations.delete(e.languageId);
102 this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(e.languageId));
104 > }
105
106 public register(languageId: string, configuration: LanguageConfiguration, priority?: number): IDisposable {
109
110 public getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration {
111 > let result = this.configurations.get(languageId); languageConfigurationRegistry.ts
112 > if (!result) {
113 > result = computeConfig(languageId, this._registry, this.configurationService, this.languageService);
114 > this.configurations.set(languageId, result);
115 > }
116 > return result;
117 > }
118 }
119
120 > function computeConfig( languageConfigurationRegistry.ts
121 > languageId: string,
122 > registry: LanguageConfigurationRegistry,
123 > configurationService: IConfigurationService,
124 > languageService: ILanguageService,
125 > ): ResolvedLanguageConfiguration {
126 > let languageConfig = registry.getLanguageConfiguration(languageId);
127 >
128 > if (!languageConfig) {
129 if (!languageService.isRegisteredLanguageId(languageId)) {
130 // this happens for the null language, which can be returned by monarch.
134 languageConfig = new ResolvedLanguageConfiguration(languageId, {});
135 }
137 > const customizedConfig = getCustomizedLanguageConfig(languageConfig.languageId, configurationService);
138 > const data = combineLanguageConfigurations([languageConfig.underlyingConfig, customizedConfig]);
139 > const config = new ResolvedLanguageConfiguration(languageConfig.languageId, data);
140 > return config;
141 > }
142
143 const customizedLanguageConfigKeys = {
146 };
147
148 > function getCustomizedLanguageConfig(languageId: string, configurationService: IConfigurationService): LanguageConfiguration { languageConfigurationRegistry.ts
149 > const brackets = configurationService.getValue(customizedLanguageConfigKeys.brackets, {
150 > overrideIdentifier: languageId,
151 > });
152 >
153 > const colorizedBracketPairs = configurationService.getValue(customizedLanguageConfigKeys.colorizedBracketPairs, {
154 > overrideIdentifier: languageId,
155 > });
156 >
157 > return {
158 > brackets: validateBracketPairs(brackets),
159 > colorizedBracketPairs: validateBracketPairs(colorizedBracketPairs),
160 > };
161 > }
162
163 > function validateBracketPairs(data: unknown): CharacterPair[] | undefined { languageConfigurationRegistry.ts
164 > if (!Array.isArray(data)) {
165 > return undefined;
166 > }
167 return data.map(pair => {
168 if (!Array.isArray(pair) || pair.length !== 2) {