@codingame/monaco-vscode-notebook-service-override 11.1.2 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -1
- package/index.js +64 -1
- package/package.json +47 -15
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +43 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +109 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +13 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +72 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +23 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +30 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.js +76 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +61 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +4 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +8 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +10 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +52 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +28 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +51 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +21 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +4 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +6 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.d.ts +69 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +460 -382
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +124 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +87 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +16 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +8 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +9 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +40 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts +112 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +115 -116
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +111 -117
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +11 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +5 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +7 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +113 -198
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +25 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +115 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +76 -147
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +45 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +30 -35
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +19 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +59 -52
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +11 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +69 -113
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +194 -184
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +51 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +14 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +57 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +29 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +17 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +14 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +21 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +7 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +30 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +6 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.d.ts +134 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +164 -121
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +37 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +6 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +131 -55
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +12 -10
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +75 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.js +2 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.d.ts +31 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +2 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.d.ts +78 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +45 -42
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.d.ts +96 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +57 -54
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.d.ts +74 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +6 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.d.ts +53 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +2 -1
- package/worker.js +2 -1
- package/workers/notebook.worker.d.ts +1 -0
- package/notebook.js +0 -50
- package/workers/notebook.worker.js +0 -1
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CodeWindow } from "vscode/vscode/vs/base/browser/window";
|
|
2
|
+
import { NotebookEditorWidget } from "@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/notebookEditorWidget";
|
|
3
|
+
import { DisposableStore } from "vscode/vscode/vs/base/common/lifecycle";
|
|
4
|
+
import { IEditorGroupsService } from "vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
5
|
+
import { IInstantiationService, ServicesAccessor } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
+
import { NotebookEditorInput } from "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput";
|
|
7
|
+
import { IBorrowValue } from "vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService";
|
|
8
|
+
import { INotebookEditorService } from "vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service";
|
|
9
|
+
import { INotebookEditor, INotebookEditorCreationOptions } from "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
10
|
+
import { Dimension } from "vscode/vscode/vs/base/browser/dom";
|
|
11
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
12
|
+
import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
13
|
+
import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
14
|
+
import { IEditorProgressService } from "vscode/vscode/vs/platform/progress/common/progress.service";
|
|
15
|
+
export declare class NotebookEditorWidgetService implements INotebookEditorService {
|
|
16
|
+
private readonly editorGroupService;
|
|
17
|
+
private readonly instantiationService;
|
|
18
|
+
readonly _serviceBrand: undefined;
|
|
19
|
+
private _tokenPool;
|
|
20
|
+
private readonly _disposables;
|
|
21
|
+
private readonly _notebookEditors;
|
|
22
|
+
private readonly groupListener;
|
|
23
|
+
private readonly _onNotebookEditorAdd;
|
|
24
|
+
private readonly _onNotebookEditorsRemove;
|
|
25
|
+
readonly onDidAddNotebookEditor: import("vscode/vscode/vs/base/common/event").Event<INotebookEditor>;
|
|
26
|
+
readonly onDidRemoveNotebookEditor: import("vscode/vscode/vs/base/common/event").Event<INotebookEditor>;
|
|
27
|
+
private readonly _mostRecentRepl;
|
|
28
|
+
private readonly _borrowableEditors;
|
|
29
|
+
constructor(editorGroupService: IEditorGroupsService, editorService: IEditorService, contextKeyService: IContextKeyService, instantiationService: IInstantiationService);
|
|
30
|
+
dispose(): void;
|
|
31
|
+
private _disposeWidget;
|
|
32
|
+
private _allowWidgetMove;
|
|
33
|
+
retrieveExistingWidgetFromURI(resource: URI): IBorrowValue<NotebookEditorWidget> | undefined;
|
|
34
|
+
retrieveAllExistingWidgets(): IBorrowValue<NotebookEditorWidget>[];
|
|
35
|
+
retrieveWidget(accessor: ServicesAccessor, groupId: number, input: NotebookEditorInput, creationOptions?: INotebookEditorCreationOptions, initialDimension?: Dimension, codeWindow?: CodeWindow): IBorrowValue<NotebookEditorWidget>;
|
|
36
|
+
protected createWidget(editorGroupContextKeyService: IContextKeyService, widgetDisposeStore: DisposableStore, editorGroupEditorProgressService: IEditorProgressService, creationOptions?: INotebookEditorCreationOptions, codeWindow?: CodeWindow, initialDimension?: Dimension): NotebookEditorWidget;
|
|
37
|
+
private _createBorrowValue;
|
|
38
|
+
addNotebookEditor(editor: INotebookEditor): void;
|
|
39
|
+
removeNotebookEditor(editor: INotebookEditor): void;
|
|
40
|
+
getNotebookEditor(editorId: string): INotebookEditor | undefined;
|
|
41
|
+
listNotebookEditors(): readonly INotebookEditor[];
|
|
42
|
+
updateReplContextKey(uri: string): void;
|
|
43
|
+
}
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
3
|
-
import { getDefaultNotebookCreationOptions, NotebookEditorWidget } from '@codingame/monaco-vscode-
|
|
4
|
+
import { getDefaultNotebookCreationOptions, NotebookEditorWidget } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/notebookEditorWidget';
|
|
4
5
|
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
6
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
6
7
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
|
-
import { NotebookEditorInput, isCompositeNotebookEditorInput, isNotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
8
|
+
import { NotebookEditorInput, isCompositeNotebookEditorInput, isNotebookEditorInput } from '@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
8
9
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
10
|
+
import { GroupModelChangeKind } from 'vscode/vscode/vs/workbench/common/editor';
|
|
9
11
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
10
12
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
11
|
-
import { InteractiveWindowOpen } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
13
|
+
import { MOST_RECENT_REPL_EDITOR, InteractiveWindowOpen } from '@codingame/monaco-vscode-4a36e358-d94d-55e0-86ee-3bcd543d9d3f-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
12
14
|
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
13
15
|
import { IEditorProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
|
|
14
16
|
|
|
@@ -43,6 +45,7 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
43
45
|
const value = widgets.splice(index, 1)[0];
|
|
44
46
|
value.token = undefined;
|
|
45
47
|
this._disposeWidget(value.widget);
|
|
48
|
+
value.disposableStore.dispose();
|
|
46
49
|
value.widget = undefined;
|
|
47
50
|
});
|
|
48
51
|
}));
|
|
@@ -73,18 +76,20 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
73
76
|
for (const value of values) {
|
|
74
77
|
value.token = undefined;
|
|
75
78
|
this._disposeWidget(value.widget);
|
|
79
|
+
value.disposableStore.dispose();
|
|
76
80
|
}
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
}));
|
|
84
|
+
this._mostRecentRepl = MOST_RECENT_REPL_EDITOR.bindTo(contextKeyService);
|
|
80
85
|
const interactiveWindowOpen = InteractiveWindowOpen.bindTo(contextKeyService);
|
|
81
86
|
this._disposables.add(editorService.onDidEditorsChange(e => {
|
|
82
|
-
if (e.event.kind ===
|
|
87
|
+
if (e.event.kind === GroupModelChangeKind.EDITOR_OPEN && !interactiveWindowOpen.get()) {
|
|
83
88
|
if (editorService.editors.find(editor => isCompositeNotebookEditorInput(editor))) {
|
|
84
89
|
interactiveWindowOpen.set(true);
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
|
-
else if (e.event.kind ===
|
|
92
|
+
else if (e.event.kind === GroupModelChangeKind.EDITOR_CLOSE && interactiveWindowOpen.get()) {
|
|
88
93
|
if (!editorService.editors.find(editor => isCompositeNotebookEditorInput(editor))) {
|
|
89
94
|
interactiveWindowOpen.set(false);
|
|
90
95
|
}
|
|
@@ -99,6 +104,11 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
99
104
|
listeners.forEach(listener => listener.dispose());
|
|
100
105
|
});
|
|
101
106
|
this.groupListener.clear();
|
|
107
|
+
this._borrowableEditors.forEach(widgetMap => {
|
|
108
|
+
widgetMap.forEach(widgets => {
|
|
109
|
+
widgets.forEach(widget => widget.disposableStore.dispose());
|
|
110
|
+
});
|
|
111
|
+
});
|
|
102
112
|
}
|
|
103
113
|
_disposeWidget(widget) {
|
|
104
114
|
widget.onWillHide();
|
|
@@ -161,9 +171,10 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
161
171
|
if (!value) {
|
|
162
172
|
const editorGroupContextKeyService = accessor.get(IContextKeyService);
|
|
163
173
|
const editorGroupEditorProgressService = accessor.get(IEditorProgressService);
|
|
164
|
-
const
|
|
174
|
+
const widgetDisposeStore = ( new DisposableStore());
|
|
175
|
+
const widget = this.createWidget(editorGroupContextKeyService, widgetDisposeStore, editorGroupEditorProgressService, creationOptions, codeWindow, initialDimension);
|
|
165
176
|
const token = this._tokenPool++;
|
|
166
|
-
value = { widget, editorType: input.typeId, token };
|
|
177
|
+
value = { widget, editorType: input.typeId, token, disposableStore: widgetDisposeStore };
|
|
167
178
|
let map = this._borrowableEditors.get(groupId);
|
|
168
179
|
if (!map) {
|
|
169
180
|
map = ( new ResourceMap());
|
|
@@ -178,11 +189,11 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
178
189
|
}
|
|
179
190
|
return this._createBorrowValue(value.token, value);
|
|
180
191
|
}
|
|
181
|
-
createWidget(editorGroupContextKeyService, editorGroupEditorProgressService, creationOptions, codeWindow, initialDimension) {
|
|
182
|
-
const notebookInstantiationService = this.instantiationService.createChild(( new ServiceCollection(
|
|
192
|
+
createWidget(editorGroupContextKeyService, widgetDisposeStore, editorGroupEditorProgressService, creationOptions, codeWindow, initialDimension) {
|
|
193
|
+
const notebookInstantiationService = widgetDisposeStore.add(this.instantiationService.createChild(( new ServiceCollection(
|
|
183
194
|
[IContextKeyService, editorGroupContextKeyService],
|
|
184
195
|
[IEditorProgressService, editorGroupEditorProgressService]
|
|
185
|
-
)));
|
|
196
|
+
))));
|
|
186
197
|
const ctorOptions = creationOptions ?? getDefaultNotebookCreationOptions();
|
|
187
198
|
const widget = notebookInstantiationService.createInstance(NotebookEditorWidget, {
|
|
188
199
|
...ctorOptions,
|
|
@@ -202,10 +213,14 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
202
213
|
this._onNotebookEditorAdd.fire(editor);
|
|
203
214
|
}
|
|
204
215
|
removeNotebookEditor(editor) {
|
|
216
|
+
const notebookUri = editor.getViewModel()?.notebookDocument.uri;
|
|
205
217
|
if (( this._notebookEditors.has(editor.getId()))) {
|
|
206
218
|
this._notebookEditors.delete(editor.getId());
|
|
207
219
|
this._onNotebookEditorsRemove.fire(editor);
|
|
208
220
|
}
|
|
221
|
+
if (this._mostRecentRepl.get() === notebookUri?.toString()) {
|
|
222
|
+
this._mostRecentRepl.reset();
|
|
223
|
+
}
|
|
209
224
|
}
|
|
210
225
|
getNotebookEditor(editorId) {
|
|
211
226
|
return this._notebookEditors.get(editorId);
|
|
@@ -213,6 +228,9 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
213
228
|
listNotebookEditors() {
|
|
214
229
|
return ( [...this._notebookEditors].map(e => e[1]));
|
|
215
230
|
}
|
|
231
|
+
updateReplContextKey(uri) {
|
|
232
|
+
this._mostRecentRepl.set(uri);
|
|
233
|
+
}
|
|
216
234
|
};
|
|
217
235
|
NotebookEditorWidgetService = ( __decorate([
|
|
218
236
|
( __param(0, IEditorGroupsService)),
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { ICommandService } from "vscode/vscode/vs/platform/commands/common/commands.service";
|
|
3
|
+
import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
4
|
+
import { IWorkspaceTrustRequestService } from "vscode/vscode/vs/platform/workspace/common/workspaceTrust.service";
|
|
5
|
+
import { NotebookCellTextModel } from "@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel";
|
|
6
|
+
import { INotebookTextModel } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
7
|
+
import { ICellExecutionParticipant } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionService";
|
|
8
|
+
import { INotebookExecutionService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionService.service";
|
|
9
|
+
import { INotebookExecutionStateService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service";
|
|
10
|
+
import { INotebookKernelHistoryService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service";
|
|
11
|
+
import { INotebookKernelService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service";
|
|
12
|
+
import { INotebookLoggingService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service";
|
|
13
|
+
export declare class NotebookExecutionService implements INotebookExecutionService, IDisposable {
|
|
14
|
+
private readonly _commandService;
|
|
15
|
+
private readonly _notebookKernelService;
|
|
16
|
+
private readonly _notebookKernelHistoryService;
|
|
17
|
+
private readonly _workspaceTrustRequestService;
|
|
18
|
+
private readonly _logService;
|
|
19
|
+
private readonly _notebookExecutionStateService;
|
|
20
|
+
_serviceBrand: undefined;
|
|
21
|
+
private _activeProxyKernelExecutionToken;
|
|
22
|
+
constructor(_commandService: ICommandService, _notebookKernelService: INotebookKernelService, _notebookKernelHistoryService: INotebookKernelHistoryService, _workspaceTrustRequestService: IWorkspaceTrustRequestService, _logService: INotebookLoggingService, _notebookExecutionStateService: INotebookExecutionStateService);
|
|
23
|
+
executeNotebookCells(notebook: INotebookTextModel, cells: Iterable<NotebookCellTextModel>, contextKeyService: IContextKeyService): Promise<void>;
|
|
24
|
+
cancelNotebookCellHandles(notebook: INotebookTextModel, cells: Iterable<number>): Promise<void>;
|
|
25
|
+
cancelNotebookCells(notebook: INotebookTextModel, cells: Iterable<NotebookCellTextModel>): Promise<void>;
|
|
26
|
+
private readonly cellExecutionParticipants;
|
|
27
|
+
registerExecutionParticipant(participant: ICellExecutionParticipant): IDisposable;
|
|
28
|
+
private runExecutionParticipants;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
4
5
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
5
6
|
import { IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
6
|
-
import { KernelPickerMRUStrategy } from '@codingame/monaco-vscode-
|
|
7
|
+
import { KernelPickerMRUStrategy } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy';
|
|
7
8
|
import { CellKind, NotebookCellExecutionState } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
8
9
|
import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service';
|
|
9
10
|
import { INotebookKernelService, INotebookKernelHistoryService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
|
|
@@ -17,7 +18,7 @@ let NotebookExecutionService = class NotebookExecutionService {
|
|
|
17
18
|
this._workspaceTrustRequestService = _workspaceTrustRequestService;
|
|
18
19
|
this._logService = _logService;
|
|
19
20
|
this._notebookExecutionStateService = _notebookExecutionStateService;
|
|
20
|
-
this.cellExecutionParticipants = (
|
|
21
|
+
this.cellExecutionParticipants = ( new Set());
|
|
21
22
|
}
|
|
22
23
|
async executeNotebookCells(notebook, cells, contextKeyService) {
|
|
23
24
|
const cellsArr = Array.from(cells)
|
|
@@ -25,8 +26,8 @@ let NotebookExecutionService = class NotebookExecutionService {
|
|
|
25
26
|
if (!cellsArr.length) {
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
|
-
this._logService.debug(`Execution`, `${JSON.stringify((
|
|
29
|
-
const message = ( localize(
|
|
29
|
+
this._logService.debug(`Execution`, `${JSON.stringify(( cellsArr.map(c => c.handle)))}`);
|
|
30
|
+
const message = ( localize(7742, "Executing a notebook cell will run code from this workspace."));
|
|
30
31
|
const trust = await this._workspaceTrustRequestService.requestWorkspaceTrust({ message });
|
|
31
32
|
if (!trust) {
|
|
32
33
|
return;
|
|
@@ -57,13 +58,13 @@ let NotebookExecutionService = class NotebookExecutionService {
|
|
|
57
58
|
if (validCellExecutions.length > 0) {
|
|
58
59
|
await this.runExecutionParticipants(validCellExecutions);
|
|
59
60
|
this._notebookKernelService.selectKernelForNotebook(kernel, notebook);
|
|
60
|
-
await kernel.executeNotebookCellsRequest(notebook.uri, (
|
|
61
|
+
await kernel.executeNotebookCellsRequest(notebook.uri, ( validCellExecutions.map(c => c.cellHandle)));
|
|
61
62
|
const unconfirmed = validCellExecutions.filter(exe => exe.state === NotebookCellExecutionState.Unconfirmed);
|
|
62
63
|
if (unconfirmed.length) {
|
|
63
|
-
this._logService.debug(`Execution`, `Completing unconfirmed executions ${JSON.stringify((
|
|
64
|
+
this._logService.debug(`Execution`, `Completing unconfirmed executions ${JSON.stringify(( unconfirmed.map(exe => exe.cellHandle)))}`);
|
|
64
65
|
unconfirmed.forEach(exe => exe.complete({}));
|
|
65
66
|
}
|
|
66
|
-
this._logService.debug(`Execution`, `Completed executions ${JSON.stringify((
|
|
67
|
+
this._logService.debug(`Execution`, `Completed executions ${JSON.stringify(( validCellExecutions.map(exe => exe.cellHandle)))}`);
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
async cancelNotebookCellHandles(notebook, cells) {
|
|
@@ -91,13 +92,13 @@ let NotebookExecutionService = class NotebookExecutionService {
|
|
|
91
92
|
this._activeProxyKernelExecutionToken?.dispose(true);
|
|
92
93
|
}
|
|
93
94
|
};
|
|
94
|
-
NotebookExecutionService = (
|
|
95
|
-
(
|
|
96
|
-
(
|
|
97
|
-
(
|
|
98
|
-
(
|
|
99
|
-
(
|
|
100
|
-
(
|
|
101
|
-
], NotebookExecutionService))
|
|
95
|
+
NotebookExecutionService = ( __decorate([
|
|
96
|
+
( __param(0, ICommandService)),
|
|
97
|
+
( __param(1, INotebookKernelService)),
|
|
98
|
+
( __param(2, INotebookKernelHistoryService)),
|
|
99
|
+
( __param(3, IWorkspaceTrustRequestService)),
|
|
100
|
+
( __param(4, INotebookLoggingService)),
|
|
101
|
+
( __param(5, INotebookExecutionStateService))
|
|
102
|
+
], NotebookExecutionService));
|
|
102
103
|
|
|
103
104
|
export { NotebookExecutionService };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
3
|
+
import { IAccessibilitySignalService } from "vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service";
|
|
4
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
|
+
import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
|
|
6
|
+
import { ICellExecutionStateChangedEvent, IExecutionStateChangedEvent, INotebookCellExecution, INotebookExecution, INotebookFailStateChangedEvent } from "@codingame/monaco-vscode-22790577-4553-50b6-978d-0acc75c394cc-common/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService";
|
|
7
|
+
import { INotebookExecutionStateService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service";
|
|
8
|
+
import { INotebookService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
9
|
+
export declare class NotebookExecutionStateService extends Disposable implements INotebookExecutionStateService {
|
|
10
|
+
private readonly _instantiationService;
|
|
11
|
+
private readonly _logService;
|
|
12
|
+
private readonly _notebookService;
|
|
13
|
+
private readonly _accessibilitySignalService;
|
|
14
|
+
_serviceBrand: undefined;
|
|
15
|
+
private readonly _executions;
|
|
16
|
+
private readonly _notebookExecutions;
|
|
17
|
+
private readonly _notebookListeners;
|
|
18
|
+
private readonly _cellListeners;
|
|
19
|
+
private readonly _lastFailedCells;
|
|
20
|
+
private readonly _lastCompletedCellHandles;
|
|
21
|
+
private readonly _onDidChangeExecution;
|
|
22
|
+
onDidChangeExecution: import("vscode/vscode/vs/base/common/event").Event<ICellExecutionStateChangedEvent | IExecutionStateChangedEvent>;
|
|
23
|
+
private readonly _onDidChangeLastRunFailState;
|
|
24
|
+
onDidChangeLastRunFailState: import("vscode/vscode/vs/base/common/event").Event<INotebookFailStateChangedEvent>;
|
|
25
|
+
constructor(_instantiationService: IInstantiationService, _logService: ILogService, _notebookService: INotebookService, _accessibilitySignalService: IAccessibilitySignalService);
|
|
26
|
+
getLastFailedCellForNotebook(notebook: URI): number | undefined;
|
|
27
|
+
getLastCompletedCellForNotebook(notebook: URI): number | undefined;
|
|
28
|
+
forceCancelNotebookExecutions(notebookUri: URI): void;
|
|
29
|
+
getCellExecution(cellUri: URI): INotebookCellExecution | undefined;
|
|
30
|
+
getExecution(notebook: URI): INotebookExecution | undefined;
|
|
31
|
+
getCellExecutionsForNotebook(notebook: URI): INotebookCellExecution[];
|
|
32
|
+
getCellExecutionsByHandleForNotebook(notebook: URI): Map<number, INotebookCellExecution> | undefined;
|
|
33
|
+
private _onCellExecutionDidChange;
|
|
34
|
+
private _onCellExecutionDidComplete;
|
|
35
|
+
private _onExecutionDidChange;
|
|
36
|
+
private _onExecutionDidComplete;
|
|
37
|
+
createCellExecution(notebookUri: URI, cellHandle: number): INotebookCellExecution;
|
|
38
|
+
createExecution(notebookUri: URI): INotebookExecution;
|
|
39
|
+
private _createNotebookCellExecution;
|
|
40
|
+
private _createNotebookExecution;
|
|
41
|
+
private _setLastFailedCell;
|
|
42
|
+
private _setLastFailedCellVisibility;
|
|
43
|
+
private _clearLastFailedCell;
|
|
44
|
+
private _getFailedCellListener;
|
|
45
|
+
dispose(): void;
|
|
46
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
3
4
|
import { Disposable, combinedDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
5
|
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
@@ -8,10 +9,10 @@ import { AccessibilitySignal } from 'vscode/vscode/vs/platform/accessibilitySign
|
|
|
8
9
|
import { IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
9
10
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
11
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
11
|
-
import { CellUri, NotebookCellExecutionState, NotebookExecutionState } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
12
|
+
import { CellUri, NotebookCellExecutionState, CellEditType, NotebookExecutionState } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
12
13
|
import { CellExecutionUpdateType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionService';
|
|
13
14
|
import { INotebookExecutionService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionService.service';
|
|
14
|
-
import { NotebookExecutionType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
|
|
15
|
+
import { NotebookExecutionType } from '@codingame/monaco-vscode-22790577-4553-50b6-978d-0acc75c394cc-common/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
|
|
15
16
|
import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service';
|
|
16
17
|
import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
|
|
17
18
|
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
@@ -28,6 +29,7 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
|
|
|
28
29
|
this._notebookListeners = ( new ResourceMap());
|
|
29
30
|
this._cellListeners = ( new ResourceMap());
|
|
30
31
|
this._lastFailedCells = ( new ResourceMap());
|
|
32
|
+
this._lastCompletedCellHandles = ( new ResourceMap());
|
|
31
33
|
this._onDidChangeExecution = this._register(( new Emitter()));
|
|
32
34
|
this.onDidChangeExecution = this._onDidChangeExecution.event;
|
|
33
35
|
this._onDidChangeLastRunFailState = this._register(( new Emitter()));
|
|
@@ -37,6 +39,9 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
|
|
|
37
39
|
const failedCell = this._lastFailedCells.get(notebook);
|
|
38
40
|
return failedCell?.visible ? failedCell.cellHandle : undefined;
|
|
39
41
|
}
|
|
42
|
+
getLastCompletedCellForNotebook(notebook) {
|
|
43
|
+
return this._lastCompletedCellHandles.get(notebook);
|
|
44
|
+
}
|
|
40
45
|
forceCancelNotebookExecutions(notebookUri) {
|
|
41
46
|
const notebookCellExecutions = this._executions.get(notebookUri);
|
|
42
47
|
if (notebookCellExecutions) {
|
|
@@ -100,6 +105,7 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
|
|
|
100
105
|
this._accessibilitySignalService.playSignal(AccessibilitySignal.notebookCellFailed);
|
|
101
106
|
this._setLastFailedCell(notebookUri, cellHandle);
|
|
102
107
|
}
|
|
108
|
+
this._lastCompletedCellHandles.set(notebookUri, cellHandle);
|
|
103
109
|
}
|
|
104
110
|
this._onDidChangeExecution.fire(( new NotebookCellExecutionEvent(notebookUri, cellHandle)));
|
|
105
111
|
}
|
|
@@ -334,7 +340,7 @@ NotebookExecutionListeners = ( __decorate([
|
|
|
334
340
|
function updateToEdit(update, cellHandle) {
|
|
335
341
|
if (update.editType === CellExecutionUpdateType.Output) {
|
|
336
342
|
return {
|
|
337
|
-
editType:
|
|
343
|
+
editType: CellEditType.Output,
|
|
338
344
|
handle: update.cellHandle,
|
|
339
345
|
append: update.append,
|
|
340
346
|
outputs: update.outputs,
|
|
@@ -342,7 +348,7 @@ function updateToEdit(update, cellHandle) {
|
|
|
342
348
|
}
|
|
343
349
|
else if (update.editType === CellExecutionUpdateType.OutputItems) {
|
|
344
350
|
return {
|
|
345
|
-
editType:
|
|
351
|
+
editType: CellEditType.OutputItems,
|
|
346
352
|
items: update.items,
|
|
347
353
|
append: update.append,
|
|
348
354
|
outputId: update.outputId
|
|
@@ -357,7 +363,7 @@ function updateToEdit(update, cellHandle) {
|
|
|
357
363
|
newInternalMetadata.runStartTime = update.runStartTime;
|
|
358
364
|
}
|
|
359
365
|
return {
|
|
360
|
-
editType:
|
|
366
|
+
editType: CellEditType.PartialInternalMetadata,
|
|
361
367
|
handle: cellHandle,
|
|
362
368
|
internalMetadata: newInternalMetadata
|
|
363
369
|
};
|
|
@@ -393,7 +399,7 @@ let CellExecution = class CellExecution extends Disposable {
|
|
|
393
399
|
}
|
|
394
400
|
initialize() {
|
|
395
401
|
const startExecuteEdit = {
|
|
396
|
-
editType:
|
|
402
|
+
editType: CellEditType.PartialInternalMetadata,
|
|
397
403
|
handle: this.cellHandle,
|
|
398
404
|
internalMetadata: {
|
|
399
405
|
executionId: generateUuid(),
|
|
@@ -449,7 +455,7 @@ let CellExecution = class CellExecution extends Disposable {
|
|
|
449
455
|
}
|
|
450
456
|
else {
|
|
451
457
|
const edit = {
|
|
452
|
-
editType:
|
|
458
|
+
editType: CellEditType.PartialInternalMetadata,
|
|
453
459
|
handle: this.cellHandle,
|
|
454
460
|
internalMetadata: {
|
|
455
461
|
lastRunSuccess: completionData.lastRunSuccess,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
|
|
3
|
+
import { INotebookKernel, INotebookTextModelLike } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService";
|
|
4
|
+
import { INotebookKernelHistoryService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service";
|
|
5
|
+
import { INotebookKernelService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service";
|
|
6
|
+
import { INotebookLoggingService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service";
|
|
7
|
+
export declare class NotebookKernelHistoryService extends Disposable implements INotebookKernelHistoryService {
|
|
8
|
+
private readonly _storageService;
|
|
9
|
+
private readonly _notebookKernelService;
|
|
10
|
+
private readonly _notebookLoggingService;
|
|
11
|
+
_serviceBrand: undefined;
|
|
12
|
+
private static STORAGE_KEY;
|
|
13
|
+
private _mostRecentKernelsMap;
|
|
14
|
+
constructor(_storageService: IStorageService, _notebookKernelService: INotebookKernelService, _notebookLoggingService: INotebookLoggingService);
|
|
15
|
+
getKernels(notebook: INotebookTextModelLike): {
|
|
16
|
+
selected: INotebookKernel | undefined;
|
|
17
|
+
all: INotebookKernel[];
|
|
18
|
+
};
|
|
19
|
+
addMostRecentKernel(kernel: INotebookKernel): void;
|
|
20
|
+
private _saveState;
|
|
21
|
+
private _loadState;
|
|
22
|
+
private _serialize;
|
|
23
|
+
private _deserialize;
|
|
24
|
+
_clear(): void;
|
|
25
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
3
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { LinkedMap, Touch } from 'vscode/vscode/vs/base/common/map';
|
|
4
5
|
import { localize2 } from 'vscode/vscode/vs/nls';
|
|
5
6
|
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
6
7
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
8
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
7
9
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
8
10
|
import { INotebookKernelService, INotebookKernelHistoryService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
|
|
9
11
|
import { INotebookLoggingService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service';
|
|
@@ -21,7 +23,7 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
|
|
|
21
23
|
this._mostRecentKernelsMap = {};
|
|
22
24
|
this._loadState();
|
|
23
25
|
this._register(this._storageService.onWillSaveState(() => this._saveState()));
|
|
24
|
-
this._register(this._storageService.onDidChangeValue(
|
|
26
|
+
this._register(this._storageService.onDidChangeValue(StorageScope.WORKSPACE, NotebookKernelHistoryService_1.STORAGE_KEY, this._store)(() => {
|
|
25
27
|
this._loadState();
|
|
26
28
|
}));
|
|
27
29
|
}
|
|
@@ -31,8 +33,8 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
|
|
|
31
33
|
const selectedKernel = allAvailableKernels.selected;
|
|
32
34
|
const suggested = allAvailableKernels.all.length === 1 ? allAvailableKernels.all[0] : undefined;
|
|
33
35
|
this._notebookLoggingService.debug('History', `getMatchingKernels: ${allAvailableKernels.all.length} kernels available for ${notebook.uri.path}. Selected: ${allAvailableKernels.selected?.label}. Suggested: ${suggested?.label}`);
|
|
34
|
-
const mostRecentKernelIds = this._mostRecentKernelsMap[notebook.notebookType] ? [...(
|
|
35
|
-
const all = (
|
|
36
|
+
const mostRecentKernelIds = this._mostRecentKernelsMap[notebook.notebookType] ? [...( this._mostRecentKernelsMap[notebook.notebookType].values())] : [];
|
|
37
|
+
const all = ( mostRecentKernelIds.map(kernelId => allKernels.find(kernel => kernel.id === kernelId))).filter(kernel => !!kernel);
|
|
36
38
|
this._notebookLoggingService.debug('History', `mru: ${mostRecentKernelIds.length} kernels in history, ${all.length} registered already.`);
|
|
37
39
|
return {
|
|
38
40
|
selected: selectedKernel ?? suggested,
|
|
@@ -42,8 +44,8 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
|
|
|
42
44
|
addMostRecentKernel(kernel) {
|
|
43
45
|
const key = kernel.id;
|
|
44
46
|
const viewType = kernel.viewType;
|
|
45
|
-
const recentKeynels = this._mostRecentKernelsMap[viewType] ?? (
|
|
46
|
-
recentKeynels.set(key, key,
|
|
47
|
+
const recentKeynels = this._mostRecentKernelsMap[viewType] ?? ( new LinkedMap());
|
|
48
|
+
recentKeynels.set(key, key, Touch.AsOld);
|
|
47
49
|
if (recentKeynels.size > MAX_KERNELS_IN_HISTORY) {
|
|
48
50
|
const reserved = [...recentKeynels.entries()].slice(0, MAX_KERNELS_IN_HISTORY);
|
|
49
51
|
recentKeynels.fromJSON(reserved);
|
|
@@ -57,14 +59,14 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
|
|
|
57
59
|
}
|
|
58
60
|
if (notEmpty) {
|
|
59
61
|
const serialized = this._serialize();
|
|
60
|
-
this._storageService.store(NotebookKernelHistoryService_1.STORAGE_KEY, JSON.stringify(serialized),
|
|
62
|
+
this._storageService.store(NotebookKernelHistoryService_1.STORAGE_KEY, JSON.stringify(serialized), StorageScope.WORKSPACE, StorageTarget.USER);
|
|
61
63
|
}
|
|
62
64
|
else {
|
|
63
|
-
this._storageService.remove(NotebookKernelHistoryService_1.STORAGE_KEY,
|
|
65
|
+
this._storageService.remove(NotebookKernelHistoryService_1.STORAGE_KEY, StorageScope.WORKSPACE);
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
_loadState() {
|
|
67
|
-
const serialized = this._storageService.get(NotebookKernelHistoryService_1.STORAGE_KEY,
|
|
69
|
+
const serialized = this._storageService.get(NotebookKernelHistoryService_1.STORAGE_KEY, StorageScope.WORKSPACE);
|
|
68
70
|
if (serialized) {
|
|
69
71
|
try {
|
|
70
72
|
this._deserialize(JSON.parse(serialized));
|
|
@@ -81,7 +83,7 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
|
|
|
81
83
|
const result = Object.create(null);
|
|
82
84
|
for (const [viewType, kernels] of Object.entries(this._mostRecentKernelsMap)) {
|
|
83
85
|
result[viewType] = {
|
|
84
|
-
entries: [...(
|
|
86
|
+
entries: [...( kernels.values())]
|
|
85
87
|
};
|
|
86
88
|
}
|
|
87
89
|
return result;
|
|
@@ -89,7 +91,7 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
|
|
|
89
91
|
_deserialize(serialized) {
|
|
90
92
|
this._mostRecentKernelsMap = {};
|
|
91
93
|
for (const [viewType, kernels] of Object.entries(serialized)) {
|
|
92
|
-
const linkedMap = (
|
|
94
|
+
const linkedMap = ( new LinkedMap());
|
|
93
95
|
const mapValues = [];
|
|
94
96
|
for (const entry of kernels.entries) {
|
|
95
97
|
mapValues.push([entry, entry]);
|
|
@@ -103,16 +105,16 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
|
|
|
103
105
|
this._saveState();
|
|
104
106
|
}
|
|
105
107
|
};
|
|
106
|
-
NotebookKernelHistoryService = NotebookKernelHistoryService_1 = (
|
|
107
|
-
(
|
|
108
|
-
(
|
|
109
|
-
(
|
|
110
|
-
], NotebookKernelHistoryService))
|
|
108
|
+
NotebookKernelHistoryService = NotebookKernelHistoryService_1 = ( __decorate([
|
|
109
|
+
( __param(0, IStorageService)),
|
|
110
|
+
( __param(1, INotebookKernelService)),
|
|
111
|
+
( __param(2, INotebookLoggingService))
|
|
112
|
+
], NotebookKernelHistoryService));
|
|
111
113
|
registerAction2(class extends Action2 {
|
|
112
114
|
constructor() {
|
|
113
115
|
super({
|
|
114
116
|
id: 'notebook.clearNotebookKernelsMRUCache',
|
|
115
|
-
title: ( localize2(
|
|
117
|
+
title: ( localize2(7743, "Clear Notebook Kernels MRU Cache")),
|
|
116
118
|
category: Categories.Developer,
|
|
117
119
|
f1: true
|
|
118
120
|
});
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Event } from "vscode/vscode/vs/base/common/event";
|
|
2
|
+
import { Disposable, IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { INotebookKernelSourceAction, INotebookTextModel } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
4
|
+
import { INotebookKernel, ISelectedNotebooksChangeEvent, INotebookKernelMatchResult, INotebookTextModelLike, ISourceAction, INotebookSourceActionChangeEvent, INotebookKernelDetectionTask, IKernelSourceActionProvider } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService";
|
|
5
|
+
import { INotebookKernelService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service";
|
|
6
|
+
import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
|
|
7
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
8
|
+
import { INotebookService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
9
|
+
import { IMenuService } from "vscode/vscode/vs/platform/actions/common/actions.service";
|
|
10
|
+
import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
11
|
+
export declare class NotebookKernelService extends Disposable implements INotebookKernelService {
|
|
12
|
+
private readonly _notebookService;
|
|
13
|
+
private readonly _storageService;
|
|
14
|
+
private readonly _menuService;
|
|
15
|
+
private readonly _contextKeyService;
|
|
16
|
+
_serviceBrand: undefined;
|
|
17
|
+
private readonly _kernels;
|
|
18
|
+
private readonly _notebookBindings;
|
|
19
|
+
private readonly _onDidChangeNotebookKernelBinding;
|
|
20
|
+
private readonly _onDidAddKernel;
|
|
21
|
+
private readonly _onDidRemoveKernel;
|
|
22
|
+
private readonly _onDidChangeNotebookAffinity;
|
|
23
|
+
private readonly _onDidChangeSourceActions;
|
|
24
|
+
private readonly _onDidNotebookVariablesChange;
|
|
25
|
+
private readonly _kernelSources;
|
|
26
|
+
private readonly _kernelSourceActionsUpdates;
|
|
27
|
+
private readonly _kernelDetectionTasks;
|
|
28
|
+
private readonly _onDidChangeKernelDetectionTasks;
|
|
29
|
+
private readonly _kernelSourceActionProviders;
|
|
30
|
+
readonly onDidChangeSelectedNotebooks: Event<ISelectedNotebooksChangeEvent>;
|
|
31
|
+
readonly onDidAddKernel: Event<INotebookKernel>;
|
|
32
|
+
readonly onDidRemoveKernel: Event<INotebookKernel>;
|
|
33
|
+
readonly onDidChangeNotebookAffinity: Event<void>;
|
|
34
|
+
readonly onDidChangeSourceActions: Event<INotebookSourceActionChangeEvent>;
|
|
35
|
+
readonly onDidChangeKernelDetectionTasks: Event<string>;
|
|
36
|
+
readonly onDidNotebookVariablesUpdate: Event<URI>;
|
|
37
|
+
private static _storageNotebookBinding;
|
|
38
|
+
constructor(_notebookService: INotebookService, _storageService: IStorageService, _menuService: IMenuService, _contextKeyService: IContextKeyService);
|
|
39
|
+
dispose(): void;
|
|
40
|
+
private _persistSoonHandle?;
|
|
41
|
+
private _persistMementos;
|
|
42
|
+
private static _score;
|
|
43
|
+
private _tryAutoBindNotebook;
|
|
44
|
+
notifyVariablesChange(notebookUri: URI): void;
|
|
45
|
+
registerKernel(kernel: INotebookKernel): IDisposable;
|
|
46
|
+
getMatchingKernel(notebook: INotebookTextModelLike): INotebookKernelMatchResult;
|
|
47
|
+
getSelectedOrSuggestedKernel(notebook: INotebookTextModel): INotebookKernel | undefined;
|
|
48
|
+
selectKernelForNotebook(kernel: INotebookKernel | undefined, notebook: INotebookTextModelLike): void;
|
|
49
|
+
preselectKernelForNotebook(kernel: INotebookKernel, notebook: INotebookTextModelLike): void;
|
|
50
|
+
updateKernelNotebookAffinity(kernel: INotebookKernel, notebook: URI, preference: number | undefined): void;
|
|
51
|
+
getRunningSourceActions(notebook: INotebookTextModelLike): ISourceAction[];
|
|
52
|
+
getSourceActions(notebook: INotebookTextModelLike, contextKeyService: IContextKeyService | undefined): ISourceAction[];
|
|
53
|
+
registerNotebookKernelDetectionTask(task: INotebookKernelDetectionTask): IDisposable;
|
|
54
|
+
getKernelDetectionTasks(notebook: INotebookTextModelLike): INotebookKernelDetectionTask[];
|
|
55
|
+
registerKernelSourceActionProvider(viewType: string, provider: IKernelSourceActionProvider): IDisposable;
|
|
56
|
+
getKernelSourceActions2(notebook: INotebookTextModelLike): Promise<INotebookKernelSourceAction[]>;
|
|
57
|
+
}
|