settingsSync.ts ×8

Frontier kind: Code frontier

unlabeled · c_41310527389c

52 tests · 26270 LOC · 133 files · introduces 0 tests · 46 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges46 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4290 ranges26270 lines · 133 files · Browse complete extent
All tests (intent)
52 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: 46 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/userDataSync/common/settingsSync.ts 41 introduced LOC · 8 ranges

Open complete file

163
164 protected async getMergeResult(resourcePreview: ISettingsResourcePreview, token: CancellationToken): Promise<IMergeResult> {
165 > const formatUtils = await this.getFormattingOptions(); settingsSync.ts
166 > const ignoredSettings = await this.getIgnoredSettings();
167 > return {
168 > ...resourcePreview.previewResult,
169 >
170 > // remove ignored settings from the preview content
171 > content: resourcePreview.previewResult.content ? updateIgnoredSettings(resourcePreview.previewResult.content, '{}', ignoredSettings, formatUtils) : null
172 > };
173 > }
174
175 protected async getAcceptResult(resourcePreview: ISettingsResourcePreview, resource: URI, content: string | null | undefined, token: CancellationToken): Promise<IAcceptResult> {
177 > const formattingOptions = await this.getFormattingOptions();
178 > const ignoredSettings = await this.getIgnoredSettings();
179 >
180 > /* Accept local resource */
181 > if (this.extUri.isEqual(resource, this.localResource)) {
182 return {
183 /* Remove ignored settings */
187 };
188 }
190 > /* Accept remote resource */
191 > if (this.extUri.isEqual(resource, this.remoteResource)) {
192 return {
193 /* Update ignored settings from local file content */
197 };
198 }
200 > /* Accept preview resource */
201 > if (this.extUri.isEqual(resource, this.previewResource)) {
202 > if (content === undefined) {
203 > return {
204 > content: resourcePreview.previewResult.content,
205 > localChange: resourcePreview.previewResult.localChange,
206 > remoteChange: resourcePreview.previewResult.remoteChange,
207 > };
208 > } else {
209 return {
210 /* Add ignored settings from local file content */
214 };
215 }
216 > } settingsSync.ts
217
218 throw new Error(`Invalid Resource: ${resource.toString()}`);
219 > } settingsSync.ts
220
221 protected async applyResult(remoteUserData: IRemoteUserData, lastSyncUserData: IRemoteUserData | null, resourcePreviews: [ISettingsResourcePreview, IAcceptResult][], force: boolean): Promise<void> {
242
243 if (remoteChange !== Change.None) {
244 > const formatUtils = await this.getFormattingOptions(); settingsSync.ts
245 > // Update ignored settings from remote
246 > const remoteSettingsSyncContent = this.getSettingsSyncContent(remoteUserData);
247 > const ignoredSettings = await this.getIgnoredSettings(content);
248 > content = updateIgnoredSettings(content, remoteSettingsSyncContent ? remoteSettingsSyncContent.settings : '{}', ignoredSettings, formatUtils);
249 > this.logService.trace(`${this.syncResourceLogLabel}: Updating remote settings...`);
250 > remoteUserData = await this.updateRemoteUserData(JSON.stringify(this.toSettingsSyncContent(content)), force ? null : remoteUserData.ref);
251 > this.logService.info(`${this.syncResourceLogLabel}: Updated remote settings`);
252 > }
253
254 // Delete the preview
315
316 private toSettingsSyncContent(settings: string): ISettingsSyncContent {
317 > return { settings }; settingsSync.ts
318 > }
319
320 private coreIgnoredSettings: Promise<string[]> | undefined = undefined;
src/vs/platform/userDataSync/common/settingsMerge.ts 5 introduced LOC · 2 ranges

Open complete file

24 let value: ReadonlyArray<string> = [];
25 if (settingsContent) {
26 > value = getIgnoredSettingsFromContent(settingsContent); settingsMerge.ts
27 } else {
28 value = getIgnoredSettingsFromConfig(configurationService);
53 }
54
55 > function getIgnoredSettingsFromContent(settingsContent: string): string[] { settingsMerge.ts
56 > const parsed = parse(settingsContent);
57 > return parsed ? parsed['settingsSync.ignoredSettings'] || parsed['sync.ignoredSettings'] || [] : [];
58 > }
59
60 export function removeComments(content: string, formattingOptions: FormattingOptions): string {