@codingame/monaco-vscode-notebook-service-override 3.2.2 → 4.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/notebook.js +1 -1
- package/override/vs/platform/dialogs/common/dialogs.js +2 -0
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +9 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +61 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +11 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +9 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +293 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +16 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +107 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +15 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +199 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +47 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +11 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +20 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +15 -5
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +54 -55
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +3 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +11 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +0 -608
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -31
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +0 -744
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +0 -237
|
@@ -17,13 +17,17 @@ import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
|
17
17
|
|
|
18
18
|
var NotebookTextModel_1;
|
|
19
19
|
class StackOperation {
|
|
20
|
-
|
|
20
|
+
get code() {
|
|
21
|
+
return this._operations.length === 1 ? this._operations[0].code : 'undoredo.notebooks.stackOperation';
|
|
22
|
+
}
|
|
23
|
+
get label() {
|
|
24
|
+
return this._operations.length === 1 ? this._operations[0].label : 'edit';
|
|
25
|
+
}
|
|
26
|
+
constructor(textModel, undoRedoGroup, _pauseableEmitter, _postUndoRedo, selectionState, beginAlternativeVersionId) {
|
|
21
27
|
this.textModel = textModel;
|
|
22
|
-
this.label = label;
|
|
23
28
|
this.undoRedoGroup = undoRedoGroup;
|
|
24
29
|
this._pauseableEmitter = _pauseableEmitter;
|
|
25
30
|
this._postUndoRedo = _postUndoRedo;
|
|
26
|
-
this.code = 'undoredo.notebooks.stackOperation';
|
|
27
31
|
this._operations = [];
|
|
28
32
|
this._beginSelectionState = undefined;
|
|
29
33
|
this._resultSelectionState = undefined;
|
|
@@ -40,14 +44,15 @@ class StackOperation {
|
|
|
40
44
|
}
|
|
41
45
|
pushEndState(alternativeVersionId, selectionState) {
|
|
42
46
|
this._resultAlternativeVersionId = alternativeVersionId;
|
|
43
|
-
this._resultSelectionState = selectionState;
|
|
47
|
+
this._resultSelectionState = selectionState || this._resultSelectionState;
|
|
44
48
|
}
|
|
45
|
-
pushEditOperation(element, beginSelectionState, resultSelectionState) {
|
|
49
|
+
pushEditOperation(element, beginSelectionState, resultSelectionState, alternativeVersionId) {
|
|
46
50
|
if (this._operations.length === 0) {
|
|
47
51
|
this._beginSelectionState = this._beginSelectionState ?? beginSelectionState;
|
|
48
52
|
}
|
|
49
53
|
this._operations.push(element);
|
|
50
54
|
this._resultSelectionState = resultSelectionState;
|
|
55
|
+
this._resultAlternativeVersionId = alternativeVersionId;
|
|
51
56
|
}
|
|
52
57
|
async undo() {
|
|
53
58
|
this._pauseableEmitter.pause();
|
|
@@ -89,31 +94,26 @@ class NotebookOperationManager {
|
|
|
89
94
|
isUndoStackEmpty() {
|
|
90
95
|
return this._pendingStackOperation === null || this._pendingStackOperation.isEmpty;
|
|
91
96
|
}
|
|
92
|
-
pushStackElement(
|
|
93
|
-
if (this._pendingStackOperation) {
|
|
97
|
+
pushStackElement(alternativeVersionId, selectionState) {
|
|
98
|
+
if (this._pendingStackOperation && !this._pendingStackOperation.isEmpty) {
|
|
94
99
|
this._pendingStackOperation.pushEndState(alternativeVersionId, selectionState);
|
|
95
|
-
|
|
96
|
-
this._undoService.pushElement(this._pendingStackOperation, this._pendingStackOperation.undoRedoGroup);
|
|
97
|
-
}
|
|
98
|
-
this._pendingStackOperation = null;
|
|
99
|
-
return;
|
|
100
|
+
this._undoService.pushElement(this._pendingStackOperation, this._pendingStackOperation.undoRedoGroup);
|
|
100
101
|
}
|
|
101
|
-
this._pendingStackOperation =
|
|
102
|
+
this._pendingStackOperation = null;
|
|
103
|
+
}
|
|
104
|
+
_getOrCreateEditStackElement(beginSelectionState, undoRedoGroup, alternativeVersionId) {
|
|
105
|
+
return this._pendingStackOperation ??= ( new StackOperation(
|
|
102
106
|
this._textModel,
|
|
103
|
-
label,
|
|
104
107
|
undoRedoGroup,
|
|
105
108
|
this._pauseableEmitter,
|
|
106
109
|
this._postUndoRedo,
|
|
107
|
-
|
|
108
|
-
alternativeVersionId
|
|
110
|
+
beginSelectionState,
|
|
111
|
+
alternativeVersionId || ''
|
|
109
112
|
));
|
|
110
113
|
}
|
|
111
|
-
pushEditOperation(element, beginSelectionState, resultSelectionState) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
this._undoService.pushElement(element);
|
|
114
|
+
pushEditOperation(element, beginSelectionState, resultSelectionState, alternativeVersionId, undoRedoGroup) {
|
|
115
|
+
const pendingStackOperation = this._getOrCreateEditStackElement(beginSelectionState, undoRedoGroup, alternativeVersionId);
|
|
116
|
+
pendingStackOperation.pushEditOperation(element, beginSelectionState, resultSelectionState, alternativeVersionId);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
class NotebookEventEmitter extends PauseableEmitter {
|
|
@@ -301,8 +301,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
301
301
|
this._cells = [];
|
|
302
302
|
super.dispose();
|
|
303
303
|
}
|
|
304
|
-
pushStackElement(
|
|
305
|
-
this._operationManager.pushStackElement(label, selectionState, undoRedoGroup, this.alternativeVersionId);
|
|
304
|
+
pushStackElement() {
|
|
306
305
|
}
|
|
307
306
|
_getCellIndexByHandle(handle) {
|
|
308
307
|
return this.cells.findIndex(c => c.handle === handle);
|
|
@@ -409,20 +408,20 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
409
408
|
}
|
|
410
409
|
applyEdits(rawEdits, synchronous, beginSelectionState, endSelectionsComputer, undoRedoGroup, computeUndoRedo) {
|
|
411
410
|
this._pauseableEmitter.pause();
|
|
412
|
-
this.pushStackElement(
|
|
411
|
+
this._operationManager.pushStackElement(this._alternativeVersionId, undefined);
|
|
413
412
|
try {
|
|
414
|
-
this._doApplyEdits(rawEdits, synchronous, computeUndoRedo);
|
|
413
|
+
this._doApplyEdits(rawEdits, synchronous, computeUndoRedo, beginSelectionState, undoRedoGroup);
|
|
415
414
|
return true;
|
|
416
415
|
}
|
|
417
416
|
finally {
|
|
418
417
|
const endSelections = endSelectionsComputer();
|
|
419
418
|
this._increaseVersionId(this._operationManager.isUndoStackEmpty() && !this._pauseableEmitter.isDirtyEvent());
|
|
420
|
-
this.pushStackElement(
|
|
419
|
+
this._operationManager.pushStackElement(this._alternativeVersionId, endSelections);
|
|
421
420
|
this._pauseableEmitter.fire({ rawEvents: [], versionId: this.versionId, synchronous: synchronous, endSelectionState: endSelections });
|
|
422
421
|
this._pauseableEmitter.resume();
|
|
423
422
|
}
|
|
424
423
|
}
|
|
425
|
-
_doApplyEdits(rawEdits, synchronous, computeUndoRedo) {
|
|
424
|
+
_doApplyEdits(rawEdits, synchronous, computeUndoRedo, beginSelectionState, undoRedoGroup) {
|
|
426
425
|
const editsWithDetails = ( rawEdits.map((edit, index) => {
|
|
427
426
|
let cellIndex = -1;
|
|
428
427
|
if ('index' in edit) {
|
|
@@ -494,7 +493,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
494
493
|
for (const { edit, cellIndex } of flattenEdits) {
|
|
495
494
|
switch (edit.editType) {
|
|
496
495
|
case 1 :
|
|
497
|
-
this._replaceCells(edit.index, edit.count, edit.cells, synchronous, computeUndoRedo);
|
|
496
|
+
this._replaceCells(edit.index, edit.count, edit.cells, synchronous, computeUndoRedo, beginSelectionState, undoRedoGroup);
|
|
498
497
|
break;
|
|
499
498
|
case 2 : {
|
|
500
499
|
this._assertIndex(cellIndex);
|
|
@@ -521,11 +520,11 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
521
520
|
break;
|
|
522
521
|
case 3 :
|
|
523
522
|
this._assertIndex(edit.index);
|
|
524
|
-
this._changeCellMetadata(this._cells[edit.index], edit.metadata, computeUndoRedo);
|
|
523
|
+
this._changeCellMetadata(this._cells[edit.index], edit.metadata, computeUndoRedo, beginSelectionState, undoRedoGroup);
|
|
525
524
|
break;
|
|
526
525
|
case 8 :
|
|
527
526
|
this._assertIndex(cellIndex);
|
|
528
|
-
this._changeCellMetadataPartial(this._cells[cellIndex], edit.metadata, computeUndoRedo);
|
|
527
|
+
this._changeCellMetadataPartial(this._cells[cellIndex], edit.metadata, computeUndoRedo, beginSelectionState, undoRedoGroup);
|
|
529
528
|
break;
|
|
530
529
|
case 9 :
|
|
531
530
|
this._assertIndex(cellIndex);
|
|
@@ -533,13 +532,13 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
533
532
|
break;
|
|
534
533
|
case 4 :
|
|
535
534
|
this._assertIndex(edit.index);
|
|
536
|
-
this._changeCellLanguage(this._cells[edit.index], edit.language, computeUndoRedo);
|
|
535
|
+
this._changeCellLanguage(this._cells[edit.index], edit.language, computeUndoRedo, beginSelectionState, undoRedoGroup);
|
|
537
536
|
break;
|
|
538
537
|
case 5 :
|
|
539
|
-
this.
|
|
538
|
+
this._updateNotebookCellMetadata(edit.metadata, computeUndoRedo, beginSelectionState, undoRedoGroup);
|
|
540
539
|
break;
|
|
541
540
|
case 6 :
|
|
542
|
-
this._moveCellToIdx(edit.index, edit.length, edit.newIdx, synchronous, computeUndoRedo, undefined,
|
|
541
|
+
this._moveCellToIdx(edit.index, edit.length, edit.newIdx, synchronous, computeUndoRedo, beginSelectionState, undefined, undoRedoGroup);
|
|
543
542
|
break;
|
|
544
543
|
}
|
|
545
544
|
}
|
|
@@ -579,7 +578,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
579
578
|
const defaultConfig = cellDto.cellKind === CellKind.Code ? this._defaultCollapseConfig?.codeCell : this._defaultCollapseConfig?.markupCell;
|
|
580
579
|
return cellDto.collapseState ?? (defaultConfig ?? undefined);
|
|
581
580
|
}
|
|
582
|
-
_replaceCells(index, count, cellDtos, synchronous, computeUndoRedo) {
|
|
581
|
+
_replaceCells(index, count, cellDtos, synchronous, computeUndoRedo, beginSelectionState, undoRedoGroup) {
|
|
583
582
|
if (count === 0 && cellDtos.length === 0) {
|
|
584
583
|
return;
|
|
585
584
|
}
|
|
@@ -643,7 +642,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
643
642
|
insertCell: (index, cell, endSelections) => { this._insertNewCell(index, [cell], true, endSelections); },
|
|
644
643
|
deleteCell: (index, endSelections) => { this._removeCell(index, 1, true, endSelections); },
|
|
645
644
|
replaceCell: (index, count, cells, endSelections) => { this._replaceNewCells(index, count, cells, true, endSelections); },
|
|
646
|
-
}, undefined, undefined)), undefined,
|
|
645
|
+
}, undefined, undefined)), beginSelectionState, undefined, this._alternativeVersionId, undoRedoGroup);
|
|
647
646
|
}
|
|
648
647
|
this._pauseableEmitter.fire({
|
|
649
648
|
rawEvents: [{ kind: NotebookCellsChangeType.ModelChange, changes: diffs, transient: false }],
|
|
@@ -663,7 +662,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
663
662
|
this._alternativeVersionId = newAlternativeVersionId;
|
|
664
663
|
this._notebookSpecificAlternativeId = Number(newAlternativeVersionId.substring(0, newAlternativeVersionId.indexOf('_')));
|
|
665
664
|
}
|
|
666
|
-
|
|
665
|
+
_updateNotebookCellMetadata(metadata, computeUndoRedo, beginSelectionState, undoRedoGroup) {
|
|
667
666
|
const oldMetadata = this.metadata;
|
|
668
667
|
const triggerDirtyChange = this._isDocumentMetadataChanged(this.metadata, metadata);
|
|
669
668
|
if (triggerDirtyChange) {
|
|
@@ -672,19 +671,19 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
672
671
|
this._operationManager.pushEditOperation(new (class {
|
|
673
672
|
constructor() {
|
|
674
673
|
this.type = 0 ;
|
|
675
|
-
this.label = 'Update
|
|
676
|
-
this.code = 'undoredo.
|
|
674
|
+
this.label = 'Update Cell Metadata';
|
|
675
|
+
this.code = 'undoredo.textBufferEdit';
|
|
677
676
|
}
|
|
678
677
|
get resource() {
|
|
679
678
|
return that.uri;
|
|
680
679
|
}
|
|
681
680
|
undo() {
|
|
682
|
-
that.
|
|
681
|
+
that._updateNotebookCellMetadata(oldMetadata, false, beginSelectionState, undoRedoGroup);
|
|
683
682
|
}
|
|
684
683
|
redo() {
|
|
685
|
-
that.
|
|
684
|
+
that._updateNotebookCellMetadata(metadata, false, beginSelectionState, undoRedoGroup);
|
|
686
685
|
}
|
|
687
|
-
})(), undefined,
|
|
686
|
+
})(), beginSelectionState, undefined, this._alternativeVersionId, undoRedoGroup);
|
|
688
687
|
}
|
|
689
688
|
}
|
|
690
689
|
this.metadata = metadata;
|
|
@@ -800,7 +799,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
800
799
|
}
|
|
801
800
|
return true;
|
|
802
801
|
}
|
|
803
|
-
_changeCellMetadataPartial(cell, metadata, computeUndoRedo) {
|
|
802
|
+
_changeCellMetadataPartial(cell, metadata, computeUndoRedo, beginSelectionState, undoRedoGroup) {
|
|
804
803
|
const newMetadata = {
|
|
805
804
|
...cell.metadata
|
|
806
805
|
};
|
|
@@ -809,9 +808,9 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
809
808
|
const value = metadata[k] ?? undefined;
|
|
810
809
|
newMetadata[k] = value;
|
|
811
810
|
}
|
|
812
|
-
return this._changeCellMetadata(cell, newMetadata, computeUndoRedo);
|
|
811
|
+
return this._changeCellMetadata(cell, newMetadata, computeUndoRedo, beginSelectionState, undoRedoGroup);
|
|
813
812
|
}
|
|
814
|
-
_changeCellMetadata(cell, metadata, computeUndoRedo) {
|
|
813
|
+
_changeCellMetadata(cell, metadata, computeUndoRedo, beginSelectionState, undoRedoGroup) {
|
|
815
814
|
const triggerDirtyChange = this._isCellMetadataChanged(cell.metadata, metadata);
|
|
816
815
|
if (triggerDirtyChange) {
|
|
817
816
|
if (computeUndoRedo) {
|
|
@@ -822,9 +821,9 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
822
821
|
if (!cell) {
|
|
823
822
|
return;
|
|
824
823
|
}
|
|
825
|
-
this._changeCellMetadata(cell, newMetadata, false);
|
|
824
|
+
this._changeCellMetadata(cell, newMetadata, false, beginSelectionState, undoRedoGroup);
|
|
826
825
|
}
|
|
827
|
-
})), undefined,
|
|
826
|
+
})), beginSelectionState, undefined, this._alternativeVersionId, undoRedoGroup);
|
|
828
827
|
}
|
|
829
828
|
}
|
|
830
829
|
cell.metadata = metadata;
|
|
@@ -852,7 +851,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
852
851
|
endSelectionState: undefined
|
|
853
852
|
});
|
|
854
853
|
}
|
|
855
|
-
_changeCellLanguage(cell, languageId, computeUndoRedo) {
|
|
854
|
+
_changeCellLanguage(cell, languageId, computeUndoRedo, beginSelectionState, undoRedoGroup) {
|
|
856
855
|
if (cell.language === languageId) {
|
|
857
856
|
return;
|
|
858
857
|
}
|
|
@@ -864,18 +863,18 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
864
863
|
constructor() {
|
|
865
864
|
this.type = 0 ;
|
|
866
865
|
this.label = 'Update Cell Language';
|
|
867
|
-
this.code = 'undoredo.
|
|
866
|
+
this.code = 'undoredo.textBufferEdit';
|
|
868
867
|
}
|
|
869
868
|
get resource() {
|
|
870
869
|
return that.uri;
|
|
871
870
|
}
|
|
872
871
|
undo() {
|
|
873
|
-
that._changeCellLanguage(cell, oldLanguage, false);
|
|
872
|
+
that._changeCellLanguage(cell, oldLanguage, false, beginSelectionState, undoRedoGroup);
|
|
874
873
|
}
|
|
875
874
|
redo() {
|
|
876
|
-
that._changeCellLanguage(cell, languageId, false);
|
|
875
|
+
that._changeCellLanguage(cell, languageId, false, beginSelectionState, undoRedoGroup);
|
|
877
876
|
}
|
|
878
|
-
})(), undefined,
|
|
877
|
+
})(), beginSelectionState, undefined, this._alternativeVersionId, undoRedoGroup);
|
|
879
878
|
}
|
|
880
879
|
this._pauseableEmitter.fire({
|
|
881
880
|
rawEvents: [{ kind: NotebookCellsChangeType.ChangeCellLanguage, index: this._cells.indexOf(cell), language: languageId, transient: false }],
|
|
@@ -952,13 +951,13 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
952
951
|
});
|
|
953
952
|
}
|
|
954
953
|
}
|
|
955
|
-
_moveCellToIdx(index, length, newIdx, synchronous, pushedToUndoStack, beforeSelections, endSelections) {
|
|
954
|
+
_moveCellToIdx(index, length, newIdx, synchronous, pushedToUndoStack, beforeSelections, endSelections, undoRedoGroup) {
|
|
956
955
|
if (pushedToUndoStack) {
|
|
957
956
|
this._operationManager.pushEditOperation(( new MoveCellEdit(this.uri, index, length, newIdx, {
|
|
958
957
|
moveCell: (fromIndex, length, toIndex, beforeSelections, endSelections) => {
|
|
959
|
-
this._moveCellToIdx(fromIndex, length, toIndex, true, false, beforeSelections, endSelections);
|
|
958
|
+
this._moveCellToIdx(fromIndex, length, toIndex, true, false, beforeSelections, endSelections, undoRedoGroup);
|
|
960
959
|
},
|
|
961
|
-
}, beforeSelections, endSelections)), beforeSelections, endSelections);
|
|
960
|
+
}, beforeSelections, endSelections)), beforeSelections, endSelections, this._alternativeVersionId, undoRedoGroup);
|
|
962
961
|
}
|
|
963
962
|
this._assertIndex(index);
|
|
964
963
|
this._assertIndex(newIdx);
|
package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
3
3
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
4
|
-
import { NotebookWorkingCopyTypeIdentifier, CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
4
|
+
import { NotebookWorkingCopyTypeIdentifier, NotebookSetting, CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
5
5
|
import { NotebookFileWorkingCopyModelFactory, SimpleNotebookEditorModel } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorModel';
|
|
6
6
|
import { ReferenceCollection, DisposableStore, dispose, combinedDisposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
7
7
|
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
@@ -54,7 +54,8 @@ let NotebookModelReferenceCollection = class NotebookModelReferenceCollection ex
|
|
|
54
54
|
workingCopyManager = this._instantiationService.createInstance(FileWorkingCopyManager, workingCopyTypeId, factory, factory);
|
|
55
55
|
this._workingCopyManagers.set(workingCopyTypeId, workingCopyManager);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const scratchPad = viewType === 'interactive' && this._configurationService.getValue(NotebookSetting.InteractiveWindowPromptToSave) !== true;
|
|
58
|
+
const model = this._instantiationService.createInstance(SimpleNotebookEditorModel, uri, hasAssociatedFilePath, viewType, workingCopyManager, scratchPad);
|
|
58
59
|
const result = await model.load({ limits });
|
|
59
60
|
let onDirtyAutoReference;
|
|
60
61
|
this._modelListener.set(result, combinedDisposable(result.onDidSave(() => this._onDidSaveNotebook.fire(result.resource)), result.onDidChangeDirty(() => {
|
|
@@ -29,7 +29,17 @@ import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/working
|
|
|
29
29
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
30
30
|
import { IDecorationsService } from 'vscode/vscode/vs/workbench/services/decorations/common/decorations';
|
|
31
31
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
32
|
-
import
|
|
32
|
+
import 'vscode/vscode/vs/platform/theme/common/colorUtils';
|
|
33
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
|
|
34
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
|
|
35
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
|
|
36
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/inputColors';
|
|
37
|
+
import { listErrorForeground } from 'vscode/vscode/vs/platform/theme/common/colors/listColors';
|
|
38
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/menuColors';
|
|
39
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
40
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
41
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
42
|
+
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
33
43
|
import { IFileDialogService, IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
34
44
|
|
|
35
45
|
var FileWorkingCopyManager_1;
|