@codingame/monaco-vscode-extensions-service-override 1.83.7 → 1.83.9
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/assets/webWorkerExtensionHostIframe.html +123 -0
- package/extensions.d.ts +12 -13
- package/extensions.js +456 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +8 -0
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +3 -0
- package/package.json +5 -3
- package/tools/url.js +10 -0
- package/tools.js +5 -0
- package/vscode/src/vs/base/common/console.js +59 -0
- package/vscode/src/vs/base/common/prefixTree.js +131 -0
- package/vscode/src/vs/platform/files/common/watcher.js +71 -0
- package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +27 -0
- package/vscode/src/vs/platform/log/browser/log.js +26 -0
- package/vscode/src/vs/platform/remote/common/managedSocket.js +98 -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 +330 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +174 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +52 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +107 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +94 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +541 -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 +578 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +387 -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 +75 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +249 -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 +411 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +475 -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 +280 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +28 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +33 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +27 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +947 -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 +118 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +158 -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 +341 -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/mainThreadProfilContentHandlers.js +38 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +49 -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 +463 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +148 -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/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 +412 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +182 -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 +313 -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 +273 -0
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.api.impl.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostConfiguration.d.ts +3 -3
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionService.d.ts +3 -4
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostManagedSockets.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTerminalService.d.ts +19 -20
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTunnelService.d.ts +7 -8
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostWorkspace.d.ts +25 -26
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +217 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +51 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +92 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +648 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +297 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +62 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +331 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +380 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +5 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1196 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +19 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +334 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +543 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +178 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +101 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +145 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +3 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +73 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +83 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +179 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +5 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +482 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +6 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +85 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +56 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +110 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +260 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +616 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +309 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +38 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +167 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +80 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +70 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +108 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +506 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +132 -0
- package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +103 -0
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +28 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +25 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +336 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +46 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +283 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +273 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +52 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +1093 -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 +643 -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/remoteConsoleUtil.js +49 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +220 -0
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +5 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +79 -0
- package/vscode-proposed.d.ts +0 -3872
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.protocol.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionActivator.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostFileSystemInfo.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostInitDataService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostLocalizationService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostRpcService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostStoragePaths.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTypes.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostUriTransformerService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/worker/extHostExtensionService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/services/search/common/queryBuilder.d.ts +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { isNonEmptyArray } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
3
|
+
import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
4
|
+
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
5
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
6
|
+
import { DisposableMap, DisposableStore, toDisposable, combinedDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
7
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
8
|
+
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
9
|
+
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
10
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
11
|
+
import { INotebookEditorService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService';
|
|
12
|
+
import { INotebookExecutionStateService, NotebookExecutionType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
|
|
13
|
+
import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
|
|
14
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
15
|
+
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
16
|
+
|
|
17
|
+
class MainThreadKernel {
|
|
18
|
+
get preloadUris() {
|
|
19
|
+
return ( this.preloads.map(p => p.uri));
|
|
20
|
+
}
|
|
21
|
+
get preloadProvides() {
|
|
22
|
+
return ( this.preloads.map(p => p.provides)).flat();
|
|
23
|
+
}
|
|
24
|
+
constructor(data, _languageService) {
|
|
25
|
+
this._languageService = _languageService;
|
|
26
|
+
this._onDidChange = ( new Emitter());
|
|
27
|
+
this.onDidChange = this._onDidChange.event;
|
|
28
|
+
this.id = data.id;
|
|
29
|
+
this.viewType = data.notebookType;
|
|
30
|
+
this.extension = data.extensionId;
|
|
31
|
+
this.implementsInterrupt = data.supportsInterrupt ?? false;
|
|
32
|
+
this.label = data.label;
|
|
33
|
+
this.description = data.description;
|
|
34
|
+
this.detail = data.detail;
|
|
35
|
+
this.supportedLanguages = isNonEmptyArray(data.supportedLanguages) ? data.supportedLanguages : _languageService.getRegisteredLanguageIds();
|
|
36
|
+
this.implementsExecutionOrder = data.supportsExecutionOrder ?? false;
|
|
37
|
+
this.localResourceRoot = URI.revive(data.extensionLocation);
|
|
38
|
+
this.preloads = data.preloads?.map(u => ({ uri: URI.revive(u.uri), provides: u.provides })) ?? [];
|
|
39
|
+
}
|
|
40
|
+
update(data) {
|
|
41
|
+
const event = Object.create(null);
|
|
42
|
+
if (data.label !== undefined) {
|
|
43
|
+
this.label = data.label;
|
|
44
|
+
event.label = true;
|
|
45
|
+
}
|
|
46
|
+
if (data.description !== undefined) {
|
|
47
|
+
this.description = data.description;
|
|
48
|
+
event.description = true;
|
|
49
|
+
}
|
|
50
|
+
if (data.detail !== undefined) {
|
|
51
|
+
this.detail = data.detail;
|
|
52
|
+
event.detail = true;
|
|
53
|
+
}
|
|
54
|
+
if (data.supportedLanguages !== undefined) {
|
|
55
|
+
this.supportedLanguages = isNonEmptyArray(data.supportedLanguages) ? data.supportedLanguages : this._languageService.getRegisteredLanguageIds();
|
|
56
|
+
event.supportedLanguages = true;
|
|
57
|
+
}
|
|
58
|
+
if (data.supportsExecutionOrder !== undefined) {
|
|
59
|
+
this.implementsExecutionOrder = data.supportsExecutionOrder;
|
|
60
|
+
event.hasExecutionOrder = true;
|
|
61
|
+
}
|
|
62
|
+
if (data.supportsInterrupt !== undefined) {
|
|
63
|
+
this.implementsInterrupt = data.supportsInterrupt;
|
|
64
|
+
event.hasInterruptHandler = true;
|
|
65
|
+
}
|
|
66
|
+
this._onDidChange.fire(event);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
class MainThreadKernelDetectionTask {
|
|
70
|
+
constructor(notebookType) {
|
|
71
|
+
this.notebookType = notebookType;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
let MainThreadNotebookKernels = class MainThreadNotebookKernels {
|
|
75
|
+
constructor(extHostContext, _languageService, _notebookKernelService, _notebookExecutionStateService, _notebookService, notebookEditorService) {
|
|
76
|
+
this._languageService = _languageService;
|
|
77
|
+
this._notebookKernelService = _notebookKernelService;
|
|
78
|
+
this._notebookExecutionStateService = _notebookExecutionStateService;
|
|
79
|
+
this._notebookService = _notebookService;
|
|
80
|
+
this._editors = ( new DisposableMap());
|
|
81
|
+
this._disposables = ( new DisposableStore());
|
|
82
|
+
this._kernels = ( new Map());
|
|
83
|
+
this._kernelDetectionTasks = ( new Map());
|
|
84
|
+
this._kernelSourceActionProviders = ( new Map());
|
|
85
|
+
this._kernelSourceActionProvidersEventRegistrations = ( new Map());
|
|
86
|
+
this._executions = ( new Map());
|
|
87
|
+
this._notebookExecutions = ( new Map());
|
|
88
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookKernels));
|
|
89
|
+
notebookEditorService.listNotebookEditors().forEach(this._onEditorAdd, this);
|
|
90
|
+
notebookEditorService.onDidAddNotebookEditor(this._onEditorAdd, this, this._disposables);
|
|
91
|
+
notebookEditorService.onDidRemoveNotebookEditor(this._onEditorRemove, this, this._disposables);
|
|
92
|
+
this._disposables.add(toDisposable(() => {
|
|
93
|
+
this._executions.forEach(e => {
|
|
94
|
+
e.complete({});
|
|
95
|
+
});
|
|
96
|
+
this._notebookExecutions.forEach(e => e.complete());
|
|
97
|
+
}));
|
|
98
|
+
this._disposables.add(this._notebookExecutionStateService.onDidChangeExecution(e => {
|
|
99
|
+
if (e.type === NotebookExecutionType.cell) {
|
|
100
|
+
this._proxy.$cellExecutionChanged(e.notebook, e.cellHandle, e.changed?.state);
|
|
101
|
+
}
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
dispose() {
|
|
105
|
+
this._disposables.dispose();
|
|
106
|
+
for (const [, registration] of ( this._kernels.values())) {
|
|
107
|
+
registration.dispose();
|
|
108
|
+
}
|
|
109
|
+
for (const [, registration] of ( this._kernelDetectionTasks.values())) {
|
|
110
|
+
registration.dispose();
|
|
111
|
+
}
|
|
112
|
+
for (const [, registration] of ( this._kernelSourceActionProviders.values())) {
|
|
113
|
+
registration.dispose();
|
|
114
|
+
}
|
|
115
|
+
this._editors.dispose();
|
|
116
|
+
}
|
|
117
|
+
_onEditorAdd(editor) {
|
|
118
|
+
const ipcListener = editor.onDidReceiveMessage(e => {
|
|
119
|
+
if (!editor.hasModel()) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const { selected } = this._notebookKernelService.getMatchingKernel(editor.textModel);
|
|
123
|
+
if (!selected) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
for (const [handle, candidate] of this._kernels) {
|
|
127
|
+
if (candidate[0] === selected) {
|
|
128
|
+
this._proxy.$acceptKernelMessageFromRenderer(handle, editor.getId(), e.message);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
this._editors.set(editor, ipcListener);
|
|
134
|
+
}
|
|
135
|
+
_onEditorRemove(editor) {
|
|
136
|
+
this._editors.deleteAndDispose(editor);
|
|
137
|
+
}
|
|
138
|
+
async $postMessage(handle, editorId, message) {
|
|
139
|
+
const tuple = this._kernels.get(handle);
|
|
140
|
+
if (!tuple) {
|
|
141
|
+
throw new Error('kernel already disposed');
|
|
142
|
+
}
|
|
143
|
+
const [kernel] = tuple;
|
|
144
|
+
let didSend = false;
|
|
145
|
+
for (const [editor] of this._editors) {
|
|
146
|
+
if (!editor.hasModel()) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (this._notebookKernelService.getMatchingKernel(editor.textModel).selected !== kernel) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (editorId === undefined) {
|
|
153
|
+
editor.postMessage(message);
|
|
154
|
+
didSend = true;
|
|
155
|
+
}
|
|
156
|
+
else if (editor.getId() === editorId) {
|
|
157
|
+
editor.postMessage(message);
|
|
158
|
+
didSend = true;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return didSend;
|
|
163
|
+
}
|
|
164
|
+
async $addKernel(handle, data) {
|
|
165
|
+
const that = this;
|
|
166
|
+
const kernel = new (class extends MainThreadKernel {
|
|
167
|
+
async executeNotebookCellsRequest(uri, handles) {
|
|
168
|
+
await that._proxy.$executeCells(handle, uri, handles);
|
|
169
|
+
}
|
|
170
|
+
async cancelNotebookCellExecution(uri, handles) {
|
|
171
|
+
await that._proxy.$cancelCells(handle, uri, handles);
|
|
172
|
+
}
|
|
173
|
+
})(data, this._languageService);
|
|
174
|
+
const listener = this._notebookKernelService.onDidChangeSelectedNotebooks(e => {
|
|
175
|
+
if (e.oldKernel === kernel.id) {
|
|
176
|
+
this._proxy.$acceptNotebookAssociation(handle, e.notebook, false);
|
|
177
|
+
}
|
|
178
|
+
else if (e.newKernel === kernel.id) {
|
|
179
|
+
this._proxy.$acceptNotebookAssociation(handle, e.notebook, true);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
const registration = this._notebookKernelService.registerKernel(kernel);
|
|
183
|
+
this._kernels.set(handle, [kernel, combinedDisposable(listener, registration)]);
|
|
184
|
+
}
|
|
185
|
+
$updateKernel(handle, data) {
|
|
186
|
+
const tuple = this._kernels.get(handle);
|
|
187
|
+
if (tuple) {
|
|
188
|
+
tuple[0].update(data);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
$removeKernel(handle) {
|
|
192
|
+
const tuple = this._kernels.get(handle);
|
|
193
|
+
if (tuple) {
|
|
194
|
+
tuple[1].dispose();
|
|
195
|
+
this._kernels.delete(handle);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
$updateNotebookPriority(handle, notebook, value) {
|
|
199
|
+
const tuple = this._kernels.get(handle);
|
|
200
|
+
if (tuple) {
|
|
201
|
+
this._notebookKernelService.updateKernelNotebookAffinity(tuple[0], URI.revive(notebook), value);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
$createExecution(handle, controllerId, rawUri, cellHandle) {
|
|
205
|
+
const uri = URI.revive(rawUri);
|
|
206
|
+
const notebook = this._notebookService.getNotebookTextModel(uri);
|
|
207
|
+
if (!notebook) {
|
|
208
|
+
throw new Error(`Notebook not found: ${uri.toString()}`);
|
|
209
|
+
}
|
|
210
|
+
const kernel = this._notebookKernelService.getMatchingKernel(notebook);
|
|
211
|
+
if (!kernel.selected || kernel.selected.id !== controllerId) {
|
|
212
|
+
throw new Error(`Kernel is not selected: ${kernel.selected?.id} !== ${controllerId}`);
|
|
213
|
+
}
|
|
214
|
+
const execution = this._notebookExecutionStateService.createCellExecution(uri, cellHandle);
|
|
215
|
+
execution.confirm();
|
|
216
|
+
this._executions.set(handle, execution);
|
|
217
|
+
}
|
|
218
|
+
$updateExecution(handle, data) {
|
|
219
|
+
const updates = data.value;
|
|
220
|
+
try {
|
|
221
|
+
const execution = this._executions.get(handle);
|
|
222
|
+
execution?.update(( updates.map(NotebookDto.fromCellExecuteUpdateDto)));
|
|
223
|
+
}
|
|
224
|
+
catch (e) {
|
|
225
|
+
onUnexpectedError(e);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
$completeExecution(handle, data) {
|
|
229
|
+
try {
|
|
230
|
+
const execution = this._executions.get(handle);
|
|
231
|
+
execution?.complete(NotebookDto.fromCellExecuteCompleteDto(data.value));
|
|
232
|
+
}
|
|
233
|
+
catch (e) {
|
|
234
|
+
onUnexpectedError(e);
|
|
235
|
+
}
|
|
236
|
+
finally {
|
|
237
|
+
this._executions.delete(handle);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
$createNotebookExecution(handle, controllerId, rawUri) {
|
|
241
|
+
const uri = URI.revive(rawUri);
|
|
242
|
+
const notebook = this._notebookService.getNotebookTextModel(uri);
|
|
243
|
+
if (!notebook) {
|
|
244
|
+
throw new Error(`Notebook not found: ${uri.toString()}`);
|
|
245
|
+
}
|
|
246
|
+
const kernel = this._notebookKernelService.getMatchingKernel(notebook);
|
|
247
|
+
if (!kernel.selected || kernel.selected.id !== controllerId) {
|
|
248
|
+
throw new Error(`Kernel is not selected: ${kernel.selected?.id} !== ${controllerId}`);
|
|
249
|
+
}
|
|
250
|
+
const execution = this._notebookExecutionStateService.createExecution(uri);
|
|
251
|
+
execution.confirm();
|
|
252
|
+
this._notebookExecutions.set(handle, execution);
|
|
253
|
+
}
|
|
254
|
+
$beginNotebookExecution(handle) {
|
|
255
|
+
try {
|
|
256
|
+
const execution = this._notebookExecutions.get(handle);
|
|
257
|
+
execution?.begin();
|
|
258
|
+
}
|
|
259
|
+
catch (e) {
|
|
260
|
+
onUnexpectedError(e);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
$completeNotebookExecution(handle) {
|
|
264
|
+
try {
|
|
265
|
+
const execution = this._notebookExecutions.get(handle);
|
|
266
|
+
execution?.complete();
|
|
267
|
+
}
|
|
268
|
+
catch (e) {
|
|
269
|
+
onUnexpectedError(e);
|
|
270
|
+
}
|
|
271
|
+
finally {
|
|
272
|
+
this._notebookExecutions.delete(handle);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
async $addKernelDetectionTask(handle, notebookType) {
|
|
276
|
+
const kernelDetectionTask = ( new MainThreadKernelDetectionTask(notebookType));
|
|
277
|
+
const registration = this._notebookKernelService.registerNotebookKernelDetectionTask(kernelDetectionTask);
|
|
278
|
+
this._kernelDetectionTasks.set(handle, [kernelDetectionTask, registration]);
|
|
279
|
+
}
|
|
280
|
+
$removeKernelDetectionTask(handle) {
|
|
281
|
+
const tuple = this._kernelDetectionTasks.get(handle);
|
|
282
|
+
if (tuple) {
|
|
283
|
+
tuple[1].dispose();
|
|
284
|
+
this._kernelDetectionTasks.delete(handle);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
async $addKernelSourceActionProvider(handle, eventHandle, notebookType) {
|
|
288
|
+
const kernelSourceActionProvider = {
|
|
289
|
+
viewType: notebookType,
|
|
290
|
+
provideKernelSourceActions: async () => {
|
|
291
|
+
const actions = await this._proxy.$provideKernelSourceActions(handle, CancellationToken.None);
|
|
292
|
+
return ( actions.map(action => {
|
|
293
|
+
let documentation = action.documentation;
|
|
294
|
+
if (action.documentation && typeof action.documentation !== 'string') {
|
|
295
|
+
documentation = URI.revive(action.documentation);
|
|
296
|
+
}
|
|
297
|
+
return {
|
|
298
|
+
label: action.label,
|
|
299
|
+
command: action.command,
|
|
300
|
+
description: action.description,
|
|
301
|
+
detail: action.detail,
|
|
302
|
+
documentation,
|
|
303
|
+
};
|
|
304
|
+
}));
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
if (typeof eventHandle === 'number') {
|
|
308
|
+
const emitter = ( new Emitter());
|
|
309
|
+
this._kernelSourceActionProvidersEventRegistrations.set(eventHandle, emitter);
|
|
310
|
+
kernelSourceActionProvider.onDidChangeSourceActions = emitter.event;
|
|
311
|
+
}
|
|
312
|
+
const registration = this._notebookKernelService.registerKernelSourceActionProvider(notebookType, kernelSourceActionProvider);
|
|
313
|
+
this._kernelSourceActionProviders.set(handle, [kernelSourceActionProvider, registration]);
|
|
314
|
+
}
|
|
315
|
+
$removeKernelSourceActionProvider(handle, eventHandle) {
|
|
316
|
+
const tuple = this._kernelSourceActionProviders.get(handle);
|
|
317
|
+
if (tuple) {
|
|
318
|
+
tuple[1].dispose();
|
|
319
|
+
this._kernelSourceActionProviders.delete(handle);
|
|
320
|
+
}
|
|
321
|
+
if (typeof eventHandle === 'number') {
|
|
322
|
+
this._kernelSourceActionProvidersEventRegistrations.delete(eventHandle);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
$emitNotebookKernelSourceActionsChangeEvent(eventHandle) {
|
|
326
|
+
const emitter = this._kernelSourceActionProvidersEventRegistrations.get(eventHandle);
|
|
327
|
+
if (emitter instanceof Emitter) {
|
|
328
|
+
emitter.fire(undefined);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
MainThreadNotebookKernels = __decorate([
|
|
333
|
+
extHostNamedCustomer(MainContext.MainThreadNotebookKernels),
|
|
334
|
+
( __param(1, ILanguageService)),
|
|
335
|
+
( __param(2, INotebookKernelService)),
|
|
336
|
+
( __param(3, INotebookExecutionStateService)),
|
|
337
|
+
( __param(4, INotebookService)),
|
|
338
|
+
( __param(5, INotebookEditorService))
|
|
339
|
+
], MainThreadNotebookKernels);
|
|
340
|
+
|
|
341
|
+
export { MainThreadNotebookKernels };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
4
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
|
+
import { INotebookRendererMessagingService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookRendererMessagingService';
|
|
6
|
+
|
|
7
|
+
let MainThreadNotebookRenderers = class MainThreadNotebookRenderers extends Disposable {
|
|
8
|
+
constructor(extHostContext, messaging) {
|
|
9
|
+
super();
|
|
10
|
+
this.messaging = messaging;
|
|
11
|
+
this.proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookRenderers));
|
|
12
|
+
this._register(messaging.onShouldPostMessage(e => {
|
|
13
|
+
this.proxy.$postRendererMessage(e.editorId, e.rendererId, e.message);
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
$postMessage(editorId, rendererId, message) {
|
|
17
|
+
return this.messaging.receiveMessage(editorId, rendererId, message);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
MainThreadNotebookRenderers = __decorate([
|
|
21
|
+
extHostNamedCustomer(MainContext.MainThreadNotebookRenderers),
|
|
22
|
+
( __param(1, INotebookRendererMessagingService))
|
|
23
|
+
], MainThreadNotebookRenderers);
|
|
24
|
+
|
|
25
|
+
export { MainThreadNotebookRenderers };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
4
|
+
import { extHostCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
|
+
import { ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
6
|
+
import { raceCancellationError } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
7
|
+
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService';
|
|
8
|
+
import { NotebookFileWorkingCopyModel } from '../../contrib/notebook/common/notebookEditorModel.js';
|
|
9
|
+
|
|
10
|
+
class ExtHostNotebookDocumentSaveParticipant {
|
|
11
|
+
constructor(extHostContext) {
|
|
12
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookDocumentSaveParticipant));
|
|
13
|
+
}
|
|
14
|
+
async participate(workingCopy, env, _progress, token) {
|
|
15
|
+
if (!workingCopy.model || !(workingCopy.model instanceof NotebookFileWorkingCopyModel)) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
let _warningTimeout;
|
|
19
|
+
const p = ( new Promise((resolve, reject) => {
|
|
20
|
+
_warningTimeout = setTimeout(() => reject(( new Error(( localizeWithPath(
|
|
21
|
+
'vs/workbench/api/browser/mainThreadNotebookSaveParticipant',
|
|
22
|
+
'timeout.onWillSave',
|
|
23
|
+
"Aborted onWillSaveNotebookDocument-event after 1750ms"
|
|
24
|
+
))))), 1750);
|
|
25
|
+
this._proxy.$participateInSave(workingCopy.resource, env.reason, token).then(_ => {
|
|
26
|
+
clearTimeout(_warningTimeout);
|
|
27
|
+
return undefined;
|
|
28
|
+
}).then(resolve, reject);
|
|
29
|
+
}));
|
|
30
|
+
return raceCancellationError(p, token);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
let SaveParticipant = class SaveParticipant {
|
|
34
|
+
constructor(extHostContext, instantiationService, workingCopyFileService) {
|
|
35
|
+
this.workingCopyFileService = workingCopyFileService;
|
|
36
|
+
this._saveParticipantDisposable = this.workingCopyFileService.addSaveParticipant(instantiationService.createInstance(ExtHostNotebookDocumentSaveParticipant, extHostContext));
|
|
37
|
+
}
|
|
38
|
+
dispose() {
|
|
39
|
+
this._saveParticipantDisposable.dispose();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
SaveParticipant = __decorate([
|
|
43
|
+
extHostCustomer,
|
|
44
|
+
( __param(1, IInstantiationService)),
|
|
45
|
+
( __param(2, IWorkingCopyFileService))
|
|
46
|
+
], SaveParticipant);
|
|
47
|
+
|
|
48
|
+
export { SaveParticipant };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
3
|
+
import { OUTPUT_VIEW_ID, Extensions, OutputChannelUpdateMode, IOutputService } from 'vscode/vscode/vs/workbench/services/output/common/output';
|
|
4
|
+
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
5
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
6
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
7
|
+
import { Disposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
8
|
+
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
9
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/common/views';
|
|
10
|
+
import { isNumber } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
11
|
+
|
|
12
|
+
var MainThreadOutputService_1;
|
|
13
|
+
let MainThreadOutputService = class MainThreadOutputService extends Disposable {
|
|
14
|
+
static { MainThreadOutputService_1 = this; }
|
|
15
|
+
static { this._extensionIdPool = ( new Map()); }
|
|
16
|
+
constructor(extHostContext, outputService, viewsService) {
|
|
17
|
+
super();
|
|
18
|
+
this._outputService = outputService;
|
|
19
|
+
this._viewsService = viewsService;
|
|
20
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostOutputService));
|
|
21
|
+
const setVisibleChannel = () => {
|
|
22
|
+
const visibleChannel = this._viewsService.isViewVisible(OUTPUT_VIEW_ID) ? this._outputService.getActiveChannel() : undefined;
|
|
23
|
+
this._proxy.$setVisibleChannel(visibleChannel ? visibleChannel.id : null);
|
|
24
|
+
};
|
|
25
|
+
this._register(Event.any(this._outputService.onActiveOutputChannel, Event.filter(this._viewsService.onDidChangeViewVisibility, ({ id }) => id === OUTPUT_VIEW_ID))(() => setVisibleChannel()));
|
|
26
|
+
setVisibleChannel();
|
|
27
|
+
}
|
|
28
|
+
async $register(label, file, languageId, extensionId) {
|
|
29
|
+
const idCounter = (MainThreadOutputService_1._extensionIdPool.get(extensionId) || 0) + 1;
|
|
30
|
+
MainThreadOutputService_1._extensionIdPool.set(extensionId, idCounter);
|
|
31
|
+
const id = `extension-output-${extensionId}-#${idCounter}-${label}`;
|
|
32
|
+
const resource = URI.revive(file);
|
|
33
|
+
( Registry.as(Extensions.OutputChannels)).registerChannel({ id, label, file: resource, log: false, languageId, extensionId });
|
|
34
|
+
this._register(toDisposable(() => this.$dispose(id)));
|
|
35
|
+
return id;
|
|
36
|
+
}
|
|
37
|
+
async $update(channelId, mode, till) {
|
|
38
|
+
const channel = this._getChannel(channelId);
|
|
39
|
+
if (channel) {
|
|
40
|
+
if (mode === OutputChannelUpdateMode.Append) {
|
|
41
|
+
channel.update(mode);
|
|
42
|
+
}
|
|
43
|
+
else if (isNumber(till)) {
|
|
44
|
+
channel.update(mode, till);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async $reveal(channelId, preserveFocus) {
|
|
49
|
+
const channel = this._getChannel(channelId);
|
|
50
|
+
if (channel) {
|
|
51
|
+
this._outputService.showChannel(channel.id, preserveFocus);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async $close(channelId) {
|
|
55
|
+
if (this._viewsService.isViewVisible(OUTPUT_VIEW_ID)) {
|
|
56
|
+
const activeChannel = this._outputService.getActiveChannel();
|
|
57
|
+
if (activeChannel && channelId === activeChannel.id) {
|
|
58
|
+
this._viewsService.closeView(OUTPUT_VIEW_ID);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async $dispose(channelId) {
|
|
63
|
+
const channel = this._getChannel(channelId);
|
|
64
|
+
channel?.dispose();
|
|
65
|
+
}
|
|
66
|
+
_getChannel(channelId) {
|
|
67
|
+
return this._outputService.getChannel(channelId);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
MainThreadOutputService = MainThreadOutputService_1 = __decorate([
|
|
71
|
+
extHostNamedCustomer(MainContext.MainThreadOutputService),
|
|
72
|
+
( __param(1, IOutputService)),
|
|
73
|
+
( __param(2, IViewsService))
|
|
74
|
+
], MainThreadOutputService);
|
|
75
|
+
|
|
76
|
+
export { MainThreadOutputService };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable, DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { revive } from 'monaco-editor/esm/vs/base/common/marshalling.js';
|
|
4
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
5
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
6
|
+
import { IUserDataProfileImportExportService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
|
|
7
|
+
|
|
8
|
+
let MainThreadProfileContentHandlers = class MainThreadProfileContentHandlers extends Disposable {
|
|
9
|
+
constructor(context, userDataProfileImportExportService) {
|
|
10
|
+
super();
|
|
11
|
+
this.userDataProfileImportExportService = userDataProfileImportExportService;
|
|
12
|
+
this.registeredHandlers = this._register(( new DisposableMap()));
|
|
13
|
+
this.proxy = ( context.getProxy(ExtHostContext.ExtHostProfileContentHandlers));
|
|
14
|
+
}
|
|
15
|
+
async $registerProfileContentHandler(id, name, description, extensionId) {
|
|
16
|
+
this.registeredHandlers.set(id, this.userDataProfileImportExportService.registerProfileContentHandler(id, {
|
|
17
|
+
name,
|
|
18
|
+
description,
|
|
19
|
+
extensionId,
|
|
20
|
+
saveProfile: async (name, content, token) => {
|
|
21
|
+
const result = await this.proxy.$saveProfile(id, name, content, token);
|
|
22
|
+
return result ? revive(result) : null;
|
|
23
|
+
},
|
|
24
|
+
readProfile: async (uri, token) => {
|
|
25
|
+
return this.proxy.$readProfile(id, uri, token);
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
async $unregisterProfileContentHandler(id) {
|
|
30
|
+
this.registeredHandlers.deleteAndDispose(id);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
MainThreadProfileContentHandlers = __decorate([
|
|
34
|
+
extHostNamedCustomer(MainContext.MainThreadProfileContentHandlers),
|
|
35
|
+
( __param(1, IUserDataProfileImportExportService))
|
|
36
|
+
], MainThreadProfileContentHandlers);
|
|
37
|
+
|
|
38
|
+
export { MainThreadProfileContentHandlers };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
3
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
4
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
|
+
import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
6
|
+
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
7
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
8
|
+
|
|
9
|
+
class ManageExtensionAction extends Action {
|
|
10
|
+
constructor(extensionId, label, commandService) {
|
|
11
|
+
super(extensionId, label, undefined, true, () => {
|
|
12
|
+
return commandService.executeCommand('_extensions.manage', extensionId);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
let MainThreadProgress = class MainThreadProgress {
|
|
17
|
+
constructor(extHostContext, progressService, _commandService) {
|
|
18
|
+
this._commandService = _commandService;
|
|
19
|
+
this._progress = ( new Map());
|
|
20
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostProgress));
|
|
21
|
+
this._progressService = progressService;
|
|
22
|
+
}
|
|
23
|
+
dispose() {
|
|
24
|
+
this._progress.forEach(handle => handle.resolve());
|
|
25
|
+
this._progress.clear();
|
|
26
|
+
}
|
|
27
|
+
async $startProgress(handle, options, extensionId) {
|
|
28
|
+
const task = this._createTask(handle);
|
|
29
|
+
if (options.location === 15 && extensionId) {
|
|
30
|
+
const notificationOptions = {
|
|
31
|
+
...options,
|
|
32
|
+
location: 15 ,
|
|
33
|
+
secondaryActions: [( new ManageExtensionAction(extensionId, ( localizeWithPath(
|
|
34
|
+
'vs/workbench/api/browser/mainThreadProgress',
|
|
35
|
+
'manageExtension',
|
|
36
|
+
"Manage Extension"
|
|
37
|
+
)), this._commandService))]
|
|
38
|
+
};
|
|
39
|
+
options = notificationOptions;
|
|
40
|
+
}
|
|
41
|
+
this._progressService.withProgress(options, task, () => this._proxy.$acceptProgressCanceled(handle));
|
|
42
|
+
}
|
|
43
|
+
$progressReport(handle, message) {
|
|
44
|
+
const entry = this._progress.get(handle);
|
|
45
|
+
entry?.progress.report(message);
|
|
46
|
+
}
|
|
47
|
+
$progressEnd(handle) {
|
|
48
|
+
const entry = this._progress.get(handle);
|
|
49
|
+
if (entry) {
|
|
50
|
+
entry.resolve();
|
|
51
|
+
this._progress.delete(handle);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
_createTask(handle) {
|
|
55
|
+
return (progress) => {
|
|
56
|
+
return ( new Promise(resolve => {
|
|
57
|
+
this._progress.set(handle, { resolve, progress });
|
|
58
|
+
}));
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
MainThreadProgress = __decorate([
|
|
63
|
+
extHostNamedCustomer(MainContext.MainThreadProgress),
|
|
64
|
+
( __param(1, IProgressService)),
|
|
65
|
+
( __param(2, ICommandService))
|
|
66
|
+
], MainThreadProgress);
|
|
67
|
+
|
|
68
|
+
export { MainThreadProgress };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
3
|
+
import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
5
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
6
|
+
import { IQuickDiffService } from 'vscode/vscode/vs/workbench/contrib/scm/common/quickDiff';
|
|
7
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
8
|
+
|
|
9
|
+
let MainThreadQuickDiff = class MainThreadQuickDiff {
|
|
10
|
+
constructor(extHostContext, quickDiffService) {
|
|
11
|
+
this.quickDiffService = quickDiffService;
|
|
12
|
+
this.providers = ( new Map());
|
|
13
|
+
this.providerDisposables = ( new Map());
|
|
14
|
+
this.proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostQuickDiff));
|
|
15
|
+
}
|
|
16
|
+
async $registerQuickDiffProvider(handle, selector, label, rootUri) {
|
|
17
|
+
const provider = {
|
|
18
|
+
label,
|
|
19
|
+
rootUri: URI.revive(rootUri),
|
|
20
|
+
selector,
|
|
21
|
+
isSCM: false,
|
|
22
|
+
getOriginalResource: async (uri) => {
|
|
23
|
+
return URI.revive(await this.proxy.$provideOriginalResource(handle, uri, ( new CancellationTokenSource()).token));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
this.providers.set(handle, provider);
|
|
27
|
+
const disposable = this.quickDiffService.addQuickDiffProvider(provider);
|
|
28
|
+
this.providerDisposables.set(handle, disposable);
|
|
29
|
+
}
|
|
30
|
+
async $unregisterQuickDiffProvider(handle) {
|
|
31
|
+
if (( this.providers.has(handle))) {
|
|
32
|
+
this.providers.delete(handle);
|
|
33
|
+
}
|
|
34
|
+
if (( this.providerDisposables.has(handle))) {
|
|
35
|
+
this.providerDisposables.delete(handle);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
dispose() {
|
|
39
|
+
this.providers.clear();
|
|
40
|
+
dispose(( this.providerDisposables.values()));
|
|
41
|
+
this.providerDisposables.clear();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
MainThreadQuickDiff = __decorate([
|
|
45
|
+
extHostNamedCustomer(MainContext.MainThreadQuickDiff),
|
|
46
|
+
( __param(1, IQuickDiffService))
|
|
47
|
+
], MainThreadQuickDiff);
|
|
48
|
+
|
|
49
|
+
export { MainThreadQuickDiff };
|