src/vs/platform/userDataSync/test/common/userDataSyncClient.ts

401 LOC · 390 covered · 11 uncovered · 90 ranges · 585 concepts · 32 introducers · 348 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

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 related-file, concept, and source links on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- abstractSynchronizer.ts ×49
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { bufferToStream, VSBuffer } from '../../../../base/common/buffer.js';
7 > import { CancellationToken } from '../../../../base/common/cancellation.js';
8 > import { IStringDictionary } from '../../../../base/common/collections.js';
9 > import { Emitter, Event } from '../../../../base/common/event.js';
10 > import { FormattingOptions } from '../../../../base/common/jsonFormatter.js';
11 > import { Disposable } from '../../../../base/common/lifecycle.js';
12 > import { Schemas } from '../../../../base/common/network.js';
13 > import { joinPath } from '../../../../base/common/resources.js';
14 > import { URI } from '../../../../base/common/uri.js';
15 > import { generateUuid } from '../../../../base/common/uuid.js';
16 > import { IHeaders, IRequestContext, IRequestOptions } from '../../../../base/parts/request/common/request.js';
17 > import { IConfigurationService } from '../../../configuration/common/configuration.js';
18 > import { ConfigurationService } from '../../../configuration/common/configurationService.js';
19 > import { IEnvironmentService } from '../../../environment/common/environment.js';
20 > import { GlobalExtensionEnablementService } from '../../../extensionManagement/common/extensionEnablementService.js';
21 > import { DidUninstallExtensionEvent, IExtensionGalleryService, IExtensionManagementService, IGlobalExtensionEnablementService, InstallExtensionResult } from '../../../extensionManagement/common/extensionManagement.js';
22 > import { IFileService } from '../../../files/common/files.js';
23 > import { FileService } from '../../../files/common/fileService.js';
24 > import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js';
25 > import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js';
26 > import { ILogService, NullLogService } from '../../../log/common/log.js';
27 > import product from '../../../product/common/product.js';
28 > import { IProductService } from '../../../product/common/productService.js';
29 > import { AuthInfo, Credentials, IRequestCompleteEvent, IRequestService } from '../../../request/common/request.js';
30 > import { InMemoryStorageService, IStorageService } from '../../../storage/common/storage.js';
31 > import { ITelemetryService } from '../../../telemetry/common/telemetry.js';
32 > import { NullTelemetryService } from '../../../telemetry/common/telemetryUtils.js';
33 > import { IUriIdentityService } from '../../../uriIdentity/common/uriIdentity.js';
34 > import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js';
35 > import { ExtensionStorageService, IExtensionStorageService } from '../../../extensionManagement/common/extensionStorage.js';
36 > import { IgnoredExtensionsManagementService, IIgnoredExtensionsManagementService } from '../../common/ignoredExtensions.js';
37 > import { ALL_SYNC_RESOURCES, getDefaultIgnoredSettings, IUserData, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, IUserDataSyncUtilService, registerConfiguration, ServerResource, SyncResource, IUserDataSynchroniser, IUserDataResourceManifest, IUserDataCollectionManifest, USER_DATA_SYNC_SCHEME, IUserDataManifest } from '../../common/userDataSync.js';
38 > import { IUserDataSyncAccountService, UserDataSyncAccountService } from '../../common/userDataSyncAccount.js';
39 > import { UserDataSyncLocalStoreService } from '../../common/userDataSyncLocalStoreService.js';
40 > import { IUserDataSyncMachinesService, UserDataSyncMachinesService } from '../../common/userDataSyncMachines.js';
41 > import { UserDataSyncEnablementService } from '../../common/userDataSyncEnablementService.js';
42 > import { UserDataSyncService } from '../../common/userDataSyncService.js';
43 > import { UserDataSyncStoreManagementService, UserDataSyncStoreService } from '../../common/userDataSyncStoreService.js';
44 > import { InMemoryUserDataProfilesService, IUserDataProfile, IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js';
45 > import { NullPolicyService } from '../../../policy/common/policy.js';
46 > import { IUserDataProfileStorageService } from '../../../userDataProfile/common/userDataProfileStorageService.js';
47 > import { TestUserDataProfileStorageService } from '../../../userDataProfile/test/common/userDataProfileStorageService.test.js';
48 > import { IMeteredConnectionService } from '../../../meteredConnection/common/meteredConnection.js';
49 >
50 > export class UserDataSyncClient extends Disposable {
51 >
52 > readonly instantiationService: TestInstantiationService;
53 >
54 > constructor(readonly testServer: UserDataSyncTestServer = new UserDataSyncTestServer()) {
56 > this.instantiationService = this._register(new TestInstantiationService());
57 > }
59 > async setUp(empty: boolean = false): Promise<void> {
60 > this._register(registerConfiguration()); userDataSyncStoreService.ts ×36
61 >
62 > const logService = this.instantiationService.stub(ILogService, new NullLogService());
63 >
64 > const userRoamingDataHome = URI.file('userdata').with({ scheme: Schemas.inMemory });
65 > const userDataSyncHome = joinPath(userRoamingDataHome, '.sync');
66 > const environmentService = this.instantiationService.stub(IEnvironmentService, {
67 > userDataSyncHome,
68 > userRoamingDataHome,
69 > cacheHome: joinPath(userRoamingDataHome, 'cache'),
70 > argvResource: joinPath(userRoamingDataHome, 'argv.json'),
71 > sync: 'on'
72 > });
73 >
74 > this.instantiationService.stub(IProductService, {
75 > _serviceBrand: undefined, ...product, ...{
76 > 'configurationSync.store': {
77 > url: this.testServer.url,
78 > stableUrl: this.testServer.url,
79 > insidersUrl: this.testServer.url,
80 > canSwitch: false,
81 > authenticationProviders: { 'test': { scopes: [] } }
82 > }
83 > }
84 > });
85 >
86 > const fileService = this._register(new FileService(logService));
87 > this._register(fileService.registerProvider(Schemas.inMemory, this._register(new InMemoryFileSystemProvider())));
88 > this._register(fileService.registerProvider(USER_DATA_SYNC_SCHEME, this._register(new InMemoryFileSystemProvider())));
89 > this.instantiationService.stub(IFileService, fileService);
90 >
91 > const uriIdentityService = this._register(this.instantiationService.createInstance(UriIdentityService));
92 > this.instantiationService.stub(IUriIdentityService, uriIdentityService);
93 >
94 > const userDataProfilesService = this._register(new InMemoryUserDataProfilesService(environmentService, fileService, uriIdentityService, logService));
95 > this.instantiationService.stub(IUserDataProfilesService, userDataProfilesService);
96 >
97 > const storageService = this._register(new TestStorageService(userDataProfilesService.defaultProfile));
98 > this.instantiationService.stub(IStorageService, this._register(storageService));
99 > this.instantiationService.stub(IUserDataProfileStorageService, this._register(new TestUserDataProfileStorageService(false, storageService)));
100 >
101 > const configurationService = this._register(new ConfigurationService(userDataProfilesService.defaultProfile.settingsResource, fileService, new NullPolicyService(), logService));
102 > await configurationService.initialize();
103 > this.instantiationService.stub(IConfigurationService, configurationService);
104 >
105 > this.instantiationService.stub(IMeteredConnectionService, { isConnectionMetered: false, onDidChangeIsConnectionMetered: new Emitter<boolean>().event });
106 >
107 > this.instantiationService.stub(IRequestService, this.testServer);
108 >
109 > this.instantiationService.stub(IUserDataSyncLogService, logService);
110 > this.instantiationService.stub(ITelemetryService, NullTelemetryService);
111 > this.instantiationService.stub(IUserDataSyncStoreManagementService, this._register(this.instantiationService.createInstance(UserDataSyncStoreManagementService)));
112 > this.instantiationService.stub(IUserDataSyncStoreService, this._register(this.instantiationService.createInstance(UserDataSyncStoreService)));
113 >
114 > const userDataSyncAccountService: IUserDataSyncAccountService = this._register(this.instantiationService.createInstance(UserDataSyncAccountService));
115 > await userDataSyncAccountService.updateAccount({ authenticationProviderId: 'authenticationProviderId', token: 'token' });
116 > this.instantiationService.stub(IUserDataSyncAccountService, userDataSyncAccountService);
117 >
118 > this.instantiationService.stub(IUserDataSyncMachinesService, this._register(this.instantiationService.createInstance(UserDataSyncMachinesService)));
119 > this.instantiationService.stub(IUserDataSyncLocalStoreService, this._register(this.instantiationService.createInstance(UserDataSyncLocalStoreService)));
120 > this.instantiationService.stub(IUserDataSyncUtilService, new TestUserDataSyncUtilService());
121 > this.instantiationService.stub(IUserDataSyncEnablementService, this._register(this.instantiationService.createInstance(UserDataSyncEnablementService)));
122 >
123 > this.instantiationService.stub(IExtensionManagementService, {
124 > async getInstalled() { return []; },
125 > onDidInstallExtensions: new Emitter<readonly InstallExtensionResult[]>().event,
126 > onDidUninstallExtension: new Emitter<DidUninstallExtensionEvent>().event,
127 > });
128 > this.instantiationService.stub(IGlobalExtensionEnablementService, this._register(this.instantiationService.createInstance(GlobalExtensionEnablementService)));
129 > this.instantiationService.stub(IExtensionStorageService, this._register(this.instantiationService.createInstance(ExtensionStorageService)));
130 > this.instantiationService.stub(IIgnoredExtensionsManagementService, this.instantiationService.createInstance(IgnoredExtensionsManagementService));
131 > this.instantiationService.stub(IExtensionGalleryService, {
132 > isEnabled() { return true; },
133 > async getCompatibleExtension() { return null; }
134 > });
135 >
136 > this.instantiationService.stub(IUserDataSyncService, this._register(this.instantiationService.createInstance(UserDataSyncService)));
137 >
138 > if (!empty) {
139 > await fileService.writeFile(userDataProfilesService.defaultProfile.settingsResource, VSBuffer.fromString(JSON.stringify({}))); userDataSyncClient.ts ×1
140 > await fileService.writeFile(userDataProfilesService.defaultProfile.keybindingsResource, VSBuffer.fromString(JSON.stringify([])));
141 > await fileService.writeFile(joinPath(userDataProfilesService.defaultProfile.snippetsHome, 'c.json'), VSBuffer.fromString(`{}`));
142 > await fileService.writeFile(joinPath(userDataProfilesService.defaultProfile.promptsHome, 'c.prompt.md'), VSBuffer.fromString(' '));
143 > await fileService.writeFile(userDataProfilesService.defaultProfile.tasksResource, VSBuffer.fromString(`{}`));
144 > await fileService.writeFile(environmentService.argvResource, VSBuffer.fromString(JSON.stringify({ 'locale': 'en' })));
145 > }
146 > await configurationService.reloadConfiguration(); userDataSyncStoreService.ts ×36
147 >
148 > // `prompts` resource is disabled by default, so enable it for tests
149 > this.instantiationService
150 > .get(IUserDataSyncEnablementService)
151 > .setResourceEnablement(SyncResource.Prompts, true);
152 > }
154 > async sync(): Promise<void> {
155 > await (await this.instantiationService.get(IUserDataSyncService).createSyncTask(null)).run(); userDataSyncClient.ts ×1
156 > }
158 > read(resource: SyncResource, collection?: string): Promise<IUserData> {
159 > return this.instantiationService.get(IUserDataSyncStoreService).readResource(resource, null, collection); userDataSyncClient.ts ×1
160 > }
162 > async getLatestRef(resource: SyncResource): Promise<string | null> {
163 > const manifest = await this._getResourceManifest(); userDataSyncClient.ts ×2
164 > return manifest?.[resource] ?? null;
165 > }
167 > async _getResourceManifest(): Promise<IUserDataResourceManifest | null> {
168 > const manifest = await this.instantiationService.get(IUserDataSyncStoreService).manifest(null); userDataSyncClient.ts ×2
169 > return manifest?.latest ?? null;
170 > }
172 > getSynchronizer(source: SyncResource): IUserDataSynchroniser {
173 > return (this.instantiationService.get(IUserDataSyncService) as UserDataSyncService).getOrCreateActiveProfileSynchronizer(this.instantiationService.get(IUserDataProfilesService).defaultProfile, undefined).enabled.find(s => s.resource === source)!; userDataSyncClient.ts ×1
174 > }
176 > }
177 >
178 > const ALL_SERVER_RESOURCES: ServerResource[] = [...ALL_SYNC_RESOURCES, 'machines'];
179 >
180 > export class UserDataSyncTestServer implements IRequestService {
181 >
182 > _serviceBrand: undefined;
183 >
184 > readonly onDidCompleteRequest = Event.None as Event<IRequestCompleteEvent>;
185 >
186 > readonly url: string = 'http://host:3000';
187 > private session: string | null = null;
188 > private readonly collections = new Map<string, Map<ServerResource, IUserData>>();
189 > private readonly data = new Map<ServerResource, IUserData>();
190 >
191 > private _requests: { url: string; type: string; headers?: IHeaders }[] = [];
192 > get requests(): { url: string; type: string; headers?: IHeaders }[] { return this._requests; }
193 >
194 > private _requestsWithAllHeaders: { url: string; type: string; headers?: IHeaders }[] = [];
195 > get requestsWithAllHeaders(): { url: string; type: string; headers?: IHeaders }[] { return this._requestsWithAllHeaders; }
196 >
197 > private _responses: { status: number }[] = [];
198 > get responses(): { status: number }[] { return this._responses; }
199 > reset(): void { this._requests = []; this._responses = []; this._requestsWithAllHeaders = []; }
200 >
201 > private manifestRef = 0;
202 > private collectionCounter = 0;
203 >
204 > constructor(private readonly rateLimit = Number.MAX_SAFE_INTEGER, private readonly retryAfter?: number) { }
205 >
206 > async resolveProxy(url: string): Promise<string | undefined> { return url; }
207 > async lookupAuthorization(authInfo: AuthInfo): Promise<Credentials | undefined> { return undefined; }
208 > async lookupKerberosAuthorization(url: string): Promise<string | undefined> { return undefined; }
209 > async loadCertificates(): Promise<string[]> { return []; }
210 >
211 > async request(options: IRequestOptions, token: CancellationToken): Promise<IRequestContext> {
212 > if (this._requests.length === this.rateLimit) { userDataSyncStoreService.ts ×36
213 > return this.toResponse(429, this.retryAfter ? { 'retry-after': `${this.retryAfter}` } : undefined); userDataSyncStoreService.ts ×3
214 > }
215 > const headers: IHeaders = {}; userDataSyncStoreService.ts ×36
216 > if (options.headers) {
217 > if (options.headers['If-None-Match']) {
218 > headers['If-None-Match'] = options.headers['If-None-Match']; userDataSyncClient.ts ×1
219 > }
220 > if (options.headers['If-Match']) { userDataSyncStoreService.ts ×36
221 > headers['If-Match'] = options.headers['If-Match']; abstractSynchronizer.ts ×2
222 > }
224 > this._requests.push({ url: options.url!, type: options.type!, headers });
225 > this._requestsWithAllHeaders.push({ url: options.url!, type: options.type!, headers: options.headers });
226 > const requestContext = await this.doRequest(options);
227 > this._responses.push({ status: requestContext.res.statusCode! });
228 > return requestContext;
229 > }
231 > private async doRequest(options: IRequestOptions): Promise<IRequestContext> {
232 > const versionUrl = `${this.url}/v1/`; userDataSyncStoreService.ts ×36
233 > const relativePath = options.url!.indexOf(versionUrl) === 0 ? options.url!.substring(versionUrl.length) : undefined;
234 > const segments = relativePath ? relativePath.split('/') : [];
235 > if (options.type === 'GET' && segments.length === 1 && segments[0] === 'manifest') {
236 > return this.getManifest(options.headers); userDataSyncStoreService.ts ×10
237 > }
238 > if (options.type === 'GET' && segments.length === 3 && segments[0] === 'resource') { userDataSyncStoreService.ts ×36
239 > return this.getResourceData(undefined, segments[1], segments[2] === 'latest' ? undefined : segments[2], options.headers); userDataSyncClient.ts ×5
240 > }
241 > if (options.type === 'POST' && segments.length === 2 && segments[0] === 'resource') { userDataSyncStoreService.ts ×36
242 > return this.writeData(undefined, segments[1], options.data, options.headers); userDataSyncClient.ts ×5
243 > }
244 > // resources in collection userDataSyncClient.ts ×1
245 > if (options.type === 'GET' && segments.length === 5 && segments[0] === 'collection' && segments[2] === 'resource') { userDataSyncStoreService.ts ×36
246 > return this.getResourceData(segments[1], segments[3], segments[4] === 'latest' ? undefined : segments[4], options.headers); userDataSyncClient.ts ×2
247 > }
248 > if (options.type === 'POST' && segments.length === 4 && segments[0] === 'collection' && segments[2] === 'resource') { userDataSyncStoreService.ts ×36
249 > return this.writeData(segments[1], segments[3], options.data, options.headers); userDataSyncClient.ts ×2
250 > }
251 > if (options.type === 'DELETE' && segments.length === 2 && segments[0] === 'resource') { userDataSyncStoreService.ts ×36
252 > return this.deleteResourceData(undefined, segments[1]); userDataSyncClient.ts ×4
253 > }
254 > if (options.type === 'DELETE' && segments.length === 1 && segments[0] === 'resource') { userDataSyncStoreService.ts ×36
255 > return this.clear(options.headers); userDataSyncStoreService.ts ×6
256 > }
257 > if (options.type === 'DELETE' && segments[0] === 'collection') { userDataSyncStoreService.ts ×36
258 > return this.toResponse(204); userDataSyncStoreService.ts ×6
259 > }
260 > if (options.type === 'POST' && segments.length === 1 && segments[0] === 'collection') { userDataSyncStoreService.ts ×36
261 > return this.createCollection(); userDataProfilesManifestSync.ts ×14
262 > }
263 return this.toResponse(501);
266 > private async getManifest(headers?: IHeaders): Promise<IRequestContext> {
267 > if (this.session) { userDataSyncStoreService.ts ×10
268 > const latest: Record<ServerResource, string> = Object.create({}); userDataSyncStoreService.ts ×2
269 > this.data.forEach((value, key) => latest[key] = value.ref);
270 > let collections: IUserDataCollectionManifest | undefined = undefined;
271 > if (this.collectionCounter) {
272 > collections = {}; userDataProfilesManifestSync.ts ×4
273 > for (let collectionId = 1; collectionId <= this.collectionCounter; collectionId++) {
274 > const collectionData = this.collections.get(`${collectionId}`);
275 > if (collectionData) {
276 > const latest: Record<ServerResource, string> = Object.create({});
277 > collectionData.forEach((value, key) => latest[key] = value.ref);
278 > collections[`${collectionId}`] = { latest };
279 > }
280 > }
281 > }
282 > const manifest: IUserDataManifest = { session: this.session, latest, collections, ref: '1' }; userDataSyncStoreService.ts ×2
283 > return this.toResponse(200, { 'Content-Type': 'application/json', etag: `${this.manifestRef++}` }, JSON.stringify(manifest));
284 > }
285 > return this.toResponse(204, { etag: `${this.manifestRef++}` }); userDataSyncStoreService.ts ×10
286 > }
288 > private async getResourceData(collection: string | undefined, resource: string, ref?: string, headers: IHeaders = {}): Promise<IRequestContext> {
289 > const collectionData = collection ? this.collections.get(collection) : this.data; userDataSyncClient.ts ×5
290 > if (!collectionData) {
291 return this.toResponse(501);
292 }
294 > const resourceKey = ALL_SERVER_RESOURCES.find(key => key === resource);
295 > if (resourceKey) {
296 > const data = collectionData.get(resourceKey);
297 > if (ref && data?.ref !== ref) {
298 > return this.toResponse(404); abstractSynchronizer.ts ×3
299 > }
300 > if (!data) { userDataSyncClient.ts ×1
301 > return this.toResponse(204, { etag: '0' }); userDataSyncClient.ts ×1
302 > }
303 > if (headers['If-None-Match'] === data.ref) { userDataSyncClient.ts ×1
304 > return this.toResponse(304); userDataSyncStoreService.ts ×1
305 > }
306 > return this.toResponse(200, { etag: data.ref }, data.content || ''); userDataSyncClient.ts ×5
307 > }
308 return this.toResponse(204);
311 > private async writeData(collection: string | undefined, resource: string, content: string = '', headers: IHeaders = {}): Promise<IRequestContext> {
312 > if (!this.session) { userDataSyncClient.ts ×5
313 > this.session = generateUuid();
314 > }
315 > const collectionData = collection ? this.collections.get(collection) : this.data;
316 > if (!collectionData) {
317 return this.toResponse(501);
318 }
319 > const resourceKey = ALL_SERVER_RESOURCES.find(key => key === resource); userDataSyncClient.ts ×5
320 > if (resourceKey) {
321 > const data = collectionData.get(resourceKey);
322 > if (headers['If-Match'] !== undefined && headers['If-Match'] !== (data ? data.ref : '0')) {
323 > return this.toResponse(412); abstractSynchronizer.ts ×1
324 > }
325 > const ref = `${parseInt(data?.ref || '0') + 1}`; userDataSyncClient.ts ×5
326 > collectionData.set(resourceKey, { ref, content });
327 > return this.toResponse(200, { etag: ref });
328 > }
329 return this.toResponse(204);
332 > private async deleteResourceData(collection: string | undefined, resource: string, headers: IHeaders = {}): Promise<IRequestContext> {
333 > const collectionData = collection ? this.collections.get(collection) : this.data; userDataSyncClient.ts ×4
334 > if (!collectionData) {
335 return this.toResponse(501);
336 }
338 > const resourceKey = ALL_SERVER_RESOURCES.find(key => key === resource);
339 > if (resourceKey) {
340 > collectionData.delete(resourceKey);
341 > return this.toResponse(200);
342 > }
343
344 return this.toResponse(404);
347 > private async createCollection(): Promise<IRequestContext> {
348 > const collectionId = `${++this.collectionCounter}`; userDataProfilesManifestSync.ts ×14
349 > this.collections.set(collectionId, new Map());
350 > return this.toResponse(200, {}, collectionId);
351 > }
353 > async clear(headers?: IHeaders): Promise<IRequestContext> {
354 > this.collections.clear(); userDataSyncStoreService.ts ×1
355 > this.data.clear();
356 > this.session = null;
357 > this.collectionCounter = 0;
358 > return this.toResponse(204);
359 > }
361 > private toResponse(statusCode: number, headers?: IHeaders, data?: string): IRequestContext {
363 > res: {
364 > headers: headers || {},
365 > statusCode
366 > },
367 > stream: bufferToStream(VSBuffer.fromString(data || ''))
368 > };
369 > }
371 >
372 > export class TestUserDataSyncUtilService implements IUserDataSyncUtilService {
373 >
374 > _serviceBrand: undefined;
375 >
376 > async resolveDefaultCoreIgnoredSettings(): Promise<string[]> {
377 > return getDefaultIgnoredSettings(); settingsSync.ts ×10
378 > }
380 > async resolveUserBindings(userbindings: string[]): Promise<IStringDictionary<string>> {
381 > const keys: IStringDictionary<string> = {}; keybindingsMerge.ts ×12
382 > for (const keybinding of userbindings) {
383 > keys[keybinding] = keybinding; keybindingsMerge.ts ×1
384 > }
385 > return keys; keybindingsMerge.ts ×12
386 > }
388 > async resolveFormattingOptions(file?: URI): Promise<FormattingOptions> {
389 > return { eol: '\n', insertSpaces: false, tabSize: 4 }; userDataSyncClient.ts ×1
390 > }
392 > }
393 >
394 > class TestStorageService extends InMemoryStorageService {
395 > constructor(private readonly profileStorageProfile: IUserDataProfile) {
397 > }
398 > override hasScope(profile: IUserDataProfile): boolean { abstractSynchronizer.ts ×49
399 > return this.profileStorageProfile.id === profile.id; globalStateSync.ts ×15
400 > }