@codingame/monaco-vscode-edit-sessions-service-override 5.2.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.js +22 -17
- package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessionsFileSystemProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.js +6 -5
- package/vscode/src/vs/workbench/contrib/editSessions/common/workspaceStateSync.js +7 -5
- package/vscode/src/vs/workbench/services/workspaces/common/editSessionIdentityService.js +1 -0
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceIdentityService.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-edit-sessions-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@6.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -2,6 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
4
4
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
5
|
+
import { ShutdownReason, LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
5
6
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
6
7
|
import { registerAction2, Action2, MenuRegistry, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
8
|
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
@@ -9,15 +10,17 @@ import { EDIT_SESSION_SYNC_CATEGORY, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_PEND
|
|
|
9
10
|
import { IEditSessionsStorageService, IEditSessionsLogService } from 'vscode/vscode/vs/workbench/contrib/editSessions/common/editSessions.service';
|
|
10
11
|
import { ISCMService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
11
12
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
13
|
+
import { WorkbenchState } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
12
14
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
13
15
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
14
16
|
import { basename, joinPath, relativePath } from 'vscode/vscode/vs/base/common/resources';
|
|
15
17
|
import { encodeBase64 } from 'vscode/vscode/vs/base/common/buffer';
|
|
16
18
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
19
|
+
import { ProgressLocation } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
17
20
|
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
|
|
18
21
|
import './editSessionsStorageService.js';
|
|
19
|
-
import
|
|
20
|
-
import { UserDataSyncStoreError } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
22
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
23
|
+
import { UserDataSyncStoreError, UserDataSyncErrorCode } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
21
24
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
22
25
|
import 'vscode/vscode/vs/platform/notification/common/notification';
|
|
23
26
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
@@ -39,8 +42,9 @@ import { IsWebContext } from 'vscode/vscode/vs/platform/contextkey/common/contex
|
|
|
39
42
|
import { isProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
40
43
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
41
44
|
import '../common/editSessionsLogService.js';
|
|
42
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
|
|
45
|
+
import { ViewContainerLocation, Extensions } from 'vscode/vscode/vs/workbench/common/views';
|
|
43
46
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
47
|
+
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
44
48
|
import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
45
49
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
46
50
|
import { EditSessionsDataViews } from './editSessionsViews.js';
|
|
@@ -54,6 +58,7 @@ import { IEditSessionIdentityService } from 'vscode/vscode/vs/platform/workspace
|
|
|
54
58
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
55
59
|
import { IOutputService } from 'vscode/vscode/vs/workbench/services/output/common/output.service';
|
|
56
60
|
import { sha1Hex } from '../../../../base/browser/hash.js';
|
|
61
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
57
62
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
58
63
|
import { NumberBadge } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
|
|
59
64
|
import { IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity.service';
|
|
@@ -100,14 +105,14 @@ registerAction2(class extends Action2 {
|
|
|
100
105
|
}
|
|
101
106
|
async run(accessor) {
|
|
102
107
|
const paneCompositePartService = accessor.get(IPaneCompositePartService);
|
|
103
|
-
const viewlet = await paneCompositePartService.openPaneComposite(VIEWLET_ID,
|
|
108
|
+
const viewlet = await paneCompositePartService.openPaneComposite(VIEWLET_ID, ViewContainerLocation.Sidebar, true);
|
|
104
109
|
const view = viewlet?.getViewPaneContainer();
|
|
105
110
|
view?.search('@tag:continueOn');
|
|
106
111
|
}
|
|
107
112
|
});
|
|
108
113
|
const resumeProgressOptionsTitle = `[${( localizeWithPath(_moduleId, 4, 'Resuming working changes...'))}](command:${showOutputChannelCommand.id})`;
|
|
109
114
|
const resumeProgressOptions = {
|
|
110
|
-
location:
|
|
115
|
+
location: ProgressLocation.Window,
|
|
111
116
|
type: 'syncing',
|
|
112
117
|
};
|
|
113
118
|
const queryParamName = 'editSessionId';
|
|
@@ -185,7 +190,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
185
190
|
this.registerContributedEditSessionOptions();
|
|
186
191
|
this._register(this.fileService.registerProvider(EditSessionsFileSystemProvider.SCHEMA, ( (new EditSessionsFileSystemProvider(this.editSessionsStorageService)))));
|
|
187
192
|
this.lifecycleService.onWillShutdown((e) => {
|
|
188
|
-
if (e.reason !==
|
|
193
|
+
if (e.reason !== ShutdownReason.RELOAD && this.editSessionsStorageService.isSignedIn && this.configurationService.getValue('workbench.experimental.cloudChanges.autoStore') === 'onShutdown' && !isWeb) {
|
|
189
194
|
e.join(this.autoStoreEditSession(), { id: 'autoStoreWorkingChanges', label: ( localizeWithPath(_moduleId, 5, 'Storing current working changes...')) });
|
|
190
195
|
}
|
|
191
196
|
});
|
|
@@ -203,7 +208,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
203
208
|
await this.progressService.withProgress(resumeProgressOptions, async (progress) => await this.resumeEditSession(undefined, true, undefined, undefined, progress));
|
|
204
209
|
}
|
|
205
210
|
else if (shouldAutoResumeOnReload) {
|
|
206
|
-
const hasApplicationLaunchedFromContinueOnFlow = this.storageService.getBoolean(EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY,
|
|
211
|
+
const hasApplicationLaunchedFromContinueOnFlow = this.storageService.getBoolean(EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, StorageScope.APPLICATION, false);
|
|
207
212
|
this.logService.info(`Prompting to enable cloud changes, has application previously launched from Continue On flow: ${hasApplicationLaunchedFromContinueOnFlow}`);
|
|
208
213
|
const handlePendingEditSessions = () => {
|
|
209
214
|
this.logService.info('Showing badge to enable cloud changes in accounts menu...');
|
|
@@ -213,14 +218,14 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
213
218
|
disposable.dispose();
|
|
214
219
|
this.logService.info('Showing badge to enable cloud changes in accounts menu succeeded, resuming cloud changes...');
|
|
215
220
|
await this.progressService.withProgress(resumeProgressOptions, async (progress) => await this.resumeEditSession(undefined, true, undefined, undefined, progress));
|
|
216
|
-
this.storageService.remove(EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY,
|
|
221
|
+
this.storageService.remove(EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, StorageScope.APPLICATION);
|
|
217
222
|
this.environmentService.continueOn = undefined;
|
|
218
223
|
});
|
|
219
224
|
};
|
|
220
225
|
if ((this.environmentService.continueOn !== undefined) &&
|
|
221
226
|
!this.editSessionsStorageService.isSignedIn &&
|
|
222
227
|
hasApplicationLaunchedFromContinueOnFlow === false) {
|
|
223
|
-
this.storageService.store(EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, true,
|
|
228
|
+
this.storageService.store(EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, true, StorageScope.APPLICATION, StorageTarget.MACHINE);
|
|
224
229
|
this.logService.info('Prompting to enable cloud changes...');
|
|
225
230
|
await this.editSessionsStorageService.initialize('read');
|
|
226
231
|
if (this.editSessionsStorageService.isSignedIn) {
|
|
@@ -250,7 +255,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
250
255
|
async autoStoreEditSession() {
|
|
251
256
|
const cancellationTokenSource = ( (new CancellationTokenSource()));
|
|
252
257
|
await this.progressService.withProgress({
|
|
253
|
-
location:
|
|
258
|
+
location: ProgressLocation.Window,
|
|
254
259
|
type: 'syncing',
|
|
255
260
|
title: ( localizeWithPath(_moduleId, 7, 'Storing working changes...'))
|
|
256
261
|
}, async () => this.storeEditSession(false, cancellationTokenSource.token), () => {
|
|
@@ -268,7 +273,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
268
273
|
))),
|
|
269
274
|
icon: EDIT_SESSIONS_VIEW_ICON,
|
|
270
275
|
hideIfEmpty: true
|
|
271
|
-
},
|
|
276
|
+
}, ViewContainerLocation.Sidebar, { doNotRegisterOpenCommand: true });
|
|
272
277
|
this._register(this.instantiationService.createInstance(EditSessionsDataViews, container));
|
|
273
278
|
}
|
|
274
279
|
registerActions() {
|
|
@@ -330,7 +335,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
330
335
|
const cancellationTokenSource = ( (new CancellationTokenSource()));
|
|
331
336
|
try {
|
|
332
337
|
ref = await that.progressService.withProgress({
|
|
333
|
-
location:
|
|
338
|
+
location: ProgressLocation.Notification,
|
|
334
339
|
cancellable: true,
|
|
335
340
|
type: 'syncing',
|
|
336
341
|
title: ( localizeWithPath(_moduleId, 9, 'Storing your working changes...'))
|
|
@@ -423,7 +428,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
423
428
|
async run(accessor) {
|
|
424
429
|
const cancellationTokenSource = ( (new CancellationTokenSource()));
|
|
425
430
|
await that.progressService.withProgress({
|
|
426
|
-
location:
|
|
431
|
+
location: ProgressLocation.Notification,
|
|
427
432
|
title: ( localizeWithPath(_moduleId, 13, 'Storing working changes...'))
|
|
428
433
|
}, async () => {
|
|
429
434
|
that.telemetryService.publicLog2('editSessions.store');
|
|
@@ -437,7 +442,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
437
442
|
}
|
|
438
443
|
async resumeEditSession(ref, silent, forceApplyUnrelatedChange, applyPartialMatch, progress, serializedData) {
|
|
439
444
|
await this.remoteAgentService.getEnvironment();
|
|
440
|
-
if (this.contextService.getWorkbenchState() ===
|
|
445
|
+
if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
|
|
441
446
|
return;
|
|
442
447
|
}
|
|
443
448
|
this.logService.info(ref !== undefined ? `Resuming changes from cloud with ref ${ref}...` : 'Checking for pending cloud changes...');
|
|
@@ -671,7 +676,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
671
676
|
this.logService.error(`Failed to store edit session, reason: `, ( (ex.toString())));
|
|
672
677
|
if (ex instanceof UserDataSyncStoreError) {
|
|
673
678
|
switch (ex.code) {
|
|
674
|
-
case
|
|
679
|
+
case UserDataSyncErrorCode.TooLarge:
|
|
675
680
|
this.telemetryService.publicLog2('editSessions.upload.failed', { reason: 'TooLarge' });
|
|
676
681
|
this.notificationService.error(( localizeWithPath(
|
|
677
682
|
_moduleId,
|
|
@@ -828,7 +833,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
828
833
|
}
|
|
829
834
|
async pickContinueEditSessionDestination() {
|
|
830
835
|
const quickPick = this.quickInputService.createQuickPick();
|
|
831
|
-
const workspaceContext = this.contextService.getWorkbenchState() ===
|
|
836
|
+
const workspaceContext = this.contextService.getWorkbenchState() === WorkbenchState.FOLDER
|
|
832
837
|
? this.contextService.getWorkspace().folders[0].name
|
|
833
838
|
: ( (this.contextService.getWorkspace().folders.map((folder) => folder.name))).join(', ');
|
|
834
839
|
quickPick.placeholder = ( localizeWithPath(
|
|
@@ -1005,7 +1010,7 @@ const continueEditSessionExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
1005
1010
|
}
|
|
1006
1011
|
});
|
|
1007
1012
|
const workbenchRegistry = ( (Registry.as(Extensions$1.Workbench)));
|
|
1008
|
-
workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution,
|
|
1013
|
+
workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution, LifecyclePhase.Restored);
|
|
1009
1014
|
( (Registry.as(Extensions$2.Configuration))).registerConfiguration({
|
|
1010
1015
|
...workbenchConfigurationNodeBase,
|
|
1011
1016
|
'properties': {
|
package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessionsFileSystemProvider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
-
import { FileSystemProviderErrorCode, FileType, FilePermission } from 'vscode/vscode/vs/platform/files/common/files';
|
|
4
|
+
import { FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, FilePermission } from 'vscode/vscode/vs/platform/files/common/files';
|
|
5
5
|
import { EDIT_SESSIONS_SCHEME, ChangeType, decodeEditSessionFileContent } from '../common/editSessions.js';
|
|
6
6
|
import { IEditSessionsStorageService } from 'vscode/vscode/vs/workbench/contrib/editSessions/common/editSessions.service';
|
|
7
7
|
import { NotSupportedError } from 'vscode/vscode/vs/base/common/errors';
|
|
@@ -10,7 +10,7 @@ let EditSessionsFileSystemProvider = class EditSessionsFileSystemProvider {
|
|
|
10
10
|
static { this.SCHEMA = EDIT_SESSIONS_SCHEME; }
|
|
11
11
|
constructor(editSessionsStorageService) {
|
|
12
12
|
this.editSessionsStorageService = editSessionsStorageService;
|
|
13
|
-
this.capabilities =
|
|
13
|
+
this.capabilities = FileSystemProviderCapabilities.Readonly + FileSystemProviderCapabilities.FileReadWrite;
|
|
14
14
|
this.onDidChangeCapabilities = Event.None;
|
|
15
15
|
this.onDidChangeFile = Event.None;
|
|
16
16
|
}
|
|
@@ -8,6 +8,7 @@ import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/commo
|
|
|
8
8
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
9
9
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
10
10
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
11
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
11
12
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
12
13
|
import { createSyncHeaders } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
13
14
|
import { IAuthenticationService } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication.service';
|
|
@@ -64,7 +65,7 @@ let EditSessionsWorkbenchService = class EditSessionsWorkbenchService extends Di
|
|
|
64
65
|
this._lastWrittenResources = ( (new Map()));
|
|
65
66
|
this._lastReadResources = ( (new Map()));
|
|
66
67
|
this._register(this.authenticationService.onDidChangeSessions((e) => this.onDidChangeSessions(e.event)));
|
|
67
|
-
this._register(this.storageService.onDidChangeValue(
|
|
68
|
+
this._register(this.storageService.onDidChangeValue(StorageScope.APPLICATION, EditSessionsWorkbenchService_1.CACHED_SESSION_STORAGE_KEY, this._register(( (new DisposableStore()))))(() => this.onDidChangeStorage()));
|
|
68
69
|
this.registerSignInAction();
|
|
69
70
|
this.registerResetAuthenticationAction();
|
|
70
71
|
this.signedInContext = EDIT_SESSIONS_SIGNED_IN.bindTo(this.contextKeyService);
|
|
@@ -227,7 +228,7 @@ let EditSessionsWorkbenchService = class EditSessionsWorkbenchService extends Di
|
|
|
227
228
|
return undefined;
|
|
228
229
|
}
|
|
229
230
|
shouldAttemptEditSessionInit() {
|
|
230
|
-
return isWeb && this.storageService.isNew(
|
|
231
|
+
return isWeb && this.storageService.isNew(StorageScope.APPLICATION) && this.storageService.isNew(StorageScope.WORKSPACE);
|
|
231
232
|
}
|
|
232
233
|
async getAccountPreference(reason) {
|
|
233
234
|
const quickpick = this.quickInputService.createQuickPick();
|
|
@@ -312,15 +313,15 @@ let EditSessionsWorkbenchService = class EditSessionsWorkbenchService extends Di
|
|
|
312
313
|
return configuredAuthenticationProviders.filter(({ id }) => ( (availableAuthenticationProviders.some(provider => provider.id === id))));
|
|
313
314
|
}
|
|
314
315
|
get existingSessionId() {
|
|
315
|
-
return this.storageService.get(EditSessionsWorkbenchService_1.CACHED_SESSION_STORAGE_KEY,
|
|
316
|
+
return this.storageService.get(EditSessionsWorkbenchService_1.CACHED_SESSION_STORAGE_KEY, StorageScope.APPLICATION);
|
|
316
317
|
}
|
|
317
318
|
set existingSessionId(sessionId) {
|
|
318
319
|
this.logService.trace(`Saving authentication session preference for ID ${sessionId}.`);
|
|
319
320
|
if (sessionId === undefined) {
|
|
320
|
-
this.storageService.remove(EditSessionsWorkbenchService_1.CACHED_SESSION_STORAGE_KEY,
|
|
321
|
+
this.storageService.remove(EditSessionsWorkbenchService_1.CACHED_SESSION_STORAGE_KEY, StorageScope.APPLICATION);
|
|
321
322
|
}
|
|
322
323
|
else {
|
|
323
|
-
this.storageService.store(EditSessionsWorkbenchService_1.CACHED_SESSION_STORAGE_KEY, sessionId,
|
|
324
|
+
this.storageService.store(EditSessionsWorkbenchService_1.CACHED_SESSION_STORAGE_KEY, sessionId, StorageScope.APPLICATION, StorageTarget.MACHINE);
|
|
324
325
|
}
|
|
325
326
|
}
|
|
326
327
|
async getExistingSession() {
|
|
@@ -5,10 +5,12 @@ import { stringify, parse } from 'vscode/vscode/vs/base/common/marshalling';
|
|
|
5
5
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
6
6
|
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
|
|
7
7
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
8
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
8
9
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
9
10
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
10
11
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
11
12
|
import { AbstractSynchroniser } from 'vscode/vscode/vs/platform/userDataSync/common/abstractSynchronizer';
|
|
13
|
+
import { SyncResource } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
12
14
|
import { IEditSessionsStorageService } from 'vscode/vscode/vs/workbench/contrib/editSessions/common/editSessions.service';
|
|
13
15
|
import { IWorkspaceIdentityService } from 'vscode/vscode/vs/workbench/services/workspaces/common/workspaceIdentityService.service';
|
|
14
16
|
|
|
@@ -41,7 +43,7 @@ let WorkspaceStateSynchroniser = class WorkspaceStateSynchroniser extends Abstra
|
|
|
41
43
|
constructor(profile, collection, userDataSyncStoreService, logService, fileService, environmentService, telemetryService, configurationService, storageService, uriIdentityService, workspaceIdentityService, editSessionsStorageService) {
|
|
42
44
|
const userDataSyncLocalStoreService = ( new NullBackupStoreService());
|
|
43
45
|
const userDataSyncEnablementService = ( new NullEnablementService());
|
|
44
|
-
super({ syncResource:
|
|
46
|
+
super({ syncResource: SyncResource.WorkspaceState, profile }, collection, fileService, environmentService, storageService, userDataSyncStoreService, userDataSyncLocalStoreService, userDataSyncEnablementService, telemetryService, logService, configurationService, uriIdentityService);
|
|
45
47
|
this.workspaceIdentityService = workspaceIdentityService;
|
|
46
48
|
this.editSessionsStorageService = editSessionsStorageService;
|
|
47
49
|
this.version = 1;
|
|
@@ -53,13 +55,13 @@ let WorkspaceStateSynchroniser = class WorkspaceStateSynchroniser extends Abstra
|
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
57
|
await this.storageService.flush();
|
|
56
|
-
const keys = ( this.storageService.keys(
|
|
58
|
+
const keys = ( this.storageService.keys(StorageScope.WORKSPACE, StorageTarget.USER));
|
|
57
59
|
if (!keys.length) {
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
60
62
|
const contributedData = {};
|
|
61
63
|
keys.forEach((key) => {
|
|
62
|
-
const data = this.storageService.get(key,
|
|
64
|
+
const data = this.storageService.get(key, StorageScope.WORKSPACE);
|
|
63
65
|
if (data) {
|
|
64
66
|
contributedData[key] = data;
|
|
65
67
|
}
|
|
@@ -95,10 +97,10 @@ let WorkspaceStateSynchroniser = class WorkspaceStateSynchroniser extends Abstra
|
|
|
95
97
|
try {
|
|
96
98
|
const value = parse(storage[key]);
|
|
97
99
|
replaceUris(value);
|
|
98
|
-
storageEntries.push({ key, value, scope:
|
|
100
|
+
storageEntries.push({ key, value, scope: StorageScope.WORKSPACE, target: StorageTarget.USER });
|
|
99
101
|
}
|
|
100
102
|
catch {
|
|
101
|
-
storageEntries.push({ key, value: storage[key], scope:
|
|
103
|
+
storageEntries.push({ key, value: storage[key], scope: StorageScope.WORKSPACE, target: StorageTarget.USER });
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
this.storageService.storeAll(storageEntries, true);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { insert } from 'vscode/vscode/vs/base/common/arrays';
|
|
3
3
|
import { toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
4
5
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
5
6
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
7
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
@@ -2,6 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
3
3
|
import { isEqualOrParent, relativePath, joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
4
4
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
5
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
5
6
|
import { EditSessionIdentityMatch } from 'vscode/vscode/vs/platform/workspace/common/editSessions';
|
|
6
7
|
import { IEditSessionIdentityService } from 'vscode/vscode/vs/platform/workspace/common/editSessions.service';
|
|
7
8
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|