@codingame/monaco-vscode-notebook-service-override 37.2.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 -2
- package/package.json +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +6 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +6 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +8 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +26 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +21 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +36 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +16 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +29 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +11 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +40 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +33 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +22 -22
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +25 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +73 -73
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +35 -35
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/replEditorAccessibleView.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +15 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +28 -28
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.js +44 -18
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/repl.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorAccessibilityHelp.js +14 -14
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +2 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +12 -12
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +5 -5
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js
CHANGED
|
@@ -13,7 +13,7 @@ let NotebookLoggingService = class NotebookLoggingService extends Disposable {
|
|
|
13
13
|
constructor(loggerService) {
|
|
14
14
|
super();
|
|
15
15
|
this._logger = this._register(loggerService.createLogger(logChannelId, {
|
|
16
|
-
name: ( localize(
|
|
16
|
+
name: ( localize(16953, "Notebook")),
|
|
17
17
|
group: windowLogGroup
|
|
18
18
|
}));
|
|
19
19
|
}
|
|
@@ -15,7 +15,7 @@ let NotebookRendererMessagingService = class NotebookRendererMessagingService ex
|
|
|
15
15
|
}
|
|
16
16
|
receiveMessage(editorId, rendererId, message) {
|
|
17
17
|
if (editorId === undefined) {
|
|
18
|
-
const sends =
|
|
18
|
+
const sends = [...( this.scopedMessaging.values())].map(e => e.receiveMessageHandler?.(rendererId, message));
|
|
19
19
|
return Promise.all(sends).then(s => ( s.some(s => !!s)));
|
|
20
20
|
}
|
|
21
21
|
return this.scopedMessaging.get(editorId)?.receiveMessageHandler?.(rendererId, message) ?? Promise.resolve(false);
|
|
@@ -7,7 +7,7 @@ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
7
7
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
8
8
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
9
9
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
10
|
-
import { NotebookCellTextModel } from "@codingame/monaco-vscode-
|
|
10
|
+
import { NotebookCellTextModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel";
|
|
11
11
|
import { NotebookTextModel } from "../../common/model/notebookTextModel.js";
|
|
12
12
|
import { INotebookContributionData, INotebookRendererInfo, IOrderedMimeType, IOutputDto, NotebookExtensionDescription, INotebookStaticPreloadInfo } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
13
13
|
import { INotebookEditorModelResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service";
|
|
@@ -446,7 +446,7 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
|
446
446
|
const preferred = notebookProviderInfo && this.preferredMimetype.value[notebookProviderInfo.id]?.[mimeType];
|
|
447
447
|
const notebookExtId = notebookProviderInfo?.extension?.value;
|
|
448
448
|
const notebookId = notebookProviderInfo?.id;
|
|
449
|
-
const renderers =
|
|
449
|
+
const renderers = Array.from(( this.contributedRenderers.values())).map(renderer => {
|
|
450
450
|
const ownScore = kernelProvides === undefined ? renderer.matchesWithoutKernel(mimeType) : renderer.matches(mimeType, kernelProvides);
|
|
451
451
|
if (ownScore === NotebookRendererMatch.Never) {
|
|
452
452
|
return undefined;
|
|
@@ -461,7 +461,7 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
|
461
461
|
},
|
|
462
462
|
score: reuseScore | ownScore
|
|
463
463
|
};
|
|
464
|
-
})
|
|
464
|
+
}).filter(isDefined);
|
|
465
465
|
if (renderers.length === 0) {
|
|
466
466
|
return [{
|
|
467
467
|
mimeType,
|
|
@@ -469,7 +469,7 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
|
469
469
|
isTrusted: true
|
|
470
470
|
}];
|
|
471
471
|
}
|
|
472
|
-
return
|
|
472
|
+
return renderers.sort((a, b) => a.score - b.score).map(r => r.ordered);
|
|
473
473
|
}
|
|
474
474
|
};
|
|
475
475
|
NotebookOutputRendererInfoStore = ( __decorate([( __param(0, IStorageService))], NotebookOutputRendererInfoStore));
|
|
@@ -610,11 +610,11 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
610
610
|
this._viewTypeCache = this._memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
611
611
|
}
|
|
612
612
|
getEditorTypes() {
|
|
613
|
-
return
|
|
613
|
+
return [...this.notebookProviderInfoStore].map(info => ({
|
|
614
614
|
id: info.id,
|
|
615
615
|
displayName: info.displayName,
|
|
616
616
|
providerDisplayName: info.providerDisplayName
|
|
617
|
-
}))
|
|
617
|
+
}));
|
|
618
618
|
}
|
|
619
619
|
clearEditorCache() {
|
|
620
620
|
this.notebookProviderInfoStore.clearEditorCache();
|
|
@@ -675,7 +675,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
675
675
|
const knownProvider = this.getViewTypeProvider(viewType);
|
|
676
676
|
const actions = knownProvider ? [toAction({
|
|
677
677
|
id: "workbench.notebook.action.installMissingViewType",
|
|
678
|
-
label: ( localize(
|
|
678
|
+
label: ( localize(16954, "Install extension for '{0}'", viewType)),
|
|
679
679
|
run: async () => {
|
|
680
680
|
await this._instantiationService.createInstance(InstallRecommendedExtensionAction, knownProvider).run();
|
|
681
681
|
}
|
|
@@ -796,10 +796,10 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
796
796
|
return this._models.get(uri)?.model;
|
|
797
797
|
}
|
|
798
798
|
getNotebookTextModels() {
|
|
799
|
-
return
|
|
799
|
+
return Iterable.map(( this._models.values()), data => data.model);
|
|
800
800
|
}
|
|
801
801
|
listNotebookDocuments() {
|
|
802
|
-
return
|
|
802
|
+
return [...this._models].map(e => e[1].model);
|
|
803
803
|
}
|
|
804
804
|
_onWillDisposeDocument(model) {
|
|
805
805
|
const modelData = this._models.get(model.uri);
|
|
@@ -812,7 +812,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
getOutputMimeTypeInfo(textModel, kernelProvides, output) {
|
|
815
|
-
const sorted = this._displayOrder.sort(( new Set(
|
|
815
|
+
const sorted = this._displayOrder.sort(( new Set(output.outputs.map(op => op.mime))));
|
|
816
816
|
const notebookProviderInfo = this.notebookProviderInfoStore.get(textModel.viewType);
|
|
817
817
|
return sorted.flatMap(
|
|
818
818
|
mimeType => this._notebookRenderersInfoStore.findBestRenderers(notebookProviderInfo, mimeType, kernelProvides)
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js
CHANGED
|
@@ -72,7 +72,7 @@ class NotebookEditorModelManager extends Disposable {
|
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
const modelUrl = ( resource.toString());
|
|
75
|
-
this._proxy.$acceptNewModel(( model.uri.toString()), model.metadata, model.transientOptions.transientDocumentMetadata,
|
|
75
|
+
this._proxy.$acceptNewModel(( model.uri.toString()), model.metadata, model.transientOptions.transientDocumentMetadata, model.cells.map(cell => ({
|
|
76
76
|
handle: cell.handle,
|
|
77
77
|
url: ( cell.uri.toString()),
|
|
78
78
|
source: cell.textBuffer.getLinesContent(),
|
|
@@ -81,13 +81,13 @@ class NotebookEditorModelManager extends Disposable {
|
|
|
81
81
|
language: cell.language,
|
|
82
82
|
mime: cell.mime,
|
|
83
83
|
cellKind: cell.cellKind,
|
|
84
|
-
outputs:
|
|
84
|
+
outputs: cell.outputs.map(op => ({
|
|
85
85
|
outputId: op.outputId,
|
|
86
86
|
outputs: op.outputs
|
|
87
|
-
}))
|
|
87
|
+
})),
|
|
88
88
|
metadata: cell.metadata,
|
|
89
89
|
internalMetadata: cell.internalMetadata
|
|
90
|
-
})))
|
|
90
|
+
})));
|
|
91
91
|
const toDispose = ( new DisposableStore());
|
|
92
92
|
const cellToDto = cell => {
|
|
93
93
|
return {
|
|
@@ -98,10 +98,10 @@ class NotebookEditorModelManager extends Disposable {
|
|
|
98
98
|
versionId: 0,
|
|
99
99
|
language: cell.language,
|
|
100
100
|
cellKind: cell.cellKind,
|
|
101
|
-
outputs:
|
|
101
|
+
outputs: cell.outputs.map(op => ({
|
|
102
102
|
outputId: op.outputId,
|
|
103
103
|
outputs: op.outputs
|
|
104
|
-
}))
|
|
104
|
+
})),
|
|
105
105
|
metadata: cell.metadata,
|
|
106
106
|
internalMetadata: cell.internalMetadata
|
|
107
107
|
};
|
|
@@ -140,7 +140,7 @@ class NotebookEditorModelManager extends Disposable {
|
|
|
140
140
|
{
|
|
141
141
|
dto.push({
|
|
142
142
|
kind: e.kind,
|
|
143
|
-
changes:
|
|
143
|
+
changes: e.changes.map(diff => [diff[0], diff[1], diff[2].map(cell => cellToDto(cell))])
|
|
144
144
|
});
|
|
145
145
|
for (const change of e.changes) {
|
|
146
146
|
for (const cell of change[2]) {
|
|
@@ -156,7 +156,7 @@ class NotebookEditorModelManager extends Disposable {
|
|
|
156
156
|
index: e.index,
|
|
157
157
|
length: e.length,
|
|
158
158
|
newIdx: e.newIdx,
|
|
159
|
-
cells:
|
|
159
|
+
cells: e.cells.map(cell => cellToDto(cell))
|
|
160
160
|
});
|
|
161
161
|
break;
|
|
162
162
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
3
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
4
4
|
import { MarkerSeverity } from '@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers';
|
|
5
|
-
import { executingStateIcon } from '@codingame/monaco-vscode-
|
|
5
|
+
import { executingStateIcon } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
6
6
|
import { CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
7
7
|
import { SymbolKinds } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
|
|
8
8
|
|
package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js
CHANGED
|
@@ -3,7 +3,7 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { renderAsPlaintext } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
4
4
|
import { IOutlineModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/documentSymbols/browser/outlineModel.service';
|
|
5
5
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
-
import { getMarkdownHeadersInCell } from '@codingame/monaco-vscode-
|
|
6
|
+
import { getMarkdownHeadersInCell } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/viewModel/foldingModel';
|
|
7
7
|
import { OutlineEntry } from './OutlineEntry.js';
|
|
8
8
|
import { CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
9
9
|
import { INotebookExecutionStateService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service';
|
|
@@ -93,7 +93,7 @@ let NotebookOutlineEntryFactory = class NotebookOutlineEntryFactory {
|
|
|
93
93
|
}
|
|
94
94
|
if (entries.length === 0) {
|
|
95
95
|
if (preview.length === 0) {
|
|
96
|
-
preview = ( localize(
|
|
96
|
+
preview = ( localize(16987, "empty cell"));
|
|
97
97
|
}
|
|
98
98
|
entries.push(( new OutlineEntry(
|
|
99
99
|
index++,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IResourceUndoRedoElement, UndoRedoElementType } from "@codingame/monaco-vscode-api/vscode/vs/platform/undoRedo/common/undoRedo";
|
|
2
2
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
3
|
-
import { NotebookCellTextModel } from "@codingame/monaco-vscode-
|
|
3
|
+
import { NotebookCellTextModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel";
|
|
4
4
|
import { ISelectionState, NotebookCellMetadata } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
5
5
|
/**
|
|
6
6
|
* It should not modify Undo/Redo stack
|
|
@@ -11,7 +11,7 @@ import { ILanguageDetectionService } from "@codingame/monaco-vscode-api/vscode/v
|
|
|
11
11
|
import { ICellDto2, ICellEditOperation, INotebookSnapshotOptions, INotebookTextModel, ISelectionState, NotebookCellDefaultCollapseConfig, NotebookData, NotebookDocumentMetadata, NotebookTextModelChangedEvent, NotebookTextModelWillAddRemoveEvent, TransientOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
12
12
|
import { INotebookExecutionStateService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service";
|
|
13
13
|
import { INotebookLoggingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service";
|
|
14
|
-
import { NotebookCellTextModel } from "@codingame/monaco-vscode-
|
|
14
|
+
import { NotebookCellTextModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel";
|
|
15
15
|
export declare class NotebookTextModel extends Disposable implements INotebookTextModel {
|
|
16
16
|
readonly viewType: string;
|
|
17
17
|
readonly uri: URI;
|
|
@@ -22,8 +22,8 @@ import { CellUri, NotebookCellsChangeType, NotebookCellExecutionState, CellEditT
|
|
|
22
22
|
import { INotebookExecutionStateService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service';
|
|
23
23
|
import { INotebookLoggingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service';
|
|
24
24
|
import { SpliceCellsEdit, CellMetadataEdit, MoveCellEdit } from './cellEdit.js';
|
|
25
|
-
import { NotebookCellOutputTextModel } from '@codingame/monaco-vscode-
|
|
26
|
-
import { NotebookCellTextModel } from '@codingame/monaco-vscode-
|
|
25
|
+
import { NotebookCellOutputTextModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel';
|
|
26
|
+
import { NotebookCellTextModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
|
|
27
27
|
|
|
28
28
|
var NotebookTextModel_1;
|
|
29
29
|
class StackOperation {
|
|
@@ -290,7 +290,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
290
290
|
this._cells = [];
|
|
291
291
|
this._versionId = 0;
|
|
292
292
|
this._notebookSpecificAlternativeId = 0;
|
|
293
|
-
const mainCells =
|
|
293
|
+
const mainCells = cells.map(cell => {
|
|
294
294
|
const cellHandle = this._cellhandlePool++;
|
|
295
295
|
const cellUri = CellUri.generate(this.uri, cellHandle);
|
|
296
296
|
return ( new NotebookCellTextModel(
|
|
@@ -304,7 +304,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
304
304
|
this._languageDetectionService,
|
|
305
305
|
this._notebookLoggingService
|
|
306
306
|
));
|
|
307
|
-
})
|
|
307
|
+
});
|
|
308
308
|
for (let i = 0; i < mainCells.length; i++) {
|
|
309
309
|
const dirtyStateListener = mainCells[i].onDidChangeContent(e => {
|
|
310
310
|
this._bindCellContentHandler(mainCells[i], e);
|
|
@@ -384,7 +384,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
_generateAlternativeId() {
|
|
387
|
-
return `${this._notebookSpecificAlternativeId}_` +
|
|
387
|
+
return `${this._notebookSpecificAlternativeId}_` + this.cells.map(cell => cell.handle + "," + cell.alternativeId).join(";");
|
|
388
388
|
}
|
|
389
389
|
dispose() {
|
|
390
390
|
if (this._isDisposed) {
|
|
@@ -428,7 +428,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
428
428
|
reset(cells, metadata, transientOptions) {
|
|
429
429
|
this.transientOptions = transientOptions;
|
|
430
430
|
const executions = this._notebookExecutionStateService.getCellExecutionsForNotebook(this.uri);
|
|
431
|
-
const executingCellHandles =
|
|
431
|
+
const executingCellHandles = executions.filter(exe => exe.state === NotebookCellExecutionState.Executing).map(exe => exe.cellHandle);
|
|
432
432
|
const edits = NotebookTextModel_1.computeEdits(this, cells, executingCellHandles);
|
|
433
433
|
this.applyEdits([...edits, {
|
|
434
434
|
editType: CellEditType.DocumentMetadata,
|
|
@@ -548,14 +548,14 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
548
548
|
if (a.length === 0) {
|
|
549
549
|
return [];
|
|
550
550
|
}
|
|
551
|
-
return
|
|
551
|
+
return b.map((output, i) => {
|
|
552
552
|
return {
|
|
553
553
|
editType: CellEditType.OutputItems,
|
|
554
554
|
outputId: a[i].outputId,
|
|
555
555
|
items: output.outputs,
|
|
556
556
|
append: false
|
|
557
557
|
};
|
|
558
|
-
})
|
|
558
|
+
});
|
|
559
559
|
}
|
|
560
560
|
static _commonPrefix(a, aLen, aDelta, b, bLen, bDelta, isExecuting) {
|
|
561
561
|
const maxResult = Math.min(aLen, bLen);
|
|
@@ -640,7 +640,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
_doApplyEdits(rawEdits, synchronous, computeUndoRedo, beginSelectionState, undoRedoGroup) {
|
|
643
|
-
const editsWithDetails =
|
|
643
|
+
const editsWithDetails = rawEdits.map((edit, index) => {
|
|
644
644
|
let cellIndex = -1;
|
|
645
645
|
if (hasKey(edit, {
|
|
646
646
|
index: true
|
|
@@ -670,8 +670,8 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
670
670
|
end: (edit.editType === CellEditType.DocumentMetadata) ? undefined : (edit.editType === CellEditType.Replace ? edit.index + edit.count : cellIndex),
|
|
671
671
|
originalIndex: index
|
|
672
672
|
};
|
|
673
|
-
})
|
|
674
|
-
const edits =
|
|
673
|
+
}).filter(isDefined);
|
|
674
|
+
const edits = this._mergeCellEdits(editsWithDetails).sort((a, b) => {
|
|
675
675
|
if (a.end === undefined) {
|
|
676
676
|
return -1;
|
|
677
677
|
}
|
|
@@ -703,7 +703,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
703
703
|
}
|
|
704
704
|
});
|
|
705
705
|
return [...otherEdits.reverse(), ...replaceEdits];
|
|
706
|
-
})
|
|
706
|
+
});
|
|
707
707
|
const flattenEdits = edits.flat();
|
|
708
708
|
for (const {
|
|
709
709
|
edit,
|
|
@@ -729,7 +729,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
729
729
|
this._spliceNotebookCellOutputs(cell, {
|
|
730
730
|
start: cell.outputs.length,
|
|
731
731
|
deleteCount: 0,
|
|
732
|
-
newOutputs:
|
|
732
|
+
newOutputs: edit.outputs.map(op => ( new NotebookCellOutputTextModel(op)))
|
|
733
733
|
}, true, computeUndoRedo);
|
|
734
734
|
} else {
|
|
735
735
|
this._spliceNotebookCellOutputs2(cell, edit.outputs, computeUndoRedo);
|
|
@@ -841,7 +841,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
841
841
|
this._cellListeners.get(cell.handle)?.dispose();
|
|
842
842
|
this._cellListeners.delete(cell.handle);
|
|
843
843
|
}
|
|
844
|
-
const cells =
|
|
844
|
+
const cells = cellDtos.map(cellDto => {
|
|
845
845
|
const cellHandle = this._cellhandlePool++;
|
|
846
846
|
const cellUri = CellUri.generate(this.uri, cellHandle);
|
|
847
847
|
if (!cellDto.outputs) {
|
|
@@ -872,14 +872,14 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
872
872
|
this._cellListeners.set(cell.handle, dirtyStateListener);
|
|
873
873
|
this._register(cell);
|
|
874
874
|
return cell;
|
|
875
|
-
})
|
|
875
|
+
});
|
|
876
876
|
const cellsCopy = this._cells.slice(0);
|
|
877
877
|
cellsCopy.splice(index, count, ...cells);
|
|
878
|
-
const diffs =
|
|
878
|
+
const diffs = diff(this._cells, cellsCopy, cell => {
|
|
879
879
|
return ( oldSet.has(cell.handle));
|
|
880
880
|
}).map(diff => {
|
|
881
881
|
return [diff.start, diff.deleteCount, diff.toInsert];
|
|
882
|
-
})
|
|
882
|
+
});
|
|
883
883
|
this._onWillAddRemoveCells.fire({
|
|
884
884
|
rawEvent: {
|
|
885
885
|
kind: NotebookCellsChangeType.ModelChange,
|
|
@@ -887,10 +887,10 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
887
887
|
}
|
|
888
888
|
});
|
|
889
889
|
this._cells = cellsCopy;
|
|
890
|
-
const undoDiff =
|
|
890
|
+
const undoDiff = diffs.map(diff => {
|
|
891
891
|
const deletedCells = oldViewCells.slice(diff[0], diff[0] + diff[1]);
|
|
892
892
|
return [diff[0], deletedCells, diff[2]];
|
|
893
|
-
})
|
|
893
|
+
});
|
|
894
894
|
if (computeUndoRedo) {
|
|
895
895
|
this._operationManager.pushEditOperation(( new SpliceCellsEdit(this.uri, undoDiff, {
|
|
896
896
|
insertCell: (index, cell, endSelections) => {
|
|
@@ -1194,17 +1194,17 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
1194
1194
|
this._spliceNotebookCellOutputs(cell, {
|
|
1195
1195
|
start: 0,
|
|
1196
1196
|
deleteCount: cell.outputs.length,
|
|
1197
|
-
newOutputs:
|
|
1197
|
+
newOutputs: outputs.map(op => ( new NotebookCellOutputTextModel(op)))
|
|
1198
1198
|
}, false, computeUndoRedo);
|
|
1199
1199
|
return;
|
|
1200
1200
|
}
|
|
1201
1201
|
const diff = ( new LcsDiff(( new OutputSequence(cell.outputs)), ( new OutputSequence(outputs))));
|
|
1202
1202
|
const diffResult = diff.ComputeDiff(false);
|
|
1203
|
-
const splices =
|
|
1203
|
+
const splices = diffResult.changes.map(change => ({
|
|
1204
1204
|
start: change.originalStart,
|
|
1205
1205
|
deleteCount: change.originalLength,
|
|
1206
|
-
newOutputs:
|
|
1207
|
-
}))
|
|
1206
|
+
newOutputs: outputs.slice(change.modifiedStart, change.modifiedStart + change.modifiedLength).map(op => ( new NotebookCellOutputTextModel(op)))
|
|
1207
|
+
}));
|
|
1208
1208
|
splices.reverse().forEach(splice => {
|
|
1209
1209
|
this._spliceNotebookCellOutputs(cell, splice, false, computeUndoRedo);
|
|
1210
1210
|
});
|
|
@@ -1215,7 +1215,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
1215
1215
|
rawEvents: [{
|
|
1216
1216
|
kind: NotebookCellsChangeType.Output,
|
|
1217
1217
|
index: this._cells.indexOf(cell),
|
|
1218
|
-
outputs:
|
|
1218
|
+
outputs: cell.outputs.map(output => output.asDto()) ?? [],
|
|
1219
1219
|
append,
|
|
1220
1220
|
transient: this.transientOptions.transientOutputs
|
|
1221
1221
|
}],
|
|
@@ -1381,12 +1381,12 @@ class OutputSequence {
|
|
|
1381
1381
|
this.outputs = outputs;
|
|
1382
1382
|
}
|
|
1383
1383
|
getElements() {
|
|
1384
|
-
return
|
|
1385
|
-
return hash(
|
|
1384
|
+
return this.outputs.map(output => {
|
|
1385
|
+
return hash(output.outputs.map(output => ({
|
|
1386
1386
|
mime: output.mime,
|
|
1387
1387
|
data: output.data
|
|
1388
|
-
})))
|
|
1389
|
-
})
|
|
1388
|
+
})));
|
|
1389
|
+
});
|
|
1390
1390
|
}
|
|
1391
1391
|
}
|
|
1392
1392
|
|
|
@@ -32,9 +32,9 @@ class NotebookOutputRendererInfo {
|
|
|
32
32
|
}
|
|
33
33
|
this.displayName = descriptor.displayName;
|
|
34
34
|
this.mimeTypes = descriptor.mimeTypes;
|
|
35
|
-
this.mimeTypeGlobs =
|
|
35
|
+
this.mimeTypeGlobs = this.mimeTypes.map(pattern => parse(pattern, {
|
|
36
36
|
ignoreCase: true
|
|
37
|
-
}))
|
|
37
|
+
}));
|
|
38
38
|
this.hardDependencies = ( new DependencyList(descriptor.dependencies ?? Iterable.empty()));
|
|
39
39
|
this.optionalDependencies = ( new DependencyList(descriptor.optionalDependencies ?? Iterable.empty()));
|
|
40
40
|
this.messaging = descriptor.requiresMessaging ?? RendererMessagingSpec.Never;
|
|
@@ -72,7 +72,7 @@ class NotebookStaticPreloadInfo {
|
|
|
72
72
|
this.type = descriptor.type;
|
|
73
73
|
this.entrypoint = joinPath(descriptor.extension.extensionLocation, descriptor.entrypoint);
|
|
74
74
|
this.extensionLocation = descriptor.extension.extensionLocation;
|
|
75
|
-
this.localResourceRoots =
|
|
75
|
+
this.localResourceRoots = descriptor.localResourceRoots.map(root => joinPath(descriptor.extension.extensionLocation, root));
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -10,9 +10,9 @@ import { MirrorModel } from '@codingame/monaco-vscode-api/vscode/vs/editor/commo
|
|
|
10
10
|
import { DefaultEndOfLine } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
|
|
11
11
|
import { filter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
12
12
|
import { matchCellBasedOnSimilarties } from './notebookCellMatching.js';
|
|
13
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
13
|
+
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
14
14
|
import { DiffChange } from '@codingame/monaco-vscode-api/vscode/vs/base/common/diff/diffChange';
|
|
15
|
-
import { computeDiff } from '@codingame/monaco-vscode-
|
|
15
|
+
import { computeDiff } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookDiff';
|
|
16
16
|
|
|
17
17
|
const PREFIX_FOR_UNMATCHED_ORIGINAL_CELLS = `unmatchedOriginalCell`;
|
|
18
18
|
class MirrorCell {
|
|
@@ -65,7 +65,7 @@ class MirrorCell {
|
|
|
65
65
|
hashValue = doHash(output.mime, hashValue);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
const digests = this.outputs.flatMap(op =>
|
|
68
|
+
const digests = this.outputs.flatMap(op => op.outputs.map(o => hash(Array.from(o.data.buffer))));
|
|
69
69
|
for (const digest of digests) {
|
|
70
70
|
hashValue = numberHash(digest, hashValue);
|
|
71
71
|
}
|
|
@@ -114,26 +114,26 @@ class MirrorNotebookDocument {
|
|
|
114
114
|
_spliceNotebookCells(splices) {
|
|
115
115
|
splices.reverse().forEach(splice => {
|
|
116
116
|
const cellDtos = splice[2];
|
|
117
|
-
const newCells =
|
|
117
|
+
const newCells = cellDtos.map(cell => {
|
|
118
118
|
return ( new MirrorCell(cell.handle, ( URI.parse(cell.url)), cell.source, cell.eol, cell.versionId, cell.language, cell.cellKind, cell.outputs, cell.metadata));
|
|
119
|
-
})
|
|
119
|
+
});
|
|
120
120
|
this.cells.splice(splice[0], splice[1], ...newCells);
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
class CellSequence {
|
|
125
125
|
static create(textModel) {
|
|
126
|
-
const hashValue =
|
|
126
|
+
const hashValue = textModel.cells.map(c => c.getComparisonValue());
|
|
127
127
|
return ( new CellSequence(hashValue));
|
|
128
128
|
}
|
|
129
129
|
static createWithCellId(cells, includeCellContents) {
|
|
130
|
-
const hashValue =
|
|
130
|
+
const hashValue = cells.map(c => {
|
|
131
131
|
if (includeCellContents) {
|
|
132
132
|
return `${doHash(c.internalMetadata?.internalId, numberHash(104579, 0))}#${c.getComparisonValue()}`;
|
|
133
133
|
} else {
|
|
134
134
|
return `${doHash(c.internalMetadata?.internalId, numberHash(104579, 0))}}`;
|
|
135
135
|
}
|
|
136
|
-
})
|
|
136
|
+
});
|
|
137
137
|
return ( new CellSequence(hashValue));
|
|
138
138
|
}
|
|
139
139
|
constructor(hashValue) {
|
|
@@ -150,7 +150,7 @@ class NotebookWorker {
|
|
|
150
150
|
}
|
|
151
151
|
dispose() {}
|
|
152
152
|
$acceptNewModel(uri, metadata, transientDocumentMetadata, cells) {
|
|
153
|
-
this._models[uri] = ( new MirrorNotebookDocument(( URI.parse(uri)),
|
|
153
|
+
this._models[uri] = ( new MirrorNotebookDocument(( URI.parse(uri)), cells.map(dto => ( new MirrorCell(dto.handle, ( URI.parse(dto.url)), dto.source, dto.eol, dto.versionId, dto.language, dto.cellKind, dto.outputs, dto.metadata, dto.internalMetadata))), metadata, transientDocumentMetadata));
|
|
154
154
|
}
|
|
155
155
|
$acceptModelChanged(strURL, event) {
|
|
156
156
|
const model = this._models[strURL];
|
|
@@ -286,40 +286,66 @@ class NotebookWorker {
|
|
|
286
286
|
return this.canComputeDiffWithCellInternalIds(original, modified) || this.canComputeDiffWithCellMetadataIds(original, modified);
|
|
287
287
|
}
|
|
288
288
|
canComputeDiffWithCellInternalIds(original, modified) {
|
|
289
|
-
const originalCellIndexIds =
|
|
289
|
+
const originalCellIndexIds = original.cells.map((cell, index) => ({
|
|
290
290
|
index,
|
|
291
291
|
id: (cell.internalMetadata?.internalId || "")
|
|
292
|
-
}))
|
|
293
|
-
const modifiedCellIndexIds =
|
|
292
|
+
}));
|
|
293
|
+
const modifiedCellIndexIds = modified.cells.map((cell, index) => ({
|
|
294
294
|
index,
|
|
295
295
|
id: (cell.internalMetadata?.internalId || "")
|
|
296
|
-
}))
|
|
296
|
+
}));
|
|
297
297
|
if (( originalCellIndexIds.some(c => !c.id)) || ( modifiedCellIndexIds.some(c => !c.id))) {
|
|
298
298
|
return false;
|
|
299
299
|
}
|
|
300
300
|
return ( originalCellIndexIds.some(c => modifiedCellIndexIds.find(m => m.id === c.id)));
|
|
301
301
|
}
|
|
302
302
|
canComputeDiffWithCellMetadataIds(original, modified) {
|
|
303
|
-
const originalCellIndexIds =
|
|
303
|
+
const originalCellIndexIds = original.cells.map((cell, index) => ({
|
|
304
304
|
index,
|
|
305
305
|
id: (cell.metadata?.id || "")
|
|
306
|
-
}))
|
|
307
|
-
const modifiedCellIndexIds =
|
|
306
|
+
}));
|
|
307
|
+
const modifiedCellIndexIds = modified.cells.map((cell, index) => ({
|
|
308
308
|
index,
|
|
309
309
|
id: (cell.metadata?.id || "")
|
|
310
|
-
}))
|
|
310
|
+
}));
|
|
311
311
|
if (( originalCellIndexIds.some(c => !c.id)) || ( modifiedCellIndexIds.some(c => !c.id))) {
|
|
312
312
|
return false;
|
|
313
313
|
}
|
|
314
314
|
if (originalCellIndexIds.every(c => !modifiedCellIndexIds.find(m => m.id === c.id))) {
|
|
315
315
|
return false;
|
|
316
316
|
}
|
|
317
|
+
original.cells.map((cell, index) => {
|
|
318
|
+
cell.internalMetadata = cell.internalMetadata || {};
|
|
319
|
+
cell.internalMetadata.internalId = cell.metadata?.id || "";
|
|
320
|
+
});
|
|
321
|
+
modified.cells.map((cell, index) => {
|
|
322
|
+
cell.internalMetadata = cell.internalMetadata || {};
|
|
323
|
+
cell.internalMetadata.internalId = cell.metadata?.id || "";
|
|
324
|
+
});
|
|
317
325
|
return true;
|
|
318
326
|
}
|
|
319
327
|
isOriginalCellMatchedWithModifiedCell(originalCell) {
|
|
320
328
|
return (originalCell.internalMetadata?.internalId || "").startsWith(PREFIX_FOR_UNMATCHED_ORIGINAL_CELLS);
|
|
321
329
|
}
|
|
322
330
|
updateCellIdsBasedOnMappings(mappings, originalCells, modifiedCells) {
|
|
331
|
+
const uuids = ( new Map());
|
|
332
|
+
originalCells.map((cell, index) => {
|
|
333
|
+
cell.internalMetadata = cell.internalMetadata || {
|
|
334
|
+
internalId: ""
|
|
335
|
+
};
|
|
336
|
+
cell.internalMetadata.internalId = `${PREFIX_FOR_UNMATCHED_ORIGINAL_CELLS}${generateUuid()}`;
|
|
337
|
+
const found = mappings.find(r => r.original === index);
|
|
338
|
+
if (found) {
|
|
339
|
+
cell.internalMetadata.internalId = generateUuid();
|
|
340
|
+
uuids.set(found.modified, cell.internalMetadata.internalId);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
modifiedCells.map((cell, index) => {
|
|
344
|
+
cell.internalMetadata = cell.internalMetadata || {
|
|
345
|
+
internalId: ""
|
|
346
|
+
};
|
|
347
|
+
cell.internalMetadata.internalId = uuids.get(index) ?? generateUuid();
|
|
348
|
+
});
|
|
323
349
|
return true;
|
|
324
350
|
}
|
|
325
351
|
$canPromptRecommendation(modelUrl) {
|
|
@@ -362,7 +388,7 @@ function create() {
|
|
|
362
388
|
class NotebookTextModelFacade {
|
|
363
389
|
constructor(notebook) {
|
|
364
390
|
this.notebook = notebook;
|
|
365
|
-
this.cells =
|
|
391
|
+
this.cells = notebook.cells.map(cell => ( new NotebookCellTextModelFacade(cell)));
|
|
366
392
|
}
|
|
367
393
|
}
|
|
368
394
|
class NotebookCellTextModelFacade {
|
|
@@ -35,17 +35,17 @@ import { getReplView } from '@codingame/monaco-vscode-api/vscode/vs/workbench/co
|
|
|
35
35
|
import { REPL_VIEW_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/debug/common/debug';
|
|
36
36
|
import { InlineChatController } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
37
37
|
import { IInteractiveHistoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/interactive/browser/interactiveHistoryService.service';
|
|
38
|
-
import { NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT } from '@codingame/monaco-vscode-
|
|
39
|
-
import { executeIcon } from '@codingame/monaco-vscode-
|
|
38
|
+
import { NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
39
|
+
import { executeIcon } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
40
40
|
import { ReplEditorAccessibleView } from '../../notebook/browser/replEditorAccessibleView.js';
|
|
41
41
|
import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
|
|
42
42
|
import { REPL_EDITOR_ID, NotebookSetting, NotebookWorkingCopyTypeIdentifier, CellKind, CellEditType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
43
43
|
import { MOST_RECENT_REPL_EDITOR, IS_COMPOSITE_NOTEBOOK, NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_EDITOR_FOCUSED } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
44
44
|
import { INotebookEditorModelResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service';
|
|
45
45
|
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
46
|
-
import { ReplEditor, isReplEditorControl } from '@codingame/monaco-vscode-
|
|
46
|
+
import { ReplEditor, isReplEditorControl } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/replNotebook/browser/replEditor';
|
|
47
47
|
import { ReplEditorInputAccessibilityHelp, ReplEditorHistoryAccessibilityHelp } from './replEditorAccessibilityHelp.js';
|
|
48
|
-
import { ReplEditorInput } from '@codingame/monaco-vscode-
|
|
48
|
+
import { ReplEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/replNotebook/browser/replEditorInput';
|
|
49
49
|
|
|
50
50
|
class ReplEditorSerializer {
|
|
51
51
|
canSerialize(input) {
|
|
@@ -232,7 +232,7 @@ registerAction2(class extends Action2 {
|
|
|
232
232
|
constructor() {
|
|
233
233
|
super({
|
|
234
234
|
id: "repl.focusLastItemExecuted",
|
|
235
|
-
title: ( localize2(
|
|
235
|
+
title: ( localize2(17741, "Focus Most Recent REPL Execution")),
|
|
236
236
|
category: "REPL",
|
|
237
237
|
menu: {
|
|
238
238
|
id: MenuId.CommandPalette,
|
|
@@ -282,7 +282,7 @@ registerAction2(class extends Action2 {
|
|
|
282
282
|
constructor() {
|
|
283
283
|
super({
|
|
284
284
|
id: "repl.input.focus",
|
|
285
|
-
title: ( localize2(
|
|
285
|
+
title: ( localize2(17742, "Focus Input Editor")),
|
|
286
286
|
category: "REPL",
|
|
287
287
|
menu: {
|
|
288
288
|
id: MenuId.CommandPalette,
|
|
@@ -327,7 +327,7 @@ registerAction2(class extends Action2 {
|
|
|
327
327
|
constructor() {
|
|
328
328
|
super({
|
|
329
329
|
id: "repl.execute",
|
|
330
|
-
title: ( localize2(
|
|
330
|
+
title: ( localize2(17743, "Execute REPL input")),
|
|
331
331
|
category: "REPL",
|
|
332
332
|
keybinding: [{
|
|
333
333
|
when: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( ContextKeyExpr.equals("activeEditor", "workbench.editor.repl")), ( NOTEBOOK_CELL_LIST_FOCUSED.negate()))),
|