ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / platform / userDataSync / common / userDataSync.ts 667 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
import { distinct } from '../../../base/common/arrays.js' ;
import { VSBufferReadableStream } from '../../../base/common/buffer.js' ;
import { IStringDictionary } from '../../../base/common/collections.js' ;
import { Event } from '../../../base/common/event.js' ;
import { FormattingOptions } from '../../../base/common/jsonFormatter.js' ;
import { IJSONSchema } from '../../../base/common/jsonSchema.js' ;
import { IDisposable } from '../../../base/common/lifecycle.js' ;
import { IExtUri }
isObject isString
IHeaders
localize
allSettings ConfigurationScope Extensions ConfigurationExtensions IConfigurationRegistry IRegisteredConfigurationPropertySchema getAllConfigurationProperties parseScope
IEnvironmentService
IExtensionIdentifier
IExtensionManifest
createDecorator
Extensions JSONExtensions IJSONContributionRegistry
ILogService
Registry
StorageScope
IUserDataProfile UseDefaultProfileFlags
IUserDataSyncMachine
allSettings Registry ConfigurationExtensions Configuration
Object allSettings setting allSettings setting disallowSyncIgnore
excludeExtensions
allSettings Registry ConfigurationExtensions Configuration
ignoredSettings allSettings excludeExtensions
disallowedSettings
ignoredSettings disallowedSettings
manifest IExtensionManifest
manifest contributes configuration
configurations manifest contributes configuration manifest contributes configuration manifest contributes configuration
configurations length
properties configurations
properties
properties IStringDictionary IRegisteredConfigurationPropertySchema excludeExtensions
ignoredSettings
key properties
excludeExtensions properties key source
scope properties key scope properties key scope properties key scope
properties key ignoreSync
scope ConfigurationScope
scope ConfigurationScope
ignoredSettings key
ignoredSettings
keybindingsPerPlatform
ignoredExtensions
ignoredSettings
IDisposable
ignoredSettingsSchemaId
configurationRegistry Registry ConfigurationExtensions Configuration
configurationRegistry
id
order
title
type
properties
type
description
scope ConfigurationScope
tags
markdownDescription
items
type
pattern
errorMessage
ConfigurationScope
uniqueItems
disallowSyncIgnore
tags
description
ConfigurationScope
$ref ignoredSettingsSchemaId
additionalProperties
uniqueItems
disallowSyncIgnore
tags
jsonRegistry Registry JSONExtensions JSONContribution
disallowedIgnoredSettings
defaultIgnoredSettings
settings Object allSettings properties setting defaultIgnoredSettings setting
ignoredSettings defaultIgnoredSettings setting disallowedIgnoredSettings setting
ignoredSettingsSchema IJSONSchema
items
type
settings ignoredSettings setting
jsonRegistry ignoredSettingsSchemaId ignoredSettingsSchema
configurationRegistry
ref
content
id scopes
url
type UserDataSyncStoreType
defaultUrl
stableUrl
insidersUrl
canSwitch
authenticationProviders IAuthenticationProvider
thing thing IAuthenticationProvider
thing
thing
thing id
thing scopes
SyncResource
Settings
Keybindings
Snippets
Prompts
Tasks
Mcp
Extensions
GlobalState
Profiles
WorkspaceState
SyncResource SyncResource Settings SyncResource Keybindings SyncResource Snippets SyncResource Prompts SyncResource Tasks SyncResource Extensions SyncResource GlobalState SyncResource Profiles SyncResource Mcp
collection paths
collection collection paths paths
collection syncResource SyncResource environmentService IEnvironmentService extUri IExtUri
extUri environmentService userDataSyncHome collection syncResource
Record ServerResource
collectionId
latest IUserDataResourceManifest
latest IUserDataResourceManifest
session
ref
collections IUserDataCollectionManifest
thing thing IUserDataManifest
thing
thing session
thing ref
thing latest thing latest
thing collections thing collections
resources
resourceId created content
collections
collectionId
resources
resourceId created content
resources IStringDictionary IUserData
collections
collectionId
resources IStringDictionary IUserData
ref
created
SyncResource
IUserDataSyncStoreManagementService
_serviceBrand
onDidChangeUserDataSyncStore Event
userDataSyncStore IUserDataSyncStore
type UserDataSyncStoreType
IUserDataSyncStore
IUserDataSyncStoreService
_serviceBrand
onDidChangeDonotMakeRequestsUntil Event
donotMakeRequestsUntil Date
onTokenFailed Event UserDataSyncErrorCode
onTokenSucceed Event
token type
oldValue IUserDataManifest headers IHeaders IUserDataManifest
resource ServerResource oldValue IUserData collection headers IHeaders IUserData
resource ServerResource content ref collection headers IHeaders
resource ServerResource ref collection
resource ServerResource collection IResourceRefHandle
resource ServerResource ref collection headers IHeaders
headers IHeaders
headers IHeaders
collection headers IHeaders
headers IHeaders IUserDataSyncLatestData
VSBufferReadableStream
IUserDataSyncLocalStoreService
_serviceBrand
resource ServerResource content cTime Date collection root
resource ServerResource collection root IResourceRefHandle
resource ServerResource ref collection root
executionId IHeaders
headers IHeaders
headers executionId
headers
UserDataSyncErrorCode
Unauthorized
Forbidden
NotFound
MethodNotFound
Conflict
Gone
PreconditionFailed
TooLarge
UpgradeRequired
PreconditionRequired
TooManyRequests
TooManyRequestsAndRetryAfter
RequestFailed
RequestCanceled
RequestTimeout
RequestProtocolNotSupported
RequestPathNotEscaped
RequestHeadersNotObject
NoCollection
NoRef
EmptyResponse
TurnedOff
SessionExpired
ServiceChanged
DefaultServiceChanged
LocalTooManyProfiles
LocalTooManyRequests
LocalPreconditionFailed
LocalInvalidContent
LocalError
IncompatibleLocalContent
IncompatibleRemoteContent
Unknown
message
code UserDataSyncErrorCode
resource SyncResource
operationId
message
name
message url code UserDataSyncErrorCode serverCode operationId
message code operationId
message code UserDataSyncErrorCode
message code
UserDataSyncError
error Error UserDataSyncError
error
error
match error name
match match
syncResource match match SyncResource
operationId match match
error message UserDataSyncErrorCode match syncResource operationId
error message UserDataSyncErrorCode Unknown
id
collection
name
icon
useDefaultFlags UseDefaultProfileFlags
ILocalSyncExtension IRemoteSyncExtension
identifier IExtensionIdentifier
pinned
version
preRelease
disabled
installed
isApplicationScoped
state IStringDictionary
identifier IExtensionIdentifier
version
pinned
preRelease
disabled
installed
isApplicationScoped
state IStringDictionary
version
value
scope StorageScope
storage IStringDictionary IStorageValue
folders IWorkspaceStateFolder
storage IStringDictionary
version
resourceUri
workspaceFolderIdentity
SyncStatus
Uninitialized
Idle
Syncing
HasConflicts
created
uri
ref
syncData ISyncData
version
machineId
content
Change
None
Added
Modified
Deleted
MergeState
Preview
Conflict
Accepted
baseResource
remoteResource
localResource
previewResource
acceptedResource
localChange Change
remoteChange Change
mergeState MergeState
syncResource SyncResource
profile IUserDataProfile
conflicts IResourcePreview
isLastSyncFromCurrentMachine
resourcePreviews IResourcePreview
error UserDataSyncError
userData IUserData
resource SyncResource
status SyncStatus
onDidChangeStatus Event SyncStatus
conflicts IUserDataSyncResourceConflicts
onDidChangeConflicts Event IUserDataSyncResourceConflicts
onDidChangeLocal Event
refOrUserData IUserData preview userDataSyncConfiguration IUserDataSyncConfiguration headers IHeaders IUserDataSyncResourcePreview
resource content IUserDataSyncResourcePreview
force headers IHeaders IUserDataSyncResourcePreview
resource
content
resource SyncResource
IUserDataSyncEnablementService
_serviceBrand
onDidChangeEnablement Event
enabled
onDidChangeResourceEnablement Event SyncResource
resource SyncResource defaultValue
resource SyncResource enabled
resource SyncResource
resource SyncResource
manifest IUserDataManifest
id
IUserDataSyncService
_serviceBrand
status SyncStatus
onDidChangeStatus Event SyncStatus
conflicts IUserDataSyncResourceConflicts
onDidChangeConflicts Event IUserDataSyncResourceConflicts
onDidChangeLocal Event SyncResource
onSyncErrors Event IUserDataSyncResourceError
lastSyncTime
onDidChangeLastSyncTime Event
onDidResetRemote Event
onDidResetLocal Event
manifest IUserDataManifest disableCache IUserDataSyncTask
IUserDataManualSyncTask
resource
syncResource IUserDataSyncResource resource content apply force
syncResourceHandle ISyncResourceHandle
location
activityDataResource location
IUserDataSyncResourceProviderService
_serviceBrand
ISyncUserDataProfile
location ISyncUserDataProfile
syncResource SyncResource profile ISyncUserDataProfile ISyncResourceHandle
syncResource SyncResource profile ISyncUserDataProfile location ISyncResourceHandle
syncResourceHandle ISyncResourceHandle resource comparableResource
syncResourceHandle ISyncResourceHandle
location IUserDataSyncMachine
resource
syncResourceHandle ISyncResourceHandle IUserDataSyncResource
immediately skipIfSyncedRecently disableCache
IUserDataAutoSyncService
_serviceBrand
onError Event UserDataSyncError
everywhere
sources options SyncOptions
IUserDataSyncUtilService
_serviceBrand
userbindings IStringDictionary
resource FormattingOptions
IUserDataSyncLogService
key
localValue
remoteValue
from
'../../../base/common/resources.js'
;
import
{
,
}
from
'../../../base/common/types.js'
;
import
{
URI
}
from
'../../../base/common/uri.js'
;
import
{
}
from
'../../../base/parts/request/common/request.js'
;
import
{
}
from
'../../../nls.js'
;
import
{
,
,
as
,
,
,
,
}
from
'../../configuration/common/configurationRegistry.js'
;
import
{
}
from
'../../environment/common/environment.js'
;
import
{
EXTENSION_IDENTIFIER_PATTERN
,
}
from
'../../extensionManagement/common/extensionManagement.js'
;
import
{
}
from
'../../extensions/common/extensions.js'
;
import
{
}
from
'../../instantiation/common/instantiation.js'
;
import
{
as
,
}
from
'../../jsonschemas/common/jsonContributionRegistry.js'
;
import
{
}
from
'../../log/common/log.js'
;
import
{
}
from
'../../registry/common/platform.js'
;
import
{
}
from
'../../storage/common/storage.js'
;
import
{
,
}
from
'../../userDataProfile/common/userDataProfile.js'
;
import
{
}
from
'./userDataSyncMachines.js'
;
export
function
getDisallowedIgnoredSettings
(
)
:
string
[
]
{
const
=
.
as < IConfigurationRegistry>
(
.
)
.
getConfigurationProperties
(
)
;
return
.
keys
(
)
.
filter
(
=>
!
!
[
]
.
)
;
}
export
function
getDefaultIgnoredSettings
(
:
boolean
=
false
)
:
string
[
]
{
const
=
.
as < IConfigurationRegistry>
(
.
)
.
getConfigurationProperties
(
)
;
const
=
getIgnoredSettings
(
,
)
;
const
=
getDisallowedIgnoredSettings
(
)
;
return
distinct
(
[
...
,
...
]
)
;
}
export
function
getIgnoredSettingsForExtension
(
:
)
:
string
[
]
{
if
(
!
.
?.
)
{
return
[
]
;
}
const
=
Array
.
isArray
(
.
.
)
?
.
.
:
[
.
.
]
;
if
(
!
.
)
{
return
[
]
;
}
const
=
getAllConfigurationProperties
(
)
;
return
getIgnoredSettings
(
,
false
)
;
}
function
getIgnoredSettings
(
:
<
>
,
:
boolean
)
:
string
[
]
{
const
=
new
Set< string >
(
)
;
for
(
const
in
)
{
if
(
&&
!
!
[
]
.
)
{
continue
;
}
const
=
isString
(
[
]
.
)
?
parseScope
(
[
]
.
)
:
[
]
.
;
if
(
[
]
.
||
===
.
MACHINE
||
===
.
MACHINE_OVERRIDABLE
)
{
.
add
(
)
;
}
}
return
[
...
.
values
(
)
]
;
}
export
const
USER_DATA_SYNC_CONFIGURATION_SCOPE
=
'settingsSync'
;
export
interface
IUserDataSyncConfiguration
{
?
:
boolean
;
?
:
string
[
]
;
?
:
string
[
]
;
}
export
const
CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM
=
'settingsSync.keybindingsPerPlatform'
;
export
function
registerConfiguration
(
)
:
{
const
=
'vscode://schemas/ignoredSettings'
;
const
=
.
as < IConfigurationRegistry>
(
.
)
;
.
registerConfiguration
(
{
:
'settingsSync'
,
:
30
,
:
localize
(
'settings sync'
,
"Settings Sync"
)
,
:
'object'
,
:
{
[
CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM
]
:
{
:
'boolean'
,
:
localize
(
'settingsSync.keybindingsPerPlatform'
,
"Synchronize keybindings for each platform."
)
,
default
:
true
,
:
.
APPLICATION
,
:
[
'sync'
,
'usesOnlineServices'
]
}
,
'settingsSync.ignoredExtensions'
:
{
'type'
:
'array'
,
:
localize
(
'settingsSync.ignoredExtensions'
,
"List of extensions to be ignored while synchronizing. The identifier of an extension is always `${publisher}.${name}`. For example: `vscode.csharp`."
)
,
:
[
{
:
'string'
,
:
EXTENSION_IDENTIFIER_PATTERN
,
:
localize
(
'app.extension.identifier.errorMessage'
,
"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'."
)
}
]
,
'default'
:
[
]
,
'scope'
:
.
APPLICATION
,
:
true
,
:
true
,
:
[
'sync'
,
'usesOnlineServices'
]
}
,
'settingsSync.ignoredSettings'
:
{
'type'
:
'array'
,
:
localize
(
'settingsSync.ignoredSettings'
,
"Configure settings to be ignored while synchronizing."
)
,
'default'
:
[
]
,
'scope'
:
.
APPLICATION
,
:
,
:
true
,
:
true
,
:
true
,
:
[
'sync'
,
'usesOnlineServices'
]
}
}
}
)
;
const
=
.
as < IJSONContributionRegistry>
(
.
)
;
const
registerIgnoredSettingsSchema
=
(
)
=>
{
const
=
getDisallowedIgnoredSettings
(
)
;
const
=
getDefaultIgnoredSettings
(
)
;
const
=
.
keys
(
.
)
.
filter
(
=>
!
.
includes
(
)
)
;
const
=
.
filter
(
=>
!
.
includes
(
)
)
;
const
:
=
{
:
{
:
'string'
,
enum
:
[
...
,
...
.
map
(
=>
` - ${ setting} `
)
]
}
,
}
;
.
registerSchema
(
,
)
;
}
;
return
.
onDidUpdateConfiguration
(
(
)
=>
registerIgnoredSettingsSchema
(
)
)
;
}
export
const
NON_EXISTING_RESOURCE_REF
=
'0'
;
export
interface
IUserData
{
:
string
;
:
string
|
null
;
}
export
type
IAuthenticationProvider
=
{
:
string
;
:
string
[
]
}
;
export
interface
IUserDataSyncStore
{
readonly
:
URI
;
readonly
:
;
readonly
:
URI
;
readonly
:
URI
;
readonly
:
URI
;
readonly
:
boolean
;
readonly
:
[
]
;
}
export
function
isAuthenticationProvider
(
:
any
)
:
is
{
return
&&
isObject
(
)
&&
isString
(
.
)
&&
Array
.
isArray
(
.
)
;
}
export
const
enum
{
=
'settings'
,
=
'keybindings'
,
=
'snippets'
,
=
'prompts'
,
=
'tasks'
,
=
'mcp'
,
=
'extensions'
,
=
'globalState'
,
=
'profiles'
,
=
'workspaceState'
,
}
export
const
ALL_SYNC_RESOURCES
:
[
]
=
[
.
,
.
,
.
,
.
,
.
,
.
,
.
,
.
,
.
]
;
export
function
getPathSegments
(
:
string
|
undefined
,
...
:
string
[
]
)
:
string
[
]
{
return
?
[
,
...
]
:
;
}
export
function
getLastSyncResourceUri
(
:
string
|
undefined
,
:
,
:
,
:
)
:
URI
{
return
.
joinPath
(
.
,
...
getPathSegments
(
,
,
` lastSync ${ syncResource} .json `
)
)
;
}
export
type
IUserDataResourceManifest
=
<
,
string
>
;
export
interface
IUserDataCollectionManifest
{
[
:
string
]
:
{
readonly
?
:
;
}
;
}
export
interface
IUserDataManifest
{
readonly
?
:
;
readonly
:
string
;
readonly
:
string
;
readonly
?
:
;
}
export
function
isUserDataManifest
(
:
any
)
:
is
{
return
&&
isString
(
.
)
&&
isString
(
.
)
&&
(
isObject
(
.
)
||
.
===
undefined
)
&&
(
isObject
(
.
)
||
.
===
undefined
)
;
}
export
interface
IUserDataSyncActivityData
{
?
:
{
[
:
string
]
:
{
:
number
;
:
string
}
[
]
;
}
;
?
:
{
[
:
string
]
:
{
?
:
{
[
:
string
]
:
{
:
number
;
:
string
}
[
]
;
}
|
undefined
;
}
;
}
;
}
export
interface
IUserDataSyncLatestData
{
?
:
<
>
;
?
:
{
[
:
string
]
:
{
?
:
<
>
;
}
;
}
;
}
export
interface
IResourceRefHandle
{
:
string
;
:
number
;
}
export
type
ServerResource
=
|
'machines'
|
'editSessions'
|
'workspaceState'
;
export
type
UserDataSyncStoreType
=
'insiders'
|
'stable'
;
export
const
=
createDecorator < IUserDataSyncStoreManagementService>
(
'IUserDataSyncStoreManagementService'
)
;
export
interface
IUserDataSyncStoreManagementService
{
readonly
:
undefined
;
readonly
:
<
void
>
;
readonly
:
|
undefined
;
switch
(
:
)
:
Promise
<
void
>
;
getPreviousUserDataSyncStore
(
)
:
Promise
<
|
undefined
>
;
}
export
const
=
createDecorator < IUserDataSyncStoreService>
(
'IUserDataSyncStoreService'
)
;
export
interface
IUserDataSyncStoreService
{
readonly
:
undefined
;
readonly
:
<
void
>
;
readonly
:
|
undefined
;
readonly
:
<
>
;
readonly
:
<
void
>
;
setAuthToken
(
:
string
,
:
string
)
:
void
;
manifest
(
:
|
null
,
?
:
)
:
Promise
<
|
null
>
;
readResource
(
:
,
:
|
null
,
?
:
string
,
?
:
)
:
Promise
<
>
;
writeResource
(
:
,
:
string
,
:
string
|
null
,
?
:
string
,
?
:
)
:
Promise
<
string
>
;
deleteResource
(
:
,
:
string
|
null
,
?
:
string
)
:
Promise
<
void
>
;
getAllResourceRefs
(
:
,
?
:
string
)
:
Promise
<
[
]
>
;
resolveResourceContent
(
:
,
:
string
,
?
:
string
,
?
:
)
:
Promise
<
string
|
null
>
;
getAllCollections
(
?
:
)
:
Promise
<
string
[
]
>
;
createCollection
(
?
:
)
:
Promise
<
string
>
;
deleteCollection
(
?
:
string
,
?
:
)
:
Promise
<
void
>
;
getLatestData
(
?
:
)
:
Promise
<
|
null
>
;
getActivityData
(
)
:
Promise
<
>
;
clear
(
)
:
Promise
<
void
>
;
}
export
const
=
createDecorator < IUserDataSyncLocalStoreService>
(
'IUserDataSyncLocalStoreService'
)
;
export
interface
IUserDataSyncLocalStoreService
{
readonly
:
undefined
;
writeResource
(
:
,
:
string
,
:
,
?
:
string
,
?
:
URI
)
:
Promise
<
void
>
;
getAllResourceRefs
(
:
,
?
:
string
,
?
:
URI
)
:
Promise
<
[
]
>
;
resolveResourceContent
(
:
,
:
string
,
?
:
string
,
?
:
URI
)
:
Promise
<
string
|
null
>
;
}
export
const
HEADER_OPERATION_ID
=
'x-operation-id'
;
export
const
HEADER_EXECUTION_ID
=
'X-Execution-Id'
;
export
function
createSyncHeaders
(
:
string
)
:
{
const
:
=
{
}
;
[
HEADER_EXECUTION_ID
]
=
;
return
;
}
export
const
enum
{
=
'Unauthorized'
,
=
'Forbidden'
,
=
'NotFound'
,
=
'MethodNotFound'
,
=
'Conflict'
,
=
'Gone'
,
=
'PreconditionFailed'
,
=
'TooLarge'
,
=
'UpgradeRequired'
,
=
'PreconditionRequired'
,
=
'RemoteTooManyRequests'
,
=
'TooManyRequestsAndRetryAfter'
,
=
'RequestFailed'
,
=
'RequestCanceled'
,
=
'RequestTimeout'
,
=
'RequestProtocolNotSupported'
,
=
'RequestPathNotEscaped'
,
=
'RequestHeadersNotObject'
,
=
'NoCollection'
,
=
'NoRef'
,
=
'EmptyResponse'
,
=
'TurnedOff'
,
=
'SessionExpired'
,
=
'ServiceChanged'
,
=
'DefaultServiceChanged'
,
=
'LocalTooManyProfiles'
,
=
'LocalTooManyRequests'
,
=
'LocalPreconditionFailed'
,
=
'LocalInvalidContent'
,
=
'LocalError'
,
=
'IncompatibleLocalContent'
,
=
'IncompatibleRemoteContent'
,
=
'Unknown'
,
}
export
class
UserDataSyncError
extends
Error
{
constructor
(
:
string
,
readonly
:
,
readonly
?
:
,
readonly
?
:
string
)
{
super
(
)
;
this
.
=
` ${ this . code} (UserDataSyncError) syncResource: ${ this . resource || 'unknown' } operationId: ${ this . operationId || 'unknown' } `
;
}
}
export
class
UserDataSyncStoreError
extends
UserDataSyncError
{
constructor
(
:
string
,
readonly
:
string
,
:
,
readonly
:
number
|
undefined
,
:
string
|
undefined
)
{
super
(
,
,
undefined
,
)
;
}
}
export
class
UserDataAutoSyncError
extends
UserDataSyncError
{
constructor
(
:
string
,
:
)
{
super
(
,
)
;
}
}
export
namespace
{
export
function
toUserDataSyncError
(
:
)
:
{
if
(
instanceof
UserDataSyncError
)
{
return
;
}
const
=
/ ^ ( . + ) \( UserDataSyncError\) syncResource:( . + ) operationId:( . + ) $ /
.
exec
(
.
)
;
if
(
&&
[
1
]
)
{
const
=
[
2
]
===
'unknown'
?
undefined
:
[
2
]
as
;
const
=
[
3
]
===
'unknown'
?
undefined
:
[
3
]
;
return
new
UserDataSyncError
(
.
,
<
>
[
1
]
,
,
)
;
}
return
new
UserDataSyncError
(
.
,
.
)
;
}
}
export
interface
ISyncUserDataProfile
{
readonly
:
string
;
readonly
:
string
;
readonly
:
string
;
readonly
?
:
string
;
readonly
?
:
;
}
export
type
ISyncExtension
=
|
;
export
interface
ILocalSyncExtension
{
:
;
:
boolean
;
:
string
;
:
boolean
;
?
:
boolean
;
?
:
boolean
;
?
:
boolean
;
?
:
<
any
>
;
}
export
interface
IRemoteSyncExtension
{
:
;
:
string
;
?
:
boolean
;
?
:
boolean
;
?
:
boolean
;
?
:
boolean
;
?
:
boolean
;
?
:
<
any
>
;
}
export
interface
IStorageValue
{
:
number
;
:
string
;
?
:
;
}
export
interface
IGlobalState
{
:
<
>
;
}
export
interface
IWorkspaceState
{
:
[
]
;
:
<
string
>
;
:
number
;
}
export
interface
IWorkspaceStateFolder
{
:
string
;
:
string
;
}
export
const
enum
{
=
'uninitialized'
,
=
'idle'
,
=
'syncing'
,
=
'hasConflicts'
,
}
export
interface
ISyncResourceHandle
{
:
number
;
:
URI
;
}
export
interface
IRemoteUserData
{
:
string
;
:
|
null
;
}
export
interface
ISyncData
{
:
number
;
?
:
string
;
:
string
;
}
export
const
enum
{
,
,
,
,
}
export
const
enum
{
=
'preview'
,
=
'conflict'
,
=
'accepted'
,
}
export
interface
IResourcePreview
{
readonly
:
URI
;
readonly
:
URI
;
readonly
:
URI
;
readonly
:
URI
;
readonly
:
URI
;
readonly
:
;
readonly
:
;
readonly
:
;
}
export
interface
IUserDataSyncResource
{
readonly
:
;
readonly
:
;
}
export
interface
IUserDataSyncResourceConflicts
extends
IUserDataSyncResource
{
readonly
:
[
]
;
}
export
interface
IUserDataSyncResourcePreview
extends
IUserDataSyncResource
{
readonly
:
boolean
;
readonly
:
[
]
;
}
export
interface
IUserDataSyncResourceError
extends
IUserDataSyncResource
{
readonly
:
;
}
export
interface
IUserDataSyncResourceInitializer
{
initialize
(
:
)
:
Promise
<
void
>
;
}
export
interface
IUserDataSynchroniser
{
readonly
:
;
readonly
:
;
readonly
:
<
>
;
readonly
:
;
readonly
:
<
>
;
readonly
:
<
void
>
;
sync
(
:
string
|
|
null
,
:
boolean
,
:
,
:
)
:
Promise
<
|
null
>
;
accept
(
:
URI
,
?
:
string
|
null
)
:
Promise
<
|
null
>
;
apply
(
:
boolean
,
:
)
:
Promise
<
|
null
>
;
stop
(
)
:
Promise
<
void
>
;
hasPreviouslySynced
(
)
:
Promise
<
boolean
>
;
hasLocalData
(
)
:
Promise
<
boolean
>
;
resetLocal
(
)
:
Promise
<
void
>
;
resolveContent
(
:
URI
)
:
Promise
<
string
|
null
>
;
replace
(
:
string
)
:
Promise
<
boolean
>
;
}
export
const
SYNC_SERVICE_URL_TYPE
=
'sync.store.url.type'
;
export
function
getEnablementKey
(
:
)
{
return
` sync.enable. ${ resource} `
;
}
export
const
=
createDecorator < IUserDataSyncEnablementService>
(
'IUserDataSyncEnablementService'
)
;
export
interface
IUserDataSyncEnablementService
{
:
undefined
;
readonly
:
<
boolean
>
;
isEnabled
(
)
:
boolean
;
canToggleEnablement
(
)
:
boolean
;
setEnablement
(
:
boolean
)
:
void
;
readonly
:
<
[
,
boolean
]
>
;
isResourceEnabled
(
:
,
?
:
boolean
)
:
boolean
;
setResourceEnablement
(
:
,
:
boolean
)
:
void
;
getResourceSyncStateVersion
(
:
)
:
string
|
undefined
;
isResourceEnablementConfigured
(
:
)
:
boolean
;
}
export
interface
IUserDataSyncTask
{
readonly
:
|
null
;
run
(
)
:
Promise
<
void
>
;
stop
(
)
:
Promise
<
void
>
;
}
export
interface
IUserDataManualSyncTask
{
readonly
:
string
;
merge
(
)
:
Promise
<
void
>
;
apply
(
)
:
Promise
<
void
>
;
stop
(
)
:
Promise
<
void
>
;
}
export
const
=
createDecorator < IUserDataSyncService>
(
'IUserDataSyncService'
)
;
export
interface
IUserDataSyncService
{
:
undefined
;
readonly
:
;
readonly
:
<
>
;
readonly
:
[
]
;
readonly
:
<
[
]
>
;
readonly
:
<
>
;
readonly
:
<
[
]
>
;
readonly
:
number
|
undefined
;
readonly
:
<
number
>
;
readonly
:
<
void
>
;
readonly
:
<
void
>
;
createSyncTask
(
:
|
null
,
?
:
boolean
)
:
Promise
<
>
;
createManualSyncTask
(
)
:
Promise
<
>
;
resolveContent
(
:
URI
)
:
Promise
<
string
|
null
>
;
accept
(
:
,
:
URI
,
:
string
|
null
|
undefined
,
:
boolean
|
{
:
boolean
}
)
:
Promise
<
void
>
;
reset
(
)
:
Promise
<
void
>
;
resetRemote
(
)
:
Promise
<
void
>
;
cleanUpRemoteData
(
)
:
Promise
<
void
>
;
resetLocal
(
)
:
Promise
<
void
>
;
hasLocalData
(
)
:
Promise
<
boolean
>
;
hasPreviouslySynced
(
)
:
Promise
<
boolean
>
;
replace
(
:
)
:
Promise
<
void
>
;
saveRemoteActivityData
(
:
URI
)
:
Promise
<
void
>
;
extractActivityData
(
:
URI
,
:
URI
)
:
Promise
<
void
>
;
}
export
const
=
createDecorator < IUserDataSyncResourceProviderService>
(
'IUserDataSyncResourceProviderService'
)
;
export
interface
IUserDataSyncResourceProviderService
{
:
undefined
;
getRemoteSyncedProfiles
(
)
:
Promise
<
[
]
>
;
getLocalSyncedProfiles
(
?
:
URI
)
:
Promise
<
[
]
>
;
getRemoteSyncResourceHandles
(
:
,
?
:
)
:
Promise
<
[
]
>
;
getLocalSyncResourceHandles
(
:
,
?
:
,
?
:
URI
)
:
Promise
<
[
]
>
;
getAssociatedResources
(
:
)
:
Promise
<
{
:
URI
;
:
URI
}
[
]
>
;
getMachineId
(
:
)
:
Promise
<
string
|
undefined
>
;
getLocalSyncedMachines
(
?
:
URI
)
:
Promise
<
[
]
>
;
resolveContent
(
:
URI
)
:
Promise
<
string
|
null
>
;
resolveUserDataSyncResource
(
:
)
:
|
undefined
;
}
export
type
SyncOptions
=
{
?
:
boolean
;
?
:
boolean
;
?
:
boolean
}
;
export
const
=
createDecorator < IUserDataAutoSyncService>
(
'IUserDataAutoSyncService'
)
;
export
interface
IUserDataAutoSyncService
{
:
undefined
;
readonly
:
<
>
;
turnOn
(
)
:
Promise
<
void
>
;
turnOff
(
:
boolean
)
:
Promise
<
void
>
;
triggerSync
(
:
string
[
]
,
?
:
)
:
Promise
<
void
>
;
}
export
const
=
createDecorator < IUserDataSyncUtilService>
(
'IUserDataSyncUtilService'
)
;
export
interface
IUserDataSyncUtilService
{
readonly
:
undefined
;
resolveUserBindings
(
:
string
[
]
)
:
Promise
<
<
string
>>
;
resolveFormattingOptions
(
:
URI
)
:
Promise
<
>
;
resolveDefaultCoreIgnoredSettings
(
)
:
Promise
<
string
[
]
>
;
}
export
const
=
createDecorator < IUserDataSyncLogService>
(
'IUserDataSyncLogService'
)
;
export
interface
IUserDataSyncLogService
extends
ILogService
{
}
export
interface
IConflictSetting
{
:
string
;
:
any
|
undefined
;
:
any
|
undefined
;
}
export
const
USER_DATA_SYNC_LOG_ID
=
'userDataSync'
;
export
const
USER_DATA_SYNC_SCHEME
=
'vscode-userdata-sync'
;
export
const
PREVIEW_DIR_NAME
=
'preview'
;