@codingame/monaco-vscode-extensions-service-override 37.1.0 → 37.3.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/index.js +2 -17
- package/package.json +3 -3
- package/service-override/tools/missingMainThreadCustomers.d.ts +1 -0
- package/service-override/tools/missingMainThreadCustomers.js +274 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +37 -37
- package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiSettingsSearch.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiSettingsSearch.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +32 -32
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowserTunnelProxy.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowserTunnelProxy.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatOutputRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +9 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +4 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentDiff.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentDiff.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +9 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +10 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +13 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +21 -21
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +16 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadMeteredConnection.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMeteredConnection.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadPower.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadPower.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +8 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.d.ts +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +6 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +13 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +14 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +15 -13
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +25 -25
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +37 -32
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +18 -10
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +55 -45
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +5 -5
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +3 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +4 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +4 -2
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +0 -104
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +0 -827
- package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.d.ts +0 -15
- package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +0 -71
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +0 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +0 -95
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.d.ts +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +0 -286
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.d.ts +0 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +0 -38
- package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.d.ts +0 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.js +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +0 -130
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +0 -907
- package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.d.ts +0 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js +0 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.d.ts +0 -63
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -305
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +0 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +0 -167
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +0 -46
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +0 -356
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +0 -108
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +0 -698
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.d.ts +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +0 -210
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.d.ts +0 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +0 -138
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.d.ts +0 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +0 -194
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.d.ts +0 -17
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +0 -128
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.d.ts +0 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +0 -149
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.d.ts +0 -49
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -372
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.d.ts +0 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +0 -26
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.d.ts +0 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +0 -43
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.d.ts +0 -32
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -45
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
2
|
-
import { INotebookCellStatusBarService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService.service";
|
|
3
|
-
import { INotebookContributionData, NotebookExtensionDescription, TransientOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
4
|
-
import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
5
|
-
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
|
|
6
|
-
import { MainThreadNotebookShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
|
|
7
|
-
export declare class MainThreadNotebooks implements MainThreadNotebookShape {
|
|
8
|
-
private readonly _notebookService;
|
|
9
|
-
private readonly _cellStatusBarService;
|
|
10
|
-
private readonly _logService;
|
|
11
|
-
private readonly _disposables;
|
|
12
|
-
private readonly _proxy;
|
|
13
|
-
private readonly _notebookSerializer;
|
|
14
|
-
private readonly _notebookCellStatusBarRegistrations;
|
|
15
|
-
constructor(extHostContext: IExtHostContext, _notebookService: INotebookService, _cellStatusBarService: INotebookCellStatusBarService, _logService: ILogService);
|
|
16
|
-
dispose(): void;
|
|
17
|
-
$registerNotebookSerializer(handle: number, extension: NotebookExtensionDescription, viewType: string, options: TransientOptions, data: INotebookContributionData | undefined): void;
|
|
18
|
-
$unregisterNotebookSerializer(handle: number): void;
|
|
19
|
-
$emitCellStatusBarEvent(eventHandle: number): void;
|
|
20
|
-
$registerNotebookCellStatusBarItemProvider(handle: number, eventHandle: number | undefined, viewType: string): Promise<void>;
|
|
21
|
-
$unregisterNotebookCellStatusBarItemProvider(handle: number, eventHandle: number | undefined): Promise<void>;
|
|
22
|
-
}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
4
|
-
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
5
|
-
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
-
import { DisposableStore, dispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
-
import { StopWatch } from '@codingame/monaco-vscode-api/vscode/vs/base/common/stopwatch';
|
|
8
|
-
import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
9
|
-
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
10
|
-
import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
|
|
11
|
-
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
12
|
-
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
13
|
-
import { INotebookCellStatusBarService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService.service';
|
|
14
|
-
import { SimpleNotebookProviderInfo } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
15
|
-
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
16
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
17
|
-
import { SerializableObjectWithBuffers } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/proxyIdentifier';
|
|
18
|
-
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
19
|
-
import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
|
|
20
|
-
import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
21
|
-
import { FileOperationError } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
22
|
-
|
|
23
|
-
let MainThreadNotebooks = class MainThreadNotebooks {
|
|
24
|
-
constructor(extHostContext, _notebookService, _cellStatusBarService, _logService) {
|
|
25
|
-
this._notebookService = _notebookService;
|
|
26
|
-
this._cellStatusBarService = _cellStatusBarService;
|
|
27
|
-
this._logService = _logService;
|
|
28
|
-
this._disposables = ( new DisposableStore());
|
|
29
|
-
this._notebookSerializer = ( new Map());
|
|
30
|
-
this._notebookCellStatusBarRegistrations = ( new Map());
|
|
31
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebook));
|
|
32
|
-
}
|
|
33
|
-
dispose() {
|
|
34
|
-
this._disposables.dispose();
|
|
35
|
-
dispose(( this._notebookSerializer.values()));
|
|
36
|
-
dispose(( this._notebookCellStatusBarRegistrations.values()));
|
|
37
|
-
this._notebookCellStatusBarRegistrations.clear();
|
|
38
|
-
}
|
|
39
|
-
$registerNotebookSerializer(handle, extension, viewType, options, data) {
|
|
40
|
-
const disposables = ( new DisposableStore());
|
|
41
|
-
disposables.add(this._notebookService.registerNotebookSerializer(viewType, extension, {
|
|
42
|
-
options,
|
|
43
|
-
dataToNotebook: async data => {
|
|
44
|
-
const sw = ( new StopWatch());
|
|
45
|
-
let result;
|
|
46
|
-
if (data.byteLength === 0 && viewType === "interactive") {
|
|
47
|
-
result = NotebookDto.fromNotebookDataDto({
|
|
48
|
-
cells: [],
|
|
49
|
-
metadata: {}
|
|
50
|
-
});
|
|
51
|
-
} else {
|
|
52
|
-
const dto = await this._proxy.$dataToNotebook(handle, data, CancellationToken.None);
|
|
53
|
-
result = NotebookDto.fromNotebookDataDto(dto.value);
|
|
54
|
-
}
|
|
55
|
-
this._logService.trace(`[NotebookSerializer] dataToNotebook DONE after ${sw.elapsed()}ms`, {
|
|
56
|
-
viewType,
|
|
57
|
-
extensionId: extension.id.value
|
|
58
|
-
});
|
|
59
|
-
return result;
|
|
60
|
-
},
|
|
61
|
-
notebookToData: data => {
|
|
62
|
-
const sw = ( new StopWatch());
|
|
63
|
-
const result = this._proxy.$notebookToData(handle, ( new SerializableObjectWithBuffers(NotebookDto.toNotebookDataDto(data))), CancellationToken.None);
|
|
64
|
-
this._logService.trace(`[NotebookSerializer] notebookToData DONE after ${sw.elapsed()}`, {
|
|
65
|
-
viewType,
|
|
66
|
-
extensionId: extension.id.value
|
|
67
|
-
});
|
|
68
|
-
return result;
|
|
69
|
-
},
|
|
70
|
-
save: async (uri, versionId, options, token) => {
|
|
71
|
-
const stat = await this._proxy.$saveNotebook(handle, uri, versionId, options, token);
|
|
72
|
-
if (isFileOperationError(stat)) {
|
|
73
|
-
throw ( new FileOperationError(stat.message, stat.fileOperationResult, stat.options));
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
...stat,
|
|
77
|
-
children: undefined,
|
|
78
|
-
resource: uri
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
searchInNotebooks: async (textQuery, token, allPriorityInfo) => {
|
|
82
|
-
const contributedType = this._notebookService.getContributedNotebookType(viewType);
|
|
83
|
-
if (!contributedType) {
|
|
84
|
-
return {
|
|
85
|
-
results: [],
|
|
86
|
-
limitHit: false
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
const fileNames = contributedType.selectors;
|
|
90
|
-
const includes = ( fileNames.map(selector => {
|
|
91
|
-
const globPattern = selector.include || selector;
|
|
92
|
-
return ( globPattern.toString());
|
|
93
|
-
}));
|
|
94
|
-
if (!includes.length) {
|
|
95
|
-
return {
|
|
96
|
-
results: [],
|
|
97
|
-
limitHit: false
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
const thisPriorityInfo = coalesce([{
|
|
101
|
-
isFromSettings: false,
|
|
102
|
-
filenamePatterns: includes
|
|
103
|
-
}, ...(allPriorityInfo.get(viewType) ?? [])]);
|
|
104
|
-
const otherEditorsPriorityInfo = Array.from(( allPriorityInfo.keys())).flatMap(key => {
|
|
105
|
-
if (key !== viewType) {
|
|
106
|
-
return allPriorityInfo.get(key) ?? [];
|
|
107
|
-
}
|
|
108
|
-
return [];
|
|
109
|
-
});
|
|
110
|
-
const searchComplete = await this._proxy.$searchInNotebooks(handle, textQuery, thisPriorityInfo, otherEditorsPriorityInfo, token);
|
|
111
|
-
const revivedResults = ( searchComplete.results.map(result => {
|
|
112
|
-
const resource = URI.revive(result.resource);
|
|
113
|
-
return {
|
|
114
|
-
resource,
|
|
115
|
-
cellResults: ( result.cellResults.map(e => revive(e)))
|
|
116
|
-
};
|
|
117
|
-
}));
|
|
118
|
-
return {
|
|
119
|
-
results: revivedResults,
|
|
120
|
-
limitHit: searchComplete.limitHit
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
}));
|
|
124
|
-
if (data) {
|
|
125
|
-
disposables.add(this._notebookService.registerContributedNotebookType(viewType, data));
|
|
126
|
-
}
|
|
127
|
-
this._notebookSerializer.set(handle, disposables);
|
|
128
|
-
this._logService.trace("[NotebookSerializer] registered notebook serializer", {
|
|
129
|
-
viewType,
|
|
130
|
-
extensionId: extension.id.value
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
$unregisterNotebookSerializer(handle) {
|
|
134
|
-
this._notebookSerializer.get(handle)?.dispose();
|
|
135
|
-
this._notebookSerializer.delete(handle);
|
|
136
|
-
}
|
|
137
|
-
$emitCellStatusBarEvent(eventHandle) {
|
|
138
|
-
const emitter = this._notebookCellStatusBarRegistrations.get(eventHandle);
|
|
139
|
-
if (emitter instanceof Emitter) {
|
|
140
|
-
emitter.fire(undefined);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
async $registerNotebookCellStatusBarItemProvider(handle, eventHandle, viewType) {
|
|
144
|
-
const that = this;
|
|
145
|
-
const provider = {
|
|
146
|
-
async provideCellStatusBarItems(uri, index, token) {
|
|
147
|
-
const result = await that._proxy.$provideNotebookCellStatusBarItems(handle, uri, index, token);
|
|
148
|
-
return {
|
|
149
|
-
items: result?.items ?? [],
|
|
150
|
-
dispose() {
|
|
151
|
-
if (result) {
|
|
152
|
-
that._proxy.$releaseNotebookCellStatusBarItems(result.cacheId);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
},
|
|
157
|
-
viewType
|
|
158
|
-
};
|
|
159
|
-
if (typeof eventHandle === "number") {
|
|
160
|
-
const emitter = ( new Emitter());
|
|
161
|
-
this._notebookCellStatusBarRegistrations.set(eventHandle, emitter);
|
|
162
|
-
provider.onDidChangeStatusBarItems = emitter.event;
|
|
163
|
-
}
|
|
164
|
-
const disposable = this._cellStatusBarService.registerCellStatusBarItemProvider(provider);
|
|
165
|
-
this._notebookCellStatusBarRegistrations.set(handle, disposable);
|
|
166
|
-
}
|
|
167
|
-
async $unregisterNotebookCellStatusBarItemProvider(handle, eventHandle) {
|
|
168
|
-
const unregisterThing = handle => {
|
|
169
|
-
const entry = this._notebookCellStatusBarRegistrations.get(handle);
|
|
170
|
-
if (entry) {
|
|
171
|
-
this._notebookCellStatusBarRegistrations.get(handle)?.dispose();
|
|
172
|
-
this._notebookCellStatusBarRegistrations.delete(handle);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
unregisterThing(handle);
|
|
176
|
-
if (typeof eventHandle === "number") {
|
|
177
|
-
unregisterThing(eventHandle);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
MainThreadNotebooks = __decorate([extHostNamedCustomer(MainContext.MainThreadNotebook), ( __param(1, INotebookService)), ( __param(2, INotebookCellStatusBarService)), ( __param(3, ILogService))], MainThreadNotebooks);
|
|
182
|
-
CommandsRegistry.registerCommand("_executeDataToNotebook", async (accessor, ...args) => {
|
|
183
|
-
const [notebookType, bytes] = args;
|
|
184
|
-
assertType(typeof notebookType === "string", "string");
|
|
185
|
-
assertType(bytes instanceof VSBuffer, "VSBuffer");
|
|
186
|
-
const notebookService = accessor.get(INotebookService);
|
|
187
|
-
const info = await notebookService.withNotebookDataProvider(notebookType);
|
|
188
|
-
if (!(info instanceof SimpleNotebookProviderInfo)) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
const dto = await info.serializer.dataToNotebook(bytes);
|
|
192
|
-
return ( new SerializableObjectWithBuffers(NotebookDto.toNotebookDataDto(dto)));
|
|
193
|
-
});
|
|
194
|
-
CommandsRegistry.registerCommand("_executeNotebookToData", async (accessor, notebookType, dto) => {
|
|
195
|
-
assertType(typeof notebookType === "string", "string");
|
|
196
|
-
const notebookService = accessor.get(INotebookService);
|
|
197
|
-
const info = await notebookService.withNotebookDataProvider(notebookType);
|
|
198
|
-
if (!(info instanceof SimpleNotebookProviderInfo)) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
const data = NotebookDto.fromNotebookDataDto(dto.value);
|
|
202
|
-
const bytes = await info.serializer.notebookToData(data);
|
|
203
|
-
return bytes;
|
|
204
|
-
});
|
|
205
|
-
function isFileOperationError(error) {
|
|
206
|
-
const candidate = error;
|
|
207
|
-
return typeof candidate?.fileOperationResult === "number" && typeof candidate?.message === "string";
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export { MainThreadNotebooks };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { URI, UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
-
import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
|
|
3
|
-
import { INotebookEditorModelResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service";
|
|
4
|
-
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
5
|
-
import { MainThreadNotebookDocumentsShape, NotebookDataDto } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
|
|
6
|
-
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
|
|
7
|
-
export declare class MainThreadNotebookDocuments implements MainThreadNotebookDocumentsShape {
|
|
8
|
-
private readonly _notebookEditorModelResolverService;
|
|
9
|
-
private readonly _uriIdentityService;
|
|
10
|
-
private readonly _disposables;
|
|
11
|
-
private readonly _proxy;
|
|
12
|
-
private readonly _documentEventListenersMapping;
|
|
13
|
-
private readonly _modelReferenceCollection;
|
|
14
|
-
constructor(extHostContext: IExtHostContext, _notebookEditorModelResolverService: INotebookEditorModelResolverService, _uriIdentityService: IUriIdentityService);
|
|
15
|
-
dispose(): void;
|
|
16
|
-
handleNotebooksAdded(notebooks: readonly NotebookTextModel[]): void;
|
|
17
|
-
handleNotebooksRemoved(uris: URI[]): void;
|
|
18
|
-
$tryCreateNotebook(options: {
|
|
19
|
-
viewType: string;
|
|
20
|
-
content?: NotebookDataDto;
|
|
21
|
-
}): Promise<UriComponents>;
|
|
22
|
-
$tryOpenNotebook(uriComponents: UriComponents): Promise<URI>;
|
|
23
|
-
$trySaveNotebook(uriComponents: UriComponents): Promise<boolean>;
|
|
24
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
-
import { DisposableStore, dispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
6
|
-
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
7
|
-
import { BoundModelReferenceCollection } from './mainThreadDocuments.js';
|
|
8
|
-
import { NotebookCellsChangeType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
9
|
-
import { INotebookEditorModelResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service';
|
|
10
|
-
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
11
|
-
import { ExtHostContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
12
|
-
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
13
|
-
import { SerializableObjectWithBuffers } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/proxyIdentifier';
|
|
14
|
-
|
|
15
|
-
let MainThreadNotebookDocuments = class MainThreadNotebookDocuments {
|
|
16
|
-
constructor(extHostContext, _notebookEditorModelResolverService, _uriIdentityService) {
|
|
17
|
-
this._notebookEditorModelResolverService = _notebookEditorModelResolverService;
|
|
18
|
-
this._uriIdentityService = _uriIdentityService;
|
|
19
|
-
this._disposables = ( new DisposableStore());
|
|
20
|
-
this._documentEventListenersMapping = ( new ResourceMap());
|
|
21
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookDocuments));
|
|
22
|
-
this._modelReferenceCollection = ( new BoundModelReferenceCollection(this._uriIdentityService.extUri));
|
|
23
|
-
this._disposables.add(this._notebookEditorModelResolverService.onDidChangeDirty(
|
|
24
|
-
model => this._proxy.$acceptDirtyStateChanged(model.resource, model.isDirty())
|
|
25
|
-
));
|
|
26
|
-
this._disposables.add(
|
|
27
|
-
this._notebookEditorModelResolverService.onDidSaveNotebook(e => this._proxy.$acceptModelSaved(e))
|
|
28
|
-
);
|
|
29
|
-
this._disposables.add(_notebookEditorModelResolverService.onWillFailWithConflict(e => {
|
|
30
|
-
this._modelReferenceCollection.remove(e.resource);
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
dispose() {
|
|
34
|
-
this._disposables.dispose();
|
|
35
|
-
this._modelReferenceCollection.dispose();
|
|
36
|
-
dispose(( this._documentEventListenersMapping.values()));
|
|
37
|
-
}
|
|
38
|
-
handleNotebooksAdded(notebooks) {
|
|
39
|
-
for (const textModel of notebooks) {
|
|
40
|
-
const disposableStore = ( new DisposableStore());
|
|
41
|
-
disposableStore.add(textModel.onDidChangeContent(event => {
|
|
42
|
-
const eventDto = {
|
|
43
|
-
versionId: event.versionId,
|
|
44
|
-
rawEvents: []
|
|
45
|
-
};
|
|
46
|
-
for (const e of event.rawEvents) {
|
|
47
|
-
switch (e.kind) {
|
|
48
|
-
case NotebookCellsChangeType.ModelChange:
|
|
49
|
-
eventDto.rawEvents.push({
|
|
50
|
-
kind: e.kind,
|
|
51
|
-
changes: ( e.changes.map(diff => [diff[0], diff[1], ( diff[2].map(cell => NotebookDto.toNotebookCellDto(cell)))]))
|
|
52
|
-
});
|
|
53
|
-
break;
|
|
54
|
-
case NotebookCellsChangeType.Move:
|
|
55
|
-
eventDto.rawEvents.push({
|
|
56
|
-
kind: e.kind,
|
|
57
|
-
index: e.index,
|
|
58
|
-
length: e.length,
|
|
59
|
-
newIdx: e.newIdx
|
|
60
|
-
});
|
|
61
|
-
break;
|
|
62
|
-
case NotebookCellsChangeType.Output:
|
|
63
|
-
eventDto.rawEvents.push({
|
|
64
|
-
kind: e.kind,
|
|
65
|
-
index: e.index,
|
|
66
|
-
outputs: ( e.outputs.map(NotebookDto.toNotebookOutputDto))
|
|
67
|
-
});
|
|
68
|
-
break;
|
|
69
|
-
case NotebookCellsChangeType.OutputItem:
|
|
70
|
-
eventDto.rawEvents.push({
|
|
71
|
-
kind: e.kind,
|
|
72
|
-
index: e.index,
|
|
73
|
-
outputId: e.outputId,
|
|
74
|
-
outputItems: ( e.outputItems.map(NotebookDto.toNotebookOutputItemDto)),
|
|
75
|
-
append: e.append
|
|
76
|
-
});
|
|
77
|
-
break;
|
|
78
|
-
case NotebookCellsChangeType.ChangeCellLanguage:
|
|
79
|
-
case NotebookCellsChangeType.ChangeCellContent:
|
|
80
|
-
case NotebookCellsChangeType.ChangeCellMetadata:
|
|
81
|
-
case NotebookCellsChangeType.ChangeCellInternalMetadata:
|
|
82
|
-
eventDto.rawEvents.push(e);
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
const hasDocumentMetadataChangeEvent = event.rawEvents.find(e => e.kind === NotebookCellsChangeType.ChangeDocumentMetadata);
|
|
87
|
-
this._proxy.$acceptModelChanged(textModel.uri, ( new SerializableObjectWithBuffers(eventDto)), this._notebookEditorModelResolverService.isDirty(textModel.uri), hasDocumentMetadataChangeEvent ? textModel.metadata : undefined);
|
|
88
|
-
}));
|
|
89
|
-
this._documentEventListenersMapping.set(textModel.uri, disposableStore);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
handleNotebooksRemoved(uris) {
|
|
93
|
-
for (const uri of uris) {
|
|
94
|
-
this._documentEventListenersMapping.get(uri)?.dispose();
|
|
95
|
-
this._documentEventListenersMapping.delete(uri);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
async $tryCreateNotebook(options) {
|
|
99
|
-
if (options.content) {
|
|
100
|
-
const ref = await this._notebookEditorModelResolverService.resolve({
|
|
101
|
-
untitledResource: undefined
|
|
102
|
-
}, options.viewType);
|
|
103
|
-
Event.once(ref.object.notebook.onWillDispose)(() => {
|
|
104
|
-
ref.dispose();
|
|
105
|
-
});
|
|
106
|
-
this._proxy.$acceptDirtyStateChanged(ref.object.resource, true);
|
|
107
|
-
if (options.content) {
|
|
108
|
-
const data = NotebookDto.fromNotebookDataDto(options.content);
|
|
109
|
-
ref.object.notebook.reset(data.cells, data.metadata, ref.object.notebook.transientOptions);
|
|
110
|
-
}
|
|
111
|
-
return ref.object.notebook.uri;
|
|
112
|
-
} else {
|
|
113
|
-
const notebook = await this._notebookEditorModelResolverService.createUntitledNotebookTextModel(options.viewType);
|
|
114
|
-
return notebook.uri;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
async $tryOpenNotebook(uriComponents) {
|
|
118
|
-
const uri = URI.revive(uriComponents);
|
|
119
|
-
const ref = await this._notebookEditorModelResolverService.resolve(uri, undefined);
|
|
120
|
-
if (uriComponents.scheme === "untitled") {
|
|
121
|
-
ref.object.notebook.onWillDispose(() => {
|
|
122
|
-
ref.dispose();
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
this._modelReferenceCollection.add(uri, ref);
|
|
126
|
-
return uri;
|
|
127
|
-
}
|
|
128
|
-
async $trySaveNotebook(uriComponents) {
|
|
129
|
-
const uri = URI.revive(uriComponents);
|
|
130
|
-
const ref = await this._notebookEditorModelResolverService.resolve(uri);
|
|
131
|
-
const saveResult = await ref.object.save();
|
|
132
|
-
ref.dispose();
|
|
133
|
-
return saveResult;
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
MainThreadNotebookDocuments = ( __decorate([( __param(1, INotebookEditorModelResolverService)), ( __param(2, IUriIdentityService))], MainThreadNotebookDocuments));
|
|
137
|
-
|
|
138
|
-
export { MainThreadNotebookDocuments };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
2
|
-
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
3
|
-
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
|
|
4
|
-
import { INotebookEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service";
|
|
5
|
-
import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
6
|
-
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
7
|
-
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
8
|
-
export declare class MainThreadNotebooksAndEditors {
|
|
9
|
-
private readonly _notebookService;
|
|
10
|
-
private readonly _notebookEditorService;
|
|
11
|
-
private readonly _editorService;
|
|
12
|
-
private readonly _editorGroupService;
|
|
13
|
-
private readonly _logService;
|
|
14
|
-
private readonly _proxy;
|
|
15
|
-
private readonly _disposables;
|
|
16
|
-
private readonly _editorListeners;
|
|
17
|
-
private _currentState?;
|
|
18
|
-
private readonly _mainThreadNotebooks;
|
|
19
|
-
private readonly _mainThreadEditors;
|
|
20
|
-
constructor(extHostContext: IExtHostContext, instantiationService: IInstantiationService, _notebookService: INotebookService, _notebookEditorService: INotebookEditorService, _editorService: IEditorService, _editorGroupService: IEditorGroupsService, _logService: ILogService);
|
|
21
|
-
dispose(): void;
|
|
22
|
-
private _handleEditorAdd;
|
|
23
|
-
private _handleEditorRemove;
|
|
24
|
-
private _updateState;
|
|
25
|
-
private _onDelta;
|
|
26
|
-
private static _isDeltaEmpty;
|
|
27
|
-
private static _asModelAddData;
|
|
28
|
-
private _asEditorAddData;
|
|
29
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { diffSets, diffMaps } from '@codingame/monaco-vscode-api/vscode/vs/base/common/collections';
|
|
4
|
-
import { DisposableStore, DisposableMap, combinedDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
|
-
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
7
|
-
import { MainThreadNotebookDocuments } from './mainThreadNotebookDocuments.js';
|
|
8
|
-
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
9
|
-
import { MainThreadNotebookEditors } from './mainThreadNotebookEditors.js';
|
|
10
|
-
import { extHostCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
11
|
-
import { editorGroupToColumn } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupColumn';
|
|
12
|
-
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
13
|
-
import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
|
|
14
|
-
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
15
|
-
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
16
|
-
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
17
|
-
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
18
|
-
import { SerializableObjectWithBuffers } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/proxyIdentifier';
|
|
19
|
-
|
|
20
|
-
var MainThreadNotebooksAndEditors_1;
|
|
21
|
-
class NotebookAndEditorState {
|
|
22
|
-
static delta(before, after) {
|
|
23
|
-
if (!before) {
|
|
24
|
-
return {
|
|
25
|
-
addedDocuments: [...after.documents],
|
|
26
|
-
removedDocuments: [],
|
|
27
|
-
addedEditors: [...( after.textEditors.values())],
|
|
28
|
-
removedEditors: [],
|
|
29
|
-
visibleEditors: ( [...after.visibleEditors].map(editor => editor[0]))
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const documentDelta = diffSets(before.documents, after.documents);
|
|
33
|
-
const editorDelta = diffMaps(before.textEditors, after.textEditors);
|
|
34
|
-
const newActiveEditor = before.activeEditor !== after.activeEditor ? after.activeEditor : undefined;
|
|
35
|
-
const visibleEditorDelta = diffMaps(before.visibleEditors, after.visibleEditors);
|
|
36
|
-
return {
|
|
37
|
-
addedDocuments: documentDelta.added,
|
|
38
|
-
removedDocuments: ( documentDelta.removed.map(e => e.uri)),
|
|
39
|
-
addedEditors: editorDelta.added,
|
|
40
|
-
removedEditors: ( editorDelta.removed.map(removed => removed.getId())),
|
|
41
|
-
newActiveEditor: newActiveEditor,
|
|
42
|
-
visibleEditors: visibleEditorDelta.added.length === 0 && visibleEditorDelta.removed.length === 0 ? undefined : ( [...after.visibleEditors].map(editor => editor[0]))
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
constructor(documents, textEditors, activeEditor, visibleEditors) {
|
|
46
|
-
this.documents = documents;
|
|
47
|
-
this.textEditors = textEditors;
|
|
48
|
-
this.activeEditor = activeEditor;
|
|
49
|
-
this.visibleEditors = visibleEditors;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
let MainThreadNotebooksAndEditors = MainThreadNotebooksAndEditors_1 = class MainThreadNotebooksAndEditors {
|
|
53
|
-
constructor(
|
|
54
|
-
extHostContext,
|
|
55
|
-
instantiationService,
|
|
56
|
-
_notebookService,
|
|
57
|
-
_notebookEditorService,
|
|
58
|
-
_editorService,
|
|
59
|
-
_editorGroupService,
|
|
60
|
-
_logService
|
|
61
|
-
) {
|
|
62
|
-
this._notebookService = _notebookService;
|
|
63
|
-
this._notebookEditorService = _notebookEditorService;
|
|
64
|
-
this._editorService = _editorService;
|
|
65
|
-
this._editorGroupService = _editorGroupService;
|
|
66
|
-
this._logService = _logService;
|
|
67
|
-
this._disposables = ( new DisposableStore());
|
|
68
|
-
this._editorListeners = ( new DisposableMap());
|
|
69
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebook));
|
|
70
|
-
this._mainThreadNotebooks = instantiationService.createInstance(MainThreadNotebookDocuments, extHostContext);
|
|
71
|
-
this._mainThreadEditors = instantiationService.createInstance(MainThreadNotebookEditors, extHostContext);
|
|
72
|
-
extHostContext.set(MainContext.MainThreadNotebookDocuments, this._mainThreadNotebooks);
|
|
73
|
-
extHostContext.set(MainContext.MainThreadNotebookEditors, this._mainThreadEditors);
|
|
74
|
-
this._notebookService.onWillAddNotebookDocument(() => this._updateState(), this, this._disposables);
|
|
75
|
-
this._notebookService.onDidRemoveNotebookDocument(() => this._updateState(), this, this._disposables);
|
|
76
|
-
this._editorService.onDidActiveEditorChange(() => this._updateState(), this, this._disposables);
|
|
77
|
-
this._editorService.onDidVisibleEditorsChange(() => this._updateState(), this, this._disposables);
|
|
78
|
-
this._notebookEditorService.onDidAddNotebookEditor(this._handleEditorAdd, this, this._disposables);
|
|
79
|
-
this._notebookEditorService.onDidRemoveNotebookEditor(this._handleEditorRemove, this, this._disposables);
|
|
80
|
-
this._updateState();
|
|
81
|
-
}
|
|
82
|
-
dispose() {
|
|
83
|
-
this._mainThreadNotebooks.dispose();
|
|
84
|
-
this._mainThreadEditors.dispose();
|
|
85
|
-
this._disposables.dispose();
|
|
86
|
-
this._editorListeners.dispose();
|
|
87
|
-
}
|
|
88
|
-
_handleEditorAdd(editor) {
|
|
89
|
-
this._editorListeners.set(editor.getId(), combinedDisposable(
|
|
90
|
-
editor.onDidChangeModel(() => this._updateState()),
|
|
91
|
-
editor.onDidFocusWidget(() => this._updateState(editor))
|
|
92
|
-
));
|
|
93
|
-
this._updateState();
|
|
94
|
-
}
|
|
95
|
-
_handleEditorRemove(editor) {
|
|
96
|
-
this._editorListeners.deleteAndDispose(editor.getId());
|
|
97
|
-
this._updateState();
|
|
98
|
-
}
|
|
99
|
-
_updateState(focusedEditor) {
|
|
100
|
-
const editors = ( new Map());
|
|
101
|
-
const visibleEditorsMap = ( new Map());
|
|
102
|
-
for (const editor of this._notebookEditorService.listNotebookEditors()) {
|
|
103
|
-
if (editor.hasModel()) {
|
|
104
|
-
editors.set(editor.getId(), editor);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const activeNotebookEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
|
|
108
|
-
let activeEditor = null;
|
|
109
|
-
if (activeNotebookEditor) {
|
|
110
|
-
activeEditor = activeNotebookEditor.getId();
|
|
111
|
-
} else if (focusedEditor?.textModel) {
|
|
112
|
-
activeEditor = focusedEditor.getId();
|
|
113
|
-
}
|
|
114
|
-
if (activeEditor && !( editors.has(activeEditor))) {
|
|
115
|
-
this._logService.trace(
|
|
116
|
-
"MainThreadNotebooksAndEditors#_updateState: active editor is not in editors list",
|
|
117
|
-
activeEditor,
|
|
118
|
-
( editors.keys())
|
|
119
|
-
);
|
|
120
|
-
activeEditor = null;
|
|
121
|
-
}
|
|
122
|
-
for (const editorPane of this._editorService.visibleEditorPanes) {
|
|
123
|
-
const notebookEditor = getNotebookEditorFromEditorPane(editorPane);
|
|
124
|
-
if (notebookEditor?.hasModel() && ( editors.has(notebookEditor.getId()))) {
|
|
125
|
-
visibleEditorsMap.set(notebookEditor.getId(), notebookEditor);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
const newState = ( new NotebookAndEditorState(( new Set(this._notebookService.listNotebookDocuments())), editors, activeEditor, visibleEditorsMap));
|
|
129
|
-
this._onDelta(NotebookAndEditorState.delta(this._currentState, newState));
|
|
130
|
-
this._currentState = newState;
|
|
131
|
-
}
|
|
132
|
-
_onDelta(delta) {
|
|
133
|
-
if (MainThreadNotebooksAndEditors_1._isDeltaEmpty(delta)) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const dto = {
|
|
137
|
-
removedDocuments: delta.removedDocuments,
|
|
138
|
-
removedEditors: delta.removedEditors,
|
|
139
|
-
newActiveEditor: delta.newActiveEditor,
|
|
140
|
-
visibleEditors: delta.visibleEditors,
|
|
141
|
-
addedDocuments: ( delta.addedDocuments.map(MainThreadNotebooksAndEditors_1._asModelAddData)),
|
|
142
|
-
addedEditors: ( delta.addedEditors.map(this._asEditorAddData, this))
|
|
143
|
-
};
|
|
144
|
-
this._proxy.$acceptDocumentAndEditorsDelta(( new SerializableObjectWithBuffers(dto)));
|
|
145
|
-
this._mainThreadEditors.handleEditorsRemoved(delta.removedEditors);
|
|
146
|
-
this._mainThreadNotebooks.handleNotebooksRemoved(delta.removedDocuments);
|
|
147
|
-
this._mainThreadNotebooks.handleNotebooksAdded(delta.addedDocuments);
|
|
148
|
-
this._mainThreadEditors.handleEditorsAdded(delta.addedEditors);
|
|
149
|
-
}
|
|
150
|
-
static _isDeltaEmpty(delta) {
|
|
151
|
-
if (delta.addedDocuments !== undefined && delta.addedDocuments.length > 0) {
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
if (delta.removedDocuments !== undefined && delta.removedDocuments.length > 0) {
|
|
155
|
-
return false;
|
|
156
|
-
}
|
|
157
|
-
if (delta.addedEditors !== undefined && delta.addedEditors.length > 0) {
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
if (delta.removedEditors !== undefined && delta.removedEditors.length > 0) {
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
if (delta.visibleEditors !== undefined && delta.visibleEditors.length > 0) {
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
if (delta.newActiveEditor !== undefined) {
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
static _asModelAddData(e) {
|
|
172
|
-
return {
|
|
173
|
-
viewType: e.viewType,
|
|
174
|
-
uri: e.uri,
|
|
175
|
-
metadata: e.metadata,
|
|
176
|
-
versionId: e.versionId,
|
|
177
|
-
cells: ( e.cells.map(NotebookDto.toNotebookCellDto))
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
_asEditorAddData(add) {
|
|
181
|
-
const pane = this._editorService.visibleEditorPanes.find(pane => getNotebookEditorFromEditorPane(pane) === add);
|
|
182
|
-
return {
|
|
183
|
-
id: add.getId(),
|
|
184
|
-
documentUri: add.textModel.uri,
|
|
185
|
-
selections: add.getSelections(),
|
|
186
|
-
visibleRanges: add.visibleRanges,
|
|
187
|
-
viewColumn: pane && editorGroupToColumn(this._editorGroupService, pane.group),
|
|
188
|
-
viewType: add.getViewModel().viewType
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
MainThreadNotebooksAndEditors = MainThreadNotebooksAndEditors_1 = __decorate([extHostCustomer, ( __param(1, IInstantiationService)), ( __param(2, INotebookService)), ( __param(3, INotebookEditorService)), ( __param(4, IEditorService)), ( __param(5, IEditorGroupsService)), ( __param(6, ILogService))], MainThreadNotebooksAndEditors);
|
|
193
|
-
|
|
194
|
-
export { MainThreadNotebooksAndEditors };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as extHostProtocol from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
|
|
2
|
-
import * as notebookCommon from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
3
|
-
import { ICellExecuteUpdate, ICellExecutionComplete } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService";
|
|
4
|
-
export declare namespace NotebookDto {
|
|
5
|
-
function toNotebookOutputItemDto(item: notebookCommon.IOutputItemDto): extHostProtocol.NotebookOutputItemDto;
|
|
6
|
-
function toNotebookOutputDto(output: notebookCommon.IOutputDto): extHostProtocol.NotebookOutputDto;
|
|
7
|
-
function toNotebookCellDataDto(cell: notebookCommon.ICellDto2): extHostProtocol.NotebookCellDataDto;
|
|
8
|
-
function toNotebookDataDto(data: notebookCommon.NotebookData): extHostProtocol.NotebookDataDto;
|
|
9
|
-
function fromNotebookOutputItemDto(item: extHostProtocol.NotebookOutputItemDto): notebookCommon.IOutputItemDto;
|
|
10
|
-
function fromNotebookOutputDto(output: extHostProtocol.NotebookOutputDto): notebookCommon.IOutputDto;
|
|
11
|
-
function fromNotebookCellDataDto(cell: extHostProtocol.NotebookCellDataDto): notebookCommon.ICellDto2;
|
|
12
|
-
function fromNotebookDataDto(data: extHostProtocol.NotebookDataDto): notebookCommon.NotebookData;
|
|
13
|
-
function toNotebookCellDto(cell: notebookCommon.ICell): extHostProtocol.NotebookCellDto;
|
|
14
|
-
function fromCellExecuteUpdateDto(data: extHostProtocol.ICellExecuteUpdateDto): ICellExecuteUpdate;
|
|
15
|
-
function fromCellExecuteCompleteDto(data: extHostProtocol.ICellExecutionCompleteDto): ICellExecutionComplete;
|
|
16
|
-
function fromCellEditOperationDto(edit: extHostProtocol.ICellEditOperationDto): notebookCommon.ICellEditOperation;
|
|
17
|
-
}
|