@codingame/monaco-vscode-extensions-service-override 4.1.0 → 4.1.1
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/_virtual/semver.js +3 -0
- package/extensions.js +6 -6
- package/external/vscode-semver/semver.js +985 -0
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +8 -0
- package/package.json +9 -9
- package/vscode/src/vs/base/common/console.js +62 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +497 -0
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +44 -0
- package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +27 -0
- package/vscode/src/vs/platform/remote/common/managedSocket.js +98 -0
- package/vscode/src/vs/workbench/api/browser/extensionHost.contribution.js +104 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +254 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +103 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +70 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +207 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +41 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +108 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +98 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +560 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +80 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +579 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +435 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +102 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +69 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +79 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +253 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +370 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +41 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +414 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +501 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +227 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +317 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +208 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +369 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +72 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +28 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +50 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +27 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +1016 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +185 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +93 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +137 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +194 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +123 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +188 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +129 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +131 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +374 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +25 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +48 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +76 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.js +38 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +42 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +185 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +30 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +493 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +168 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +70 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +50 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +99 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +72 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +731 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +409 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +51 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +219 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +55 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +312 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +223 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +110 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +29 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +100 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +135 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +57 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +268 -0
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +35 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +76 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +83 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +285 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +276 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +52 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +1149 -0
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +41 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +25 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +512 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +274 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +58 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +80 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +64 -0
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +161 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +49 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +222 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { isCancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
3
|
+
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { isNative } from 'vscode/vscode/vs/base/common/platform';
|
|
5
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
6
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
7
|
+
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment';
|
|
8
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
9
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
+
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
|
|
11
|
+
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
12
|
+
import { IRequestService } from 'vscode/vscode/vs/platform/request/common/request';
|
|
13
|
+
import { IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust';
|
|
14
|
+
import { IWorkspaceContextService, isUntitledWorkspace } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
15
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
16
|
+
import { checkGlobFileExists } from 'vscode/vscode/vs/workbench/services/extensions/common/workspaceContains';
|
|
17
|
+
import { QueryBuilder } from 'vscode/vscode/vs/workbench/services/search/common/queryBuilder';
|
|
18
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
19
|
+
import { ISearchService } from 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
20
|
+
import { IWorkspaceEditingService } from 'vscode/vscode/vs/workbench/services/workspaces/common/workspaceEditing';
|
|
21
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
22
|
+
import { IEditSessionIdentityService } from 'vscode/vscode/vs/platform/workspace/common/editSessions';
|
|
23
|
+
import { SideBySideEditor, EditorResourceAccessor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
24
|
+
import { firstOrDefault, coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
25
|
+
import { ICanonicalUriService } from 'vscode/vscode/vs/platform/workspace/common/canonicalUri';
|
|
26
|
+
|
|
27
|
+
let MainThreadWorkspace = class MainThreadWorkspace {
|
|
28
|
+
constructor(extHostContext, _searchService, _contextService, _editSessionIdentityService, _canonicalUriService, _editorService, _workspaceEditingService, _notificationService, _requestService, _instantiationService, _labelService, _environmentService, fileService, _workspaceTrustManagementService, _workspaceTrustRequestService) {
|
|
29
|
+
this._searchService = _searchService;
|
|
30
|
+
this._contextService = _contextService;
|
|
31
|
+
this._editSessionIdentityService = _editSessionIdentityService;
|
|
32
|
+
this._canonicalUriService = _canonicalUriService;
|
|
33
|
+
this._editorService = _editorService;
|
|
34
|
+
this._workspaceEditingService = _workspaceEditingService;
|
|
35
|
+
this._notificationService = _notificationService;
|
|
36
|
+
this._requestService = _requestService;
|
|
37
|
+
this._instantiationService = _instantiationService;
|
|
38
|
+
this._labelService = _labelService;
|
|
39
|
+
this._environmentService = _environmentService;
|
|
40
|
+
this._workspaceTrustManagementService = _workspaceTrustManagementService;
|
|
41
|
+
this._workspaceTrustRequestService = _workspaceTrustRequestService;
|
|
42
|
+
this._toDispose = ( new DisposableStore());
|
|
43
|
+
this._activeCancelTokens = Object.create(null);
|
|
44
|
+
this._queryBuilder = this._instantiationService.createInstance(QueryBuilder);
|
|
45
|
+
this.registeredEditSessionProviders = ( new Map());
|
|
46
|
+
this.registeredCanonicalUriProviders = ( new Map());
|
|
47
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostWorkspace));
|
|
48
|
+
const workspace = this._contextService.getWorkspace();
|
|
49
|
+
if (workspace.configuration && !isNative && !fileService.hasProvider(workspace.configuration)) {
|
|
50
|
+
this._proxy.$initializeWorkspace(this.getWorkspaceData(workspace), this.isWorkspaceTrusted());
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this._contextService.getCompleteWorkspace().then(workspace => this._proxy.$initializeWorkspace(this.getWorkspaceData(workspace), this.isWorkspaceTrusted()));
|
|
54
|
+
}
|
|
55
|
+
this._contextService.onDidChangeWorkspaceFolders(this._onDidChangeWorkspace, this, this._toDispose);
|
|
56
|
+
this._contextService.onDidChangeWorkbenchState(this._onDidChangeWorkspace, this, this._toDispose);
|
|
57
|
+
this._workspaceTrustManagementService.onDidChangeTrust(this._onDidGrantWorkspaceTrust, this, this._toDispose);
|
|
58
|
+
}
|
|
59
|
+
dispose() {
|
|
60
|
+
this._toDispose.dispose();
|
|
61
|
+
for (const requestId in this._activeCancelTokens) {
|
|
62
|
+
const tokenSource = this._activeCancelTokens[requestId];
|
|
63
|
+
tokenSource.cancel();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
$updateWorkspaceFolders(extensionName, index, deleteCount, foldersToAdd) {
|
|
67
|
+
const workspaceFoldersToAdd = ( foldersToAdd.map(f => ({ uri: URI.revive(f.uri), name: f.name })));
|
|
68
|
+
this._notificationService.status(this.getStatusMessage(extensionName, workspaceFoldersToAdd.length, deleteCount), { hideAfter: 10 * 1000 });
|
|
69
|
+
return this._workspaceEditingService.updateFolders(index, deleteCount, workspaceFoldersToAdd, true);
|
|
70
|
+
}
|
|
71
|
+
getStatusMessage(extensionName, addCount, removeCount) {
|
|
72
|
+
let message;
|
|
73
|
+
const wantsToAdd = addCount > 0;
|
|
74
|
+
const wantsToDelete = removeCount > 0;
|
|
75
|
+
if (wantsToAdd && !wantsToDelete) {
|
|
76
|
+
if (addCount === 1) {
|
|
77
|
+
message = ( localizeWithPath(
|
|
78
|
+
'vs/workbench/api/browser/mainThreadWorkspace',
|
|
79
|
+
'folderStatusMessageAddSingleFolder',
|
|
80
|
+
"Extension '{0}' added 1 folder to the workspace",
|
|
81
|
+
extensionName
|
|
82
|
+
));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
message = ( localizeWithPath(
|
|
86
|
+
'vs/workbench/api/browser/mainThreadWorkspace',
|
|
87
|
+
'folderStatusMessageAddMultipleFolders',
|
|
88
|
+
"Extension '{0}' added {1} folders to the workspace",
|
|
89
|
+
extensionName,
|
|
90
|
+
addCount
|
|
91
|
+
));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (wantsToDelete && !wantsToAdd) {
|
|
95
|
+
if (removeCount === 1) {
|
|
96
|
+
message = ( localizeWithPath(
|
|
97
|
+
'vs/workbench/api/browser/mainThreadWorkspace',
|
|
98
|
+
'folderStatusMessageRemoveSingleFolder',
|
|
99
|
+
"Extension '{0}' removed 1 folder from the workspace",
|
|
100
|
+
extensionName
|
|
101
|
+
));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
message = ( localizeWithPath(
|
|
105
|
+
'vs/workbench/api/browser/mainThreadWorkspace',
|
|
106
|
+
'folderStatusMessageRemoveMultipleFolders',
|
|
107
|
+
"Extension '{0}' removed {1} folders from the workspace",
|
|
108
|
+
extensionName,
|
|
109
|
+
removeCount
|
|
110
|
+
));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
message = ( localizeWithPath(
|
|
115
|
+
'vs/workbench/api/browser/mainThreadWorkspace',
|
|
116
|
+
'folderStatusChangeFolder',
|
|
117
|
+
"Extension '{0}' changed folders of the workspace",
|
|
118
|
+
extensionName
|
|
119
|
+
));
|
|
120
|
+
}
|
|
121
|
+
return message;
|
|
122
|
+
}
|
|
123
|
+
_onDidChangeWorkspace() {
|
|
124
|
+
this._proxy.$acceptWorkspaceData(this.getWorkspaceData(this._contextService.getWorkspace()));
|
|
125
|
+
}
|
|
126
|
+
getWorkspaceData(workspace) {
|
|
127
|
+
if (this._contextService.getWorkbenchState() === 1 ) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
configuration: workspace.configuration || undefined,
|
|
132
|
+
isUntitled: workspace.configuration ? isUntitledWorkspace(workspace.configuration, this._environmentService) : false,
|
|
133
|
+
folders: workspace.folders,
|
|
134
|
+
id: workspace.id,
|
|
135
|
+
name: this._labelService.getWorkspaceLabel(workspace),
|
|
136
|
+
transient: workspace.transient
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
$startFileSearch(_includeFolder, options, token) {
|
|
140
|
+
const includeFolder = URI.revive(_includeFolder);
|
|
141
|
+
const workspace = this._contextService.getWorkspace();
|
|
142
|
+
const query = this._queryBuilder.file(includeFolder ? [includeFolder] : workspace.folders, options);
|
|
143
|
+
return this._searchService.fileSearch(query, token).then(result => {
|
|
144
|
+
return ( result.results.map(m => m.resource));
|
|
145
|
+
}, err => {
|
|
146
|
+
if (!isCancellationError(err)) {
|
|
147
|
+
return Promise.reject(err);
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
$startTextSearch(pattern, _folder, options, requestId, token) {
|
|
153
|
+
const folder = URI.revive(_folder);
|
|
154
|
+
const workspace = this._contextService.getWorkspace();
|
|
155
|
+
const folders = folder ? [folder] : ( workspace.folders.map(folder => folder.uri));
|
|
156
|
+
const query = this._queryBuilder.text(pattern, folders, options);
|
|
157
|
+
query._reason = 'startTextSearch';
|
|
158
|
+
const onProgress = (p) => {
|
|
159
|
+
if (p.results) {
|
|
160
|
+
this._proxy.$handleTextSearchResult(p, requestId);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const search = this._searchService.textSearch(query, token, onProgress).then(result => {
|
|
164
|
+
return { limitHit: result.limitHit };
|
|
165
|
+
}, err => {
|
|
166
|
+
if (!isCancellationError(err)) {
|
|
167
|
+
return Promise.reject(err);
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
});
|
|
171
|
+
return search;
|
|
172
|
+
}
|
|
173
|
+
$checkExists(folders, includes, token) {
|
|
174
|
+
return this._instantiationService.invokeFunction((accessor) => checkGlobFileExists(accessor, folders, includes, token));
|
|
175
|
+
}
|
|
176
|
+
async $save(uriComponents, options) {
|
|
177
|
+
const uri = URI.revive(uriComponents);
|
|
178
|
+
const editors = [...this._editorService.findEditors(uri, { supportSideBySide: SideBySideEditor.PRIMARY })];
|
|
179
|
+
const result = await this._editorService.save(editors, {
|
|
180
|
+
reason: 1 ,
|
|
181
|
+
saveAs: options.saveAs,
|
|
182
|
+
force: !options.saveAs
|
|
183
|
+
});
|
|
184
|
+
return firstOrDefault(this._saveResultToUris(result));
|
|
185
|
+
}
|
|
186
|
+
_saveResultToUris(result) {
|
|
187
|
+
if (!result.success) {
|
|
188
|
+
return [];
|
|
189
|
+
}
|
|
190
|
+
return coalesce(( result.editors.map(
|
|
191
|
+
editor => EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY })
|
|
192
|
+
)));
|
|
193
|
+
}
|
|
194
|
+
$saveAll(includeUntitled) {
|
|
195
|
+
return this._editorService.saveAll({ includeUntitled }).then(res => res.success);
|
|
196
|
+
}
|
|
197
|
+
$resolveProxy(url) {
|
|
198
|
+
return this._requestService.resolveProxy(url);
|
|
199
|
+
}
|
|
200
|
+
$loadCertificates() {
|
|
201
|
+
return this._requestService.loadCertificates();
|
|
202
|
+
}
|
|
203
|
+
$requestWorkspaceTrust(options) {
|
|
204
|
+
return this._workspaceTrustRequestService.requestWorkspaceTrust(options);
|
|
205
|
+
}
|
|
206
|
+
isWorkspaceTrusted() {
|
|
207
|
+
return this._workspaceTrustManagementService.isWorkspaceTrusted();
|
|
208
|
+
}
|
|
209
|
+
_onDidGrantWorkspaceTrust() {
|
|
210
|
+
this._proxy.$onDidGrantWorkspaceTrust();
|
|
211
|
+
}
|
|
212
|
+
$registerEditSessionIdentityProvider(handle, scheme) {
|
|
213
|
+
const disposable = this._editSessionIdentityService.registerEditSessionIdentityProvider({
|
|
214
|
+
scheme: scheme,
|
|
215
|
+
getEditSessionIdentifier: async (workspaceFolder, token) => {
|
|
216
|
+
return this._proxy.$getEditSessionIdentifier(workspaceFolder.uri, token);
|
|
217
|
+
},
|
|
218
|
+
provideEditSessionIdentityMatch: async (workspaceFolder, identity1, identity2, token) => {
|
|
219
|
+
return this._proxy.$provideEditSessionIdentityMatch(workspaceFolder.uri, identity1, identity2, token);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
this.registeredEditSessionProviders.set(handle, disposable);
|
|
223
|
+
this._toDispose.add(disposable);
|
|
224
|
+
}
|
|
225
|
+
$unregisterEditSessionIdentityProvider(handle) {
|
|
226
|
+
const disposable = this.registeredEditSessionProviders.get(handle);
|
|
227
|
+
disposable?.dispose();
|
|
228
|
+
this.registeredEditSessionProviders.delete(handle);
|
|
229
|
+
}
|
|
230
|
+
$registerCanonicalUriProvider(handle, scheme) {
|
|
231
|
+
const disposable = this._canonicalUriService.registerCanonicalUriProvider({
|
|
232
|
+
scheme: scheme,
|
|
233
|
+
provideCanonicalUri: async (uri, targetScheme, token) => {
|
|
234
|
+
const result = await this._proxy.$provideCanonicalUri(uri, targetScheme, token);
|
|
235
|
+
if (result) {
|
|
236
|
+
return URI.revive(result);
|
|
237
|
+
}
|
|
238
|
+
return result;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
this.registeredCanonicalUriProviders.set(handle, disposable);
|
|
242
|
+
this._toDispose.add(disposable);
|
|
243
|
+
}
|
|
244
|
+
$unregisterCanonicalUriProvider(handle) {
|
|
245
|
+
const disposable = this.registeredCanonicalUriProviders.get(handle);
|
|
246
|
+
disposable?.dispose();
|
|
247
|
+
this.registeredCanonicalUriProviders.delete(handle);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
MainThreadWorkspace = __decorate([
|
|
251
|
+
extHostNamedCustomer(MainContext.MainThreadWorkspace),
|
|
252
|
+
( __param(1, ISearchService)),
|
|
253
|
+
( __param(2, IWorkspaceContextService)),
|
|
254
|
+
( __param(3, IEditSessionIdentityService)),
|
|
255
|
+
( __param(4, ICanonicalUriService)),
|
|
256
|
+
( __param(5, IEditorService)),
|
|
257
|
+
( __param(6, IWorkspaceEditingService)),
|
|
258
|
+
( __param(7, INotificationService)),
|
|
259
|
+
( __param(8, IRequestService)),
|
|
260
|
+
( __param(9, IInstantiationService)),
|
|
261
|
+
( __param(10, ILabelService)),
|
|
262
|
+
( __param(11, IEnvironmentService)),
|
|
263
|
+
( __param(12, IFileService)),
|
|
264
|
+
( __param(13, IWorkspaceTrustManagementService)),
|
|
265
|
+
( __param(14, IWorkspaceTrustRequestService))
|
|
266
|
+
], MainThreadWorkspace);
|
|
267
|
+
|
|
268
|
+
export { MainThreadWorkspace };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
2
|
+
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
3
|
+
|
|
4
|
+
class DataTransferFileCache {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.requestIdPool = 0;
|
|
7
|
+
this.dataTransferFiles = ( new Map());
|
|
8
|
+
}
|
|
9
|
+
add(dataTransfer) {
|
|
10
|
+
const requestId = this.requestIdPool++;
|
|
11
|
+
this.dataTransferFiles.set(requestId, coalesce(Array.from(dataTransfer, ([, item]) => item.asFile())));
|
|
12
|
+
return {
|
|
13
|
+
id: requestId,
|
|
14
|
+
dispose: () => {
|
|
15
|
+
this.dataTransferFiles.delete(requestId);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async resolveFileData(requestId, dataItemId) {
|
|
20
|
+
const files = this.dataTransferFiles.get(requestId);
|
|
21
|
+
if (!files) {
|
|
22
|
+
throw new Error('No data transfer found');
|
|
23
|
+
}
|
|
24
|
+
const file = files.find(file => file.id === dataItemId);
|
|
25
|
+
if (!file) {
|
|
26
|
+
throw new Error('No matching file found in data transfer');
|
|
27
|
+
}
|
|
28
|
+
return VSBuffer.wrap(await file.data());
|
|
29
|
+
}
|
|
30
|
+
dispose() {
|
|
31
|
+
this.dataTransferFiles.clear();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { DataTransferFileCache };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
5
|
+
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
6
|
+
import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles';
|
|
7
|
+
|
|
8
|
+
var CustomTextEditorModel_1;
|
|
9
|
+
let CustomTextEditorModel = CustomTextEditorModel_1 = class CustomTextEditorModel extends Disposable {
|
|
10
|
+
static async create(instantiationService, viewType, resource) {
|
|
11
|
+
return instantiationService.invokeFunction(async (accessor) => {
|
|
12
|
+
const textModelResolverService = accessor.get(ITextModelService);
|
|
13
|
+
const model = await textModelResolverService.createModelReference(resource);
|
|
14
|
+
return instantiationService.createInstance(CustomTextEditorModel_1, viewType, resource, model);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
constructor(viewType, _resource, _model, textFileService) {
|
|
18
|
+
super();
|
|
19
|
+
this.viewType = viewType;
|
|
20
|
+
this._resource = _resource;
|
|
21
|
+
this._model = _model;
|
|
22
|
+
this.textFileService = textFileService;
|
|
23
|
+
this._onDidChangeOrphaned = this._register(( new Emitter()));
|
|
24
|
+
this.onDidChangeOrphaned = this._onDidChangeOrphaned.event;
|
|
25
|
+
this._onDidChangeReadonly = this._register(( new Emitter()));
|
|
26
|
+
this.onDidChangeReadonly = this._onDidChangeReadonly.event;
|
|
27
|
+
this._onDidChangeDirty = this._register(( new Emitter()));
|
|
28
|
+
this.onDidChangeDirty = this._onDidChangeDirty.event;
|
|
29
|
+
this._onDidChangeContent = this._register(( new Emitter()));
|
|
30
|
+
this.onDidChangeContent = this._onDidChangeContent.event;
|
|
31
|
+
this._register(_model);
|
|
32
|
+
this._textFileModel = this.textFileService.files.get(_resource);
|
|
33
|
+
if (this._textFileModel) {
|
|
34
|
+
this._register(this._textFileModel.onDidChangeOrphaned(() => this._onDidChangeOrphaned.fire()));
|
|
35
|
+
this._register(this._textFileModel.onDidChangeReadonly(() => this._onDidChangeReadonly.fire()));
|
|
36
|
+
}
|
|
37
|
+
this._register(this.textFileService.files.onDidChangeDirty(e => {
|
|
38
|
+
if (isEqual(this.resource, e.resource)) {
|
|
39
|
+
this._onDidChangeDirty.fire();
|
|
40
|
+
this._onDidChangeContent.fire();
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
get resource() {
|
|
45
|
+
return this._resource;
|
|
46
|
+
}
|
|
47
|
+
isReadonly() {
|
|
48
|
+
return this._model.object.isReadonly();
|
|
49
|
+
}
|
|
50
|
+
get backupId() {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
get canHotExit() {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
isDirty() {
|
|
57
|
+
return this.textFileService.isDirty(this.resource);
|
|
58
|
+
}
|
|
59
|
+
isOrphaned() {
|
|
60
|
+
return !!this._textFileModel?.hasState(4 );
|
|
61
|
+
}
|
|
62
|
+
async revert(options) {
|
|
63
|
+
return this.textFileService.revert(this.resource, options);
|
|
64
|
+
}
|
|
65
|
+
saveCustomEditor(options) {
|
|
66
|
+
return this.textFileService.save(this.resource, options);
|
|
67
|
+
}
|
|
68
|
+
async saveCustomEditorAs(resource, targetResource, options) {
|
|
69
|
+
return !!(await this.textFileService.saveAs(resource, targetResource, options));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
CustomTextEditorModel = CustomTextEditorModel_1 = ( __decorate([
|
|
73
|
+
( __param(3, ITextFileService))
|
|
74
|
+
], CustomTextEditorModel));
|
|
75
|
+
|
|
76
|
+
export { CustomTextEditorModel };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
4
|
+
import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
|
|
5
|
+
import { updateContributedOpeners } from 'vscode/vscode/vs/workbench/contrib/externalUriOpener/common/configuration';
|
|
6
|
+
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
7
|
+
|
|
8
|
+
var ContributedExternalUriOpenersStore_1;
|
|
9
|
+
let ContributedExternalUriOpenersStore = class ContributedExternalUriOpenersStore extends Disposable {
|
|
10
|
+
static { ContributedExternalUriOpenersStore_1 = this; }
|
|
11
|
+
static { this.STORAGE_ID = 'externalUriOpeners'; }
|
|
12
|
+
constructor(storageService, _extensionService) {
|
|
13
|
+
super();
|
|
14
|
+
this._extensionService = _extensionService;
|
|
15
|
+
this._openers = ( new Map());
|
|
16
|
+
this._memento = ( new Memento(ContributedExternalUriOpenersStore_1.STORAGE_ID, storageService));
|
|
17
|
+
this._mementoObject = this._memento.getMemento(0 , 1 );
|
|
18
|
+
for (const [id, value] of Object.entries(this._mementoObject || {})) {
|
|
19
|
+
this.add(id, value.extensionId, { isCurrentlyRegistered: false });
|
|
20
|
+
}
|
|
21
|
+
this.invalidateOpenersOnExtensionsChanged();
|
|
22
|
+
this._register(this._extensionService.onDidChangeExtensions(() => this.invalidateOpenersOnExtensionsChanged()));
|
|
23
|
+
this._register(this._extensionService.onDidChangeExtensionsStatus(() => this.invalidateOpenersOnExtensionsChanged()));
|
|
24
|
+
}
|
|
25
|
+
didRegisterOpener(id, extensionId) {
|
|
26
|
+
this.add(id, extensionId, {
|
|
27
|
+
isCurrentlyRegistered: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
add(id, extensionId, options) {
|
|
31
|
+
const existing = this._openers.get(id);
|
|
32
|
+
if (existing) {
|
|
33
|
+
existing.isCurrentlyRegistered = existing.isCurrentlyRegistered || options.isCurrentlyRegistered;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const entry = {
|
|
37
|
+
extensionId,
|
|
38
|
+
isCurrentlyRegistered: options.isCurrentlyRegistered
|
|
39
|
+
};
|
|
40
|
+
this._openers.set(id, entry);
|
|
41
|
+
this._mementoObject[id] = entry;
|
|
42
|
+
this._memento.saveMemento();
|
|
43
|
+
this.updateSchema();
|
|
44
|
+
}
|
|
45
|
+
delete(id) {
|
|
46
|
+
this._openers.delete(id);
|
|
47
|
+
delete this._mementoObject[id];
|
|
48
|
+
this._memento.saveMemento();
|
|
49
|
+
this.updateSchema();
|
|
50
|
+
}
|
|
51
|
+
async invalidateOpenersOnExtensionsChanged() {
|
|
52
|
+
await this._extensionService.whenInstalledExtensionsRegistered();
|
|
53
|
+
const registeredExtensions = this._extensionService.extensions;
|
|
54
|
+
for (const [id, entry] of this._openers) {
|
|
55
|
+
const extension = registeredExtensions.find(r => r.identifier.value === entry.extensionId);
|
|
56
|
+
if (extension) {
|
|
57
|
+
if (!this._extensionService.canRemoveExtension(extension)) {
|
|
58
|
+
if (!entry.isCurrentlyRegistered) {
|
|
59
|
+
this.delete(id);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.delete(id);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
updateSchema() {
|
|
69
|
+
const ids = [];
|
|
70
|
+
const descriptions = [];
|
|
71
|
+
for (const [id, entry] of this._openers) {
|
|
72
|
+
ids.push(id);
|
|
73
|
+
descriptions.push(entry.extensionId);
|
|
74
|
+
}
|
|
75
|
+
updateContributedOpeners(ids, descriptions);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
ContributedExternalUriOpenersStore = ContributedExternalUriOpenersStore_1 = ( __decorate([
|
|
79
|
+
( __param(0, IStorageService)),
|
|
80
|
+
( __param(1, IExtensionService))
|
|
81
|
+
], ContributedExternalUriOpenersStore));
|
|
82
|
+
|
|
83
|
+
export { ContributedExternalUriOpenersStore };
|