settingsSync.ts ×13

Frontier kind: Code frontier

unlabeled · c_1c04e6ae4562

186 tests · 25131 LOC · 133 files · introduces 0 tests · 45 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges45 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3924 ranges25131 lines · 133 files · Browse complete extent
All tests (intent)
186 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: 45 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/userDataSync/common/settingsSync.ts 45 introduced LOC · 13 ranges

Open complete file

54
55 constructor(
56 > private readonly profile: IUserDataProfile, settingsSync.ts
57 > collection: string | undefined,
58 > @IFileService fileService: IFileService,
59 > @IEnvironmentService environmentService: IEnvironmentService,
60 > @IStorageService storageService: IStorageService,
61 > @IUserDataSyncStoreService userDataSyncStoreService: IUserDataSyncStoreService,
62 > @IUserDataSyncLocalStoreService userDataSyncLocalStoreService: IUserDataSyncLocalStoreService,
63 > @IUserDataSyncLogService logService: IUserDataSyncLogService,
64 > @IUserDataSyncUtilService userDataSyncUtilService: IUserDataSyncUtilService,
65 > @IConfigurationService configurationService: IConfigurationService,
66 > @IUserDataSyncEnablementService userDataSyncEnablementService: IUserDataSyncEnablementService,
67 > @ITelemetryService telemetryService: ITelemetryService,
68 > @IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
69 > @IUriIdentityService uriIdentityService: IUriIdentityService,
70 > ) {
71 > super(profile.settingsResource, { syncResource: SyncResource.Settings, profile }, collection, fileService, environmentService, storageService, userDataSyncStoreService, userDataSyncLocalStoreService, userDataSyncEnablementService, telemetryService, logService, userDataSyncUtilService, configurationService, uriIdentityService);
72 > }
73 >
74 > async getRemoteUserDataSyncConfiguration(refOrLatestData: string | IUserData | null): Promise<IUserDataSyncConfiguration> {
75 const lastSyncUserData = await this.getLastSyncUserData();
76 const remoteUserData = await this.getLatestRemoteUserData(refOrLatestData, lastSyncUserData);
82 return parser.configurationModel.getValue(USER_DATA_SYNC_CONFIGURATION_SCOPE) || {};
83 }
85 > protected async generateSyncPreview(remoteUserData: IRemoteUserData, lastSyncUserData: IRemoteUserData | null, isRemoteDataFromCurrentMachine: boolean): Promise<ISettingsResourcePreview[]> {
86 const fileContent = await this.getLocalFileContent();
87 const formattingOptions = await this.getFormattingOptions();
147 }];
148 }
150 > protected async hasRemoteChanged(lastSyncUserData: IRemoteUserData): Promise<boolean> {
151 const lastSettingsSyncContent: ISettingsSyncContent | null = this.getSettingsSyncContent(lastSyncUserData);
152 if (lastSettingsSyncContent === null) {
161 return result.remoteContent !== null;
162 }
164 > protected async getMergeResult(resourcePreview: ISettingsResourcePreview, token: CancellationToken): Promise<IMergeResult> {
165 const formatUtils = await this.getFormattingOptions();
166 const ignoredSettings = await this.getIgnoredSettings();
172 };
173 }
175 > protected async getAcceptResult(resourcePreview: ISettingsResourcePreview, resource: URI, content: string | null | undefined, token: CancellationToken): Promise<IAcceptResult> {
176
177 const formattingOptions = await this.getFormattingOptions();
218 throw new Error(`Invalid Resource: ${resource.toString()}`);
219 }
221 > protected async applyResult(remoteUserData: IRemoteUserData, lastSyncUserData: IRemoteUserData | null, resourcePreviews: [ISettingsResourcePreview, IAcceptResult][], force: boolean): Promise<void> {
222 const { fileContent } = resourcePreviews[0][0];
223 let { content, localChange, remoteChange } = resourcePreviews[0][1];
264
265 }
267 > async hasLocalData(): Promise<boolean> {
268 try {
269 const localFileContent = await this.getLocalFileContent();
278 return false;
279 }
281 > async resolveContent(uri: URI): Promise<string | null> {
282 if (this.extUri.isEqual(this.remoteResource, uri)
283 || this.extUri.isEqual(this.localResource, uri)
289 return null;
290 }
292 > protected override async resolvePreviewContent(resource: URI): Promise<string | null> {
293 let content = await super.resolvePreviewContent(resource);
294 if (content) {
300 return content;
301 }
303 > private getSettingsSyncContent(remoteUserData: IRemoteUserData): ISettingsSyncContent | null {
304 return remoteUserData.syncData ? this.parseSettingsSyncContent(remoteUserData.syncData.content) : null;
305 }
307 > private parseSettingsSyncContent(syncContent: string): ISettingsSyncContent | null {
308 try {
309 return parseSettingsSyncContent(syncContent);
313 return null;
314 }
316 > private toSettingsSyncContent(settings: string): ISettingsSyncContent {
317 return { settings };
318 }
320 > private coreIgnoredSettings: Promise<string[]> | undefined = undefined;
321 > private systemExtensionsIgnoredSettings: Promise<string[]> | undefined = undefined;
322 > private userExtensionsIgnoredSettings: Promise<string[]> | undefined = undefined;
323 private async getIgnoredSettings(content?: string): Promise<string[]> {
324 if (!this.coreIgnoredSettings) {