@codingame/monaco-vscode-edit-sessions-service-override 25.1.2 → 26.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 +521 -340
- package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessionsFileSystemProvider.js +20 -12
- package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.js +192 -118
- package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.js +91 -80
- package/vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js +18 -18
- package/vscode/src/vs/workbench/contrib/editSessions/common/editSessionsLogService.js +8 -5
- package/vscode/src/vs/workbench/contrib/editSessions/common/workspaceStateSync.js +75 -35
- package/vscode/src/vs/workbench/services/workspaces/common/editSessionIdentityService.js +18 -11
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceIdentityService.js +13 -9
|
@@ -24,30 +24,40 @@ let EditSessionIdentityService = class EditSessionIdentityService {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
async getEditSessionIdentifier(workspaceFolder, token) {
|
|
27
|
-
const {
|
|
27
|
+
const {
|
|
28
|
+
scheme
|
|
29
|
+
} = workspaceFolder.uri;
|
|
28
30
|
const provider = await this.activateProvider(scheme);
|
|
29
|
-
this._logService.trace(
|
|
31
|
+
this._logService.trace(
|
|
32
|
+
`EditSessionIdentityProvider for scheme ${scheme} available: ${!!provider}`
|
|
33
|
+
);
|
|
30
34
|
return provider?.getEditSessionIdentifier(workspaceFolder, token);
|
|
31
35
|
}
|
|
32
36
|
async provideEditSessionIdentityMatch(workspaceFolder, identity1, identity2, cancellationToken) {
|
|
33
|
-
const {
|
|
37
|
+
const {
|
|
38
|
+
scheme
|
|
39
|
+
} = workspaceFolder.uri;
|
|
34
40
|
const provider = await this.activateProvider(scheme);
|
|
35
|
-
this._logService.trace(
|
|
41
|
+
this._logService.trace(
|
|
42
|
+
`EditSessionIdentityProvider for scheme ${scheme} available: ${!!provider}`
|
|
43
|
+
);
|
|
36
44
|
return provider?.provideEditSessionIdentityMatch?.(workspaceFolder, identity1, identity2, cancellationToken);
|
|
37
45
|
}
|
|
38
46
|
async onWillCreateEditSessionIdentity(workspaceFolder, cancellationToken) {
|
|
39
|
-
this._logService.debug(
|
|
47
|
+
this._logService.debug("Running onWillCreateEditSessionIdentity participants...");
|
|
40
48
|
for (const participant of this._participants) {
|
|
41
49
|
await participant.participate(workspaceFolder, cancellationToken);
|
|
42
50
|
}
|
|
43
|
-
this._logService.debug(
|
|
51
|
+
this._logService.debug(
|
|
52
|
+
`Done running ${this._participants.length} onWillCreateEditSessionIdentity participants.`
|
|
53
|
+
);
|
|
44
54
|
}
|
|
45
55
|
addEditSessionIdentityCreateParticipant(participant) {
|
|
46
56
|
const dispose = insert(this._participants, participant);
|
|
47
57
|
return toDisposable(() => dispose());
|
|
48
58
|
}
|
|
49
59
|
async activateProvider(scheme) {
|
|
50
|
-
const transformedScheme = scheme ===
|
|
60
|
+
const transformedScheme = scheme === "vscode-remote" ? "file" : scheme;
|
|
51
61
|
const provider = this._editSessionIdentifierProviders.get(scheme);
|
|
52
62
|
if (provider) {
|
|
53
63
|
return provider;
|
|
@@ -56,9 +66,6 @@ let EditSessionIdentityService = class EditSessionIdentityService {
|
|
|
56
66
|
return this._editSessionIdentifierProviders.get(scheme);
|
|
57
67
|
}
|
|
58
68
|
};
|
|
59
|
-
EditSessionIdentityService = ( __decorate([
|
|
60
|
-
( __param(0, IExtensionService)),
|
|
61
|
-
( __param(1, ILogService))
|
|
62
|
-
], EditSessionIdentityService));
|
|
69
|
+
EditSessionIdentityService = ( __decorate([( __param(0, IExtensionService)), ( __param(1, ILogService))], EditSessionIdentityService));
|
|
63
70
|
|
|
64
71
|
export { EditSessionIdentityService };
|
|
@@ -21,7 +21,10 @@ let WorkspaceIdentityService = class WorkspaceIdentityService {
|
|
|
21
21
|
if (!workspaceFolderIdentity) {
|
|
22
22
|
continue;
|
|
23
23
|
}
|
|
24
|
-
workspaceStateFolders.push({
|
|
24
|
+
workspaceStateFolders.push({
|
|
25
|
+
resourceUri: ( workspaceFolder.uri.toString()),
|
|
26
|
+
workspaceFolderIdentity
|
|
27
|
+
});
|
|
25
28
|
}
|
|
26
29
|
return workspaceStateFolders;
|
|
27
30
|
}
|
|
@@ -47,7 +50,12 @@ let WorkspaceIdentityService = class WorkspaceIdentityService {
|
|
|
47
50
|
}
|
|
48
51
|
let hasCompleteMatch = false;
|
|
49
52
|
for (const [incomingIdentity, incomingFolder] of Object.entries(incomingIdentitiesToIncomingWorkspaceFolders)) {
|
|
50
|
-
if ((await this.editSessionIdentityService.provideEditSessionIdentityMatch(
|
|
53
|
+
if ((await this.editSessionIdentityService.provideEditSessionIdentityMatch(
|
|
54
|
+
currentWorkspaceFolder,
|
|
55
|
+
currentWorkspaceFolderIdentity,
|
|
56
|
+
incomingIdentity,
|
|
57
|
+
cancellationToken
|
|
58
|
+
)) === EditSessionIdentityMatch.Complete) {
|
|
51
59
|
incomingToCurrentWorkspaceFolderUris[incomingFolder] = ( currentWorkspaceFolder.uri.toString());
|
|
52
60
|
hasCompleteMatch = true;
|
|
53
61
|
break;
|
|
@@ -58,7 +66,7 @@ let WorkspaceIdentityService = class WorkspaceIdentityService {
|
|
|
58
66
|
}
|
|
59
67
|
return false;
|
|
60
68
|
}
|
|
61
|
-
const convertUri =
|
|
69
|
+
const convertUri = uriToConvert => {
|
|
62
70
|
for (const incomingFolderUriKey of ( Object.keys(incomingToCurrentWorkspaceFolderUris))) {
|
|
63
71
|
const incomingFolderUri = ( URI.parse(incomingFolderUriKey));
|
|
64
72
|
if (isEqualOrParent(incomingFolderUri, uriToConvert)) {
|
|
@@ -85,8 +93,7 @@ let WorkspaceIdentityService = class WorkspaceIdentityService {
|
|
|
85
93
|
for (let i = 0; i < obj.length; ++i) {
|
|
86
94
|
obj[i] = uriReplacer(obj[i], depth + 1);
|
|
87
95
|
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
96
|
+
} else {
|
|
90
97
|
for (const key in obj) {
|
|
91
98
|
if (Object.hasOwnProperty.call(obj, key)) {
|
|
92
99
|
obj[key] = uriReplacer(obj[key], depth + 1);
|
|
@@ -98,9 +105,6 @@ let WorkspaceIdentityService = class WorkspaceIdentityService {
|
|
|
98
105
|
return uriReplacer;
|
|
99
106
|
}
|
|
100
107
|
};
|
|
101
|
-
WorkspaceIdentityService = ( __decorate([
|
|
102
|
-
( __param(0, IWorkspaceContextService)),
|
|
103
|
-
( __param(1, IEditSessionIdentityService))
|
|
104
|
-
], WorkspaceIdentityService));
|
|
108
|
+
WorkspaceIdentityService = ( __decorate([( __param(0, IWorkspaceContextService)), ( __param(1, IEditSessionIdentityService))], WorkspaceIdentityService));
|
|
105
109
|
|
|
106
110
|
export { WorkspaceIdentityService };
|