@codingame/monaco-vscode-user-data-profile-service-override 6.0.2 → 7.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/userDataProfile.js +4 -2
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.js +41 -20
- package/vscode/src/vs/platform/userDataSync/common/extensionsSync.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +193 -87
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +349 -253
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +452 -125
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +24 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +190 -92
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +5 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.js +1 -1
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js +50 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-user-data-profile-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.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@7.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/userDataProfile.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
3
|
-
import { IUserDataSyncStoreManagementService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync.service';
|
|
3
|
+
import { IUserDataSyncStoreManagementService, IUserDataSyncUtilService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync.service';
|
|
4
4
|
import { BrowserUserDataProfilesService } from './vscode/src/vs/platform/userDataProfile/browser/userDataProfile.js';
|
|
5
5
|
import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
6
6
|
import { UserDataInitializationService } from './vscode/src/vs/workbench/services/userData/browser/userDataInit.js';
|
|
@@ -24,6 +24,7 @@ import { UserDataProfileManagementService } from './vscode/src/vs/workbench/serv
|
|
|
24
24
|
import { IUserDataProfileStorageService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfileStorageService.service';
|
|
25
25
|
import { UserDataProfileStorageService } from './vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.js';
|
|
26
26
|
import { UserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfileService';
|
|
27
|
+
import { UserDataSyncUtilService } from './vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js';
|
|
27
28
|
import { registerServiceInitializePostParticipant } from 'vscode/lifecycle';
|
|
28
29
|
import { getWorkspaceIdentifier } from 'vscode/workbench';
|
|
29
30
|
import './vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.js';
|
|
@@ -111,7 +112,8 @@ function getServiceOverride() {
|
|
|
111
112
|
[( IUserDataInitializationService.toString())]: new SyncDescriptor(InjectedUserDataInitializationService, [], true),
|
|
112
113
|
[( IUserDataProfileImportExportService.toString())]: new SyncDescriptor(UserDataProfileImportExportService, [], true),
|
|
113
114
|
[( IUserDataProfileManagementService.toString())]: new SyncDescriptor(UserDataProfileManagementService, [], true),
|
|
114
|
-
[( IUserDataProfileStorageService.toString())]: new SyncDescriptor(UserDataProfileStorageService, [], true)
|
|
115
|
+
[( IUserDataProfileStorageService.toString())]: new SyncDescriptor(UserDataProfileStorageService, [], true),
|
|
116
|
+
[( IUserDataSyncUtilService.toString())]: new SyncDescriptor(UserDataSyncUtilService, [], true)
|
|
115
117
|
};
|
|
116
118
|
}
|
|
117
119
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { Disposable, isDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
|
+
import { Disposable, DisposableMap, toDisposable, isDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { Storage } from 'vscode/vscode/vs/base/parts/storage/common/storage';
|
|
4
4
|
import { StorageScope, StorageTarget, AbstractStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
5
5
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
@@ -7,9 +7,12 @@ import 'vscode/vscode/vs/base/common/event';
|
|
|
7
7
|
import 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
8
8
|
|
|
9
9
|
let AbstractUserDataProfileStorageService = class AbstractUserDataProfileStorageService extends Disposable {
|
|
10
|
-
constructor(storageService) {
|
|
10
|
+
constructor(persistStorages, storageService) {
|
|
11
11
|
super();
|
|
12
12
|
this.storageService = storageService;
|
|
13
|
+
if (persistStorages) {
|
|
14
|
+
this.storageServicesMap = this._register(( new DisposableMap()));
|
|
15
|
+
}
|
|
13
16
|
}
|
|
14
17
|
async readStorageData(profile) {
|
|
15
18
|
return this.withProfileScopedStorageService(profile, async (storageService) => this.getItems(storageService));
|
|
@@ -21,17 +24,32 @@ let AbstractUserDataProfileStorageService = class AbstractUserDataProfileStorage
|
|
|
21
24
|
if (this.storageService.hasScope(profile)) {
|
|
22
25
|
return fn(this.storageService);
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
let storageService = this.storageServicesMap?.get(profile.id);
|
|
28
|
+
if (!storageService) {
|
|
29
|
+
storageService = ( new StorageService(this.createStorageDatabase(profile)));
|
|
30
|
+
this.storageServicesMap?.set(profile.id, storageService);
|
|
31
|
+
try {
|
|
32
|
+
await storageService.initialize();
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (this.storageServicesMap?.has(profile.id)) {
|
|
36
|
+
this.storageServicesMap.deleteAndDispose(profile.id);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
storageService.dispose();
|
|
40
|
+
}
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
26
44
|
try {
|
|
27
|
-
await storageService.initialize();
|
|
28
45
|
const result = await fn(storageService);
|
|
29
46
|
await storageService.flush();
|
|
30
47
|
return result;
|
|
31
48
|
}
|
|
32
49
|
finally {
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
if (!this.storageServicesMap?.has(profile.id)) {
|
|
51
|
+
storageService.dispose();
|
|
52
|
+
}
|
|
35
53
|
}
|
|
36
54
|
}
|
|
37
55
|
getItems(storageService) {
|
|
@@ -48,26 +66,29 @@ let AbstractUserDataProfileStorageService = class AbstractUserDataProfileStorage
|
|
|
48
66
|
writeItems(storageService, items, target) {
|
|
49
67
|
storageService.storeAll(( Array.from(items.entries()).map(([key, value]) => ({ key, value, scope: StorageScope.PROFILE, target }))), true);
|
|
50
68
|
}
|
|
51
|
-
async closeAndDispose(storageDatabase) {
|
|
52
|
-
try {
|
|
53
|
-
await storageDatabase.close();
|
|
54
|
-
}
|
|
55
|
-
finally {
|
|
56
|
-
if (isDisposable(storageDatabase)) {
|
|
57
|
-
storageDatabase.dispose();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
69
|
};
|
|
62
70
|
AbstractUserDataProfileStorageService = ( __decorate([
|
|
63
|
-
( __param(
|
|
71
|
+
( __param(1, IStorageService))
|
|
64
72
|
], AbstractUserDataProfileStorageService));
|
|
65
73
|
class StorageService extends AbstractStorageService {
|
|
66
74
|
constructor(profileStorageDatabase) {
|
|
67
75
|
super({ flushInterval: 100 });
|
|
68
|
-
this.
|
|
76
|
+
this.profileStorageDatabase = profileStorageDatabase;
|
|
69
77
|
}
|
|
70
|
-
doInitialize() {
|
|
78
|
+
async doInitialize() {
|
|
79
|
+
const profileStorageDatabase = await this.profileStorageDatabase;
|
|
80
|
+
const profileStorage = ( new Storage(profileStorageDatabase));
|
|
81
|
+
this._register(profileStorage.onDidChangeStorage(e => {
|
|
82
|
+
this.emitDidChangeValue(StorageScope.PROFILE, e);
|
|
83
|
+
}));
|
|
84
|
+
this._register(toDisposable(() => {
|
|
85
|
+
profileStorage.close();
|
|
86
|
+
profileStorage.dispose();
|
|
87
|
+
if (isDisposable(profileStorageDatabase)) {
|
|
88
|
+
profileStorageDatabase.dispose();
|
|
89
|
+
}
|
|
90
|
+
}));
|
|
91
|
+
this.profileStorage = profileStorage;
|
|
71
92
|
return this.profileStorage.init();
|
|
72
93
|
}
|
|
73
94
|
getStorage(scope) {
|
|
@@ -443,7 +443,7 @@ let LocalExtensionsProvider = class LocalExtensionsProvider {
|
|
|
443
443
|
addToSkipped.push(e);
|
|
444
444
|
this.logService.info(`${syncResourceLogLabel}: Skipped synchronizing extension`, gallery.displayName || gallery.identifier.id);
|
|
445
445
|
}
|
|
446
|
-
if (error instanceof ExtensionManagementError && [ExtensionManagementErrorCode.Incompatible, ExtensionManagementErrorCode.IncompatibleTargetPlatform].includes(error.code)) {
|
|
446
|
+
if (error instanceof ExtensionManagementError && [ExtensionManagementErrorCode.Incompatible, ExtensionManagementErrorCode.IncompatibleApi, ExtensionManagementErrorCode.IncompatibleTargetPlatform].includes(error.code)) {
|
|
447
447
|
this.logService.info(`${syncResourceLogLabel}: Skipped synchronizing extension because the compatible extension is not found.`, gallery.displayName || gallery.identifier.id);
|
|
448
448
|
}
|
|
449
449
|
else if (error) {
|
package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import n from 'vscode/external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
2
|
|
|
3
|
-
var css = ".profiles-editor{height:100%;margin:20px auto 0;max-width:1000px;overflow:hidden}.profiles-editor .contents-view,.profiles-editor .sidebar-view{height:100%}.profiles-editor .
|
|
3
|
+
var css = ".profiles-editor{height:100%;margin:20px auto 0;max-width:1000px;overflow:hidden}.profiles-editor .contents-view,.profiles-editor .sidebar-view{height:100%}.profiles-editor .monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before,.profiles-editor .monaco-split-view2>.sash-container{top:55px}.profiles-editor .contents-container{height:100%;padding:0 20px}.profiles-editor .sidebar-container{height:100%;padding-left:20px}.profiles-editor .sidebar-container .new-profile-button{align-items:center;display:flex;height:40px;padding:0 20px 0 18px}.profiles-editor .sidebar-container .new-profile-button>.monaco-button-dropdown{flex-grow:1}.profiles-editor .monaco-button-dropdown>.monaco-dropdown-button{align-items:center;display:flex;padding:0 4px}.profiles-editor .monaco-list-row .profile-tree-item-actions-container{display:none}.profiles-editor .monaco-list-row.focused .profile-tree-item-actions-container,.profiles-editor .monaco-list-row.selected .profile-tree-item-actions-container,.profiles-editor .monaco-list-row:hover .profile-tree-item-actions-container{align-items:center;display:flex}.profiles-editor .sidebar-container .profiles-list{margin-top:15px}.profiles-editor .sidebar-container .profiles-list .profile-list-item{align-items:center;display:flex;padding-left:20px}.profiles-editor .sidebar-container .profiles-list .profile-list-item>*{margin-right:5px}.profiles-editor .sidebar-container .profiles-list .profile-list-item>.profile-list-item-label.new-profile{font-style:italic}.profiles-editor .sidebar-container .profiles-list .profile-list-item>.profile-list-item-description{align-items:center;display:flex;font-size:.9em;margin-left:2px;opacity:.7}.profiles-editor .sidebar-container .profiles-list .profile-list-item .profile-tree-item-actions-container{flex:1;justify-content:flex-end;margin-right:10px}.profiles-editor .hide{display:none!important}.profiles-editor .contents-container .profile-header{align-items:center;display:flex;height:40px}.profiles-editor .contents-container .profile-header .profile-title-container{align-items:center;display:flex;flex:1;font-size:medium}.profiles-editor .contents-container .profile-title-container .codicon{border-radius:5px;cursor:pointer;font-size:large;margin-right:8px;padding:4px}.profiles-editor .contents-container .profile-title-container .codicon.disabled{cursor:default}.profiles-editor .contents-container .profile-title-container .codicon:not(.disabled):hover{background-color:var(--vscode-toolbar-hoverBackground);outline:1px dashed var(--vscode-toolbar-hoverOutline)}.profiles-editor .contents-container .profile-title-container .monaco-inputbox{flex:1;margin-right:10px}.profiles-editor .contents-container .profile-header .profile-button-container{align-items:center;display:flex}.profiles-editor .contents-container .profile-header .profile-button-container .monaco-button{margin-left:4px}.profiles-editor .contents-container .profile-header .profile-actions-container{display:flex}.profiles-editor .contents-container .profile-header .profile-actions-container .profile-button-container{margin-right:6px;min-width:120px}.profiles-editor .contents-container .profile-header .profile-actions-container .profile-button-container .monaco-button{padding-left:10px;padding-right:10px}.profiles-editor .contents-container .profile-header .profile-actions-container .actions-container .action-label{padding:6px}.profiles-editor .contents-container .profile-body{margin-top:20px}.profiles-editor .contents-container .profile-select-container{align-items:center;display:flex;justify-content:center;overflow:hidden}.profiles-editor .contents-container .profile-select-container>.monaco-select-box{border-radius:2px;cursor:pointer;line-height:18px;padding:0 23px 0 8px}.profiles-editor .contents-container .profile-copy-from-container{align-items:center;display:flex;margin:0 0 15px 36px}.profiles-editor .contents-container .profile-copy-from-container>.profile-copy-from-label{align-items:center;display:inline-flex;margin-right:25px}.profiles-editor .contents-container .profile-copy-from-container>.profile-select-container{width:250px}.profiles-editor .contents-container .profile-use-as-default-container{align-items:center;cursor:pointer;display:flex;margin:0 20px 15px 6px}.profiles-editor .contents-container .profile-use-as-default-container .profile-use-as-default-label{margin-left:2px}.profiles-editor .contents-container .profile-contents-container{margin:0 0 10px 20px}.profiles-editor .contents-container .profile-content-tree,.profiles-editor .contents-container .profile-content-tree-header{margin-left:6px}.profiles-editor .contents-container .profile-content-tree-header{align-items:center;background-color:var(--vscode-keybindingTable-headerBackground);display:grid;font-weight:700;grid-template-columns:30px repeat(1,1fr) 150px 100px;height:24px;margin-bottom:2px}.profiles-editor .contents-container .profile-tree-item-container{align-items:center;display:grid}.profiles-editor .contents-container .profile-tree-item-container.existing-profile-resource-type-container{grid-template-columns:repeat(1,1fr) 150px 100px}.profiles-editor .contents-container .profile-content-tree-header>.inherit-label,.profiles-editor .contents-container .profile-tree-item-container>.inherit-container{align-items:center;justify-content:center}.profiles-editor .contents-container .profile-tree-item-container>.inherit-container{padding-left:50px}.profiles-editor .contents-container .profile-content-tree-header>.actions-label{align-items:center;display:flex;justify-content:center}.profiles-editor .contents-container .profile-content-tree-header.new-profile{grid-template-columns:30px repeat(2,1fr) 100px}.profiles-editor .contents-container .profile-tree-item-container.new-profile-resource-type-container{grid-template-columns:repeat(2,1fr) 100px}.profiles-editor .contents-container .profile-tree-item-container.new-profile-resource-type-container .profile-select-container{width:170px}.profiles-editor .contents-container .profile-tree-item-container.profile-resource-child-container{grid-template-columns:repeat(1,1fr) 100px}.profiles-editor .contents-container .profile-tree-item-container .profile-resource-type-description{font-size:.9em;margin-left:10px;opacity:.7}.profiles-editor .contents-container .profile-tree-item-container .profile-tree-item-actions-container{justify-content:center}";
|
|
4
4
|
n(css,{});
|
|
5
5
|
|
|
6
6
|
export { css, css as default };
|