@codingame/monaco-vscode-notebook-service-override 4.5.0 → 4.5.2
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 +1 -1
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +30 -44
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +24 -32
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +30 -53
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +40 -84
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +9 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +35 -48
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +2 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +94 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +8 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +3 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +25 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +71 -89
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +4 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +97 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +7 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +128 -177
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +132 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +70 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +32 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +39 -64
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +28 -43
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +23 -66
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +58 -57
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +162 -264
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +33 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +58 -153
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +15 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +22 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +5 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +100 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +6 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +41 -76
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +42 -45
- package/notebook.d.ts +0 -5
|
@@ -6,34 +6,28 @@ import { FoldingController } from 'vscode/vscode/vs/workbench/contrib/notebook/b
|
|
|
6
6
|
import { executeIcon } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
7
7
|
import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
8
8
|
|
|
9
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/controller/sectionActions";
|
|
9
10
|
class NotebookRunSingleCellInSection extends Action2 {
|
|
10
11
|
constructor() {
|
|
11
12
|
super({
|
|
12
13
|
id: 'notebook.section.runSingleCell',
|
|
13
14
|
title: {
|
|
14
|
-
...( localize2WithPath(
|
|
15
|
-
|
|
16
|
-
'runCell',
|
|
17
|
-
"Run Cell"
|
|
18
|
-
)),
|
|
19
|
-
mnemonicTitle: ( localizeWithPath(
|
|
20
|
-
'vs/workbench/contrib/notebook/browser/controller/sectionActions',
|
|
21
|
-
{ key: 'mirunCell', comment: ['&& denotes a mnemonic'] },
|
|
22
|
-
"&&Run Cell"
|
|
23
|
-
)),
|
|
15
|
+
...( localize2WithPath(_moduleId, 0, "Run Cell")),
|
|
16
|
+
mnemonicTitle: ( localizeWithPath(_moduleId, 1, "&&Run Cell")),
|
|
24
17
|
},
|
|
25
|
-
shortTitle: ( localizeWithPath(
|
|
26
|
-
'vs/workbench/contrib/notebook/browser/controller/sectionActions',
|
|
27
|
-
'runCell',
|
|
28
|
-
"Run Cell"
|
|
29
|
-
)),
|
|
18
|
+
shortTitle: ( localizeWithPath(_moduleId, 0, "Run Cell")),
|
|
30
19
|
icon: executeIcon,
|
|
31
20
|
menu: [
|
|
32
21
|
{
|
|
33
22
|
id: MenuId.NotebookOutlineActionMenu,
|
|
34
23
|
group: 'inline',
|
|
35
24
|
order: 1,
|
|
36
|
-
when: ( ContextKeyExpr.and(
|
|
25
|
+
when: ( (ContextKeyExpr.and(
|
|
26
|
+
(NotebookOutlineContext.CellKind.isEqualTo(CellKind.Code)),
|
|
27
|
+
(NotebookOutlineContext.OutlineElementTarget.isEqualTo(1 )),
|
|
28
|
+
(NotebookOutlineContext.CellHasChildren.toNegated()),
|
|
29
|
+
(NotebookOutlineContext.CellHasHeader.toNegated())
|
|
30
|
+
)))
|
|
37
31
|
}
|
|
38
32
|
]
|
|
39
33
|
});
|
|
@@ -50,22 +44,10 @@ class NotebookRunCellsInSection extends Action2 {
|
|
|
50
44
|
super({
|
|
51
45
|
id: 'notebook.section.runCells',
|
|
52
46
|
title: {
|
|
53
|
-
...( localize2WithPath(
|
|
54
|
-
|
|
55
|
-
'runCellsInSection',
|
|
56
|
-
"Run Cells In Section"
|
|
57
|
-
)),
|
|
58
|
-
mnemonicTitle: ( localizeWithPath(
|
|
59
|
-
'vs/workbench/contrib/notebook/browser/controller/sectionActions',
|
|
60
|
-
{ key: 'mirunCellsInSection', comment: ['&& denotes a mnemonic'] },
|
|
61
|
-
"&&Run Cells In Section"
|
|
62
|
-
)),
|
|
47
|
+
...( localize2WithPath(_moduleId, 2, "Run Cells In Section")),
|
|
48
|
+
mnemonicTitle: ( localizeWithPath(_moduleId, 3, "&&Run Cells In Section")),
|
|
63
49
|
},
|
|
64
|
-
shortTitle: ( localizeWithPath(
|
|
65
|
-
'vs/workbench/contrib/notebook/browser/controller/sectionActions',
|
|
66
|
-
'runCellsInSection',
|
|
67
|
-
"Run Cells In Section"
|
|
68
|
-
)),
|
|
50
|
+
shortTitle: ( localizeWithPath(_moduleId, 2, "Run Cells In Section")),
|
|
69
51
|
menu: [
|
|
70
52
|
{
|
|
71
53
|
id: MenuId.NotebookStickyScrollContext,
|
|
@@ -76,7 +58,12 @@ class NotebookRunCellsInSection extends Action2 {
|
|
|
76
58
|
id: MenuId.NotebookOutlineActionMenu,
|
|
77
59
|
group: 'inline',
|
|
78
60
|
order: 1,
|
|
79
|
-
when: ( ContextKeyExpr.and(
|
|
61
|
+
when: ( (ContextKeyExpr.and(
|
|
62
|
+
(NotebookOutlineContext.CellKind.isEqualTo(CellKind.Markup)),
|
|
63
|
+
(NotebookOutlineContext.OutlineElementTarget.isEqualTo(1 )),
|
|
64
|
+
NotebookOutlineContext.CellHasChildren,
|
|
65
|
+
NotebookOutlineContext.CellHasHeader
|
|
66
|
+
)))
|
|
80
67
|
}
|
|
81
68
|
]
|
|
82
69
|
});
|
|
@@ -103,28 +90,22 @@ class NotebookFoldSection extends Action2 {
|
|
|
103
90
|
super({
|
|
104
91
|
id: 'notebook.section.foldSection',
|
|
105
92
|
title: {
|
|
106
|
-
...( localize2WithPath(
|
|
107
|
-
|
|
108
|
-
'foldSection',
|
|
109
|
-
"Fold Section"
|
|
110
|
-
)),
|
|
111
|
-
mnemonicTitle: ( localizeWithPath(
|
|
112
|
-
'vs/workbench/contrib/notebook/browser/controller/sectionActions',
|
|
113
|
-
{ key: 'mifoldSection', comment: ['&& denotes a mnemonic'] },
|
|
114
|
-
"&&Fold Section"
|
|
115
|
-
)),
|
|
93
|
+
...( localize2WithPath(_moduleId, 4, "Fold Section")),
|
|
94
|
+
mnemonicTitle: ( localizeWithPath(_moduleId, 5, "&&Fold Section")),
|
|
116
95
|
},
|
|
117
|
-
shortTitle: ( localizeWithPath(
|
|
118
|
-
'vs/workbench/contrib/notebook/browser/controller/sectionActions',
|
|
119
|
-
'foldSection',
|
|
120
|
-
"Fold Section"
|
|
121
|
-
)),
|
|
96
|
+
shortTitle: ( localizeWithPath(_moduleId, 4, "Fold Section")),
|
|
122
97
|
menu: [
|
|
123
98
|
{
|
|
124
99
|
id: MenuId.NotebookOutlineActionMenu,
|
|
125
100
|
group: 'notebookFolding',
|
|
126
101
|
order: 2,
|
|
127
|
-
when: ( ContextKeyExpr.and(
|
|
102
|
+
when: ( (ContextKeyExpr.and(
|
|
103
|
+
(NotebookOutlineContext.CellKind.isEqualTo(CellKind.Markup)),
|
|
104
|
+
(NotebookOutlineContext.OutlineElementTarget.isEqualTo(1 )),
|
|
105
|
+
NotebookOutlineContext.CellHasChildren,
|
|
106
|
+
NotebookOutlineContext.CellHasHeader,
|
|
107
|
+
(NotebookOutlineContext.CellFoldingState.isEqualTo(1 ))
|
|
108
|
+
)))
|
|
128
109
|
}
|
|
129
110
|
]
|
|
130
111
|
});
|
|
@@ -148,28 +129,22 @@ class NotebookExpandSection extends Action2 {
|
|
|
148
129
|
super({
|
|
149
130
|
id: 'notebook.section.expandSection',
|
|
150
131
|
title: {
|
|
151
|
-
...( localize2WithPath(
|
|
152
|
-
|
|
153
|
-
'expandSection',
|
|
154
|
-
"Expand Section"
|
|
155
|
-
)),
|
|
156
|
-
mnemonicTitle: ( localizeWithPath(
|
|
157
|
-
'vs/workbench/contrib/notebook/browser/controller/sectionActions',
|
|
158
|
-
{ key: 'miexpandSection', comment: ['&& denotes a mnemonic'] },
|
|
159
|
-
"&&Expand Section"
|
|
160
|
-
)),
|
|
132
|
+
...( localize2WithPath(_moduleId, 6, "Expand Section")),
|
|
133
|
+
mnemonicTitle: ( localizeWithPath(_moduleId, 7, "&&Expand Section")),
|
|
161
134
|
},
|
|
162
|
-
shortTitle: ( localizeWithPath(
|
|
163
|
-
'vs/workbench/contrib/notebook/browser/controller/sectionActions',
|
|
164
|
-
'expandSection',
|
|
165
|
-
"Expand Section"
|
|
166
|
-
)),
|
|
135
|
+
shortTitle: ( localizeWithPath(_moduleId, 6, "Expand Section")),
|
|
167
136
|
menu: [
|
|
168
137
|
{
|
|
169
138
|
id: MenuId.NotebookOutlineActionMenu,
|
|
170
139
|
group: 'notebookFolding',
|
|
171
140
|
order: 2,
|
|
172
|
-
when: ( ContextKeyExpr.and(
|
|
141
|
+
when: ( (ContextKeyExpr.and(
|
|
142
|
+
(NotebookOutlineContext.CellKind.isEqualTo(CellKind.Markup)),
|
|
143
|
+
(NotebookOutlineContext.OutlineElementTarget.isEqualTo(1 )),
|
|
144
|
+
NotebookOutlineContext.CellHasChildren,
|
|
145
|
+
NotebookOutlineContext.CellHasHeader,
|
|
146
|
+
(NotebookOutlineContext.CellFoldingState.isEqualTo(2 ))
|
|
147
|
+
)))
|
|
173
148
|
}
|
|
174
149
|
]
|
|
175
150
|
});
|
|
@@ -10,6 +10,7 @@ import { mimetypeIcon } from 'vscode/vscode/vs/workbench/contrib/notebook/browse
|
|
|
10
10
|
import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
|
|
11
11
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
12
12
|
|
|
13
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/diff/diffElementOutputs";
|
|
13
14
|
class OutputElement extends Disposable {
|
|
14
15
|
constructor(_notebookEditor, _notebookTextModel, _notebookService, _quickInputService, _diffElementViewModel, _diffSide, _nestedCell, _outputContainer, output) {
|
|
15
16
|
super();
|
|
@@ -22,7 +23,7 @@ class OutputElement extends Disposable {
|
|
|
22
23
|
this._nestedCell = _nestedCell;
|
|
23
24
|
this._outputContainer = _outputContainer;
|
|
24
25
|
this.output = output;
|
|
25
|
-
this.resizeListener = this._register(( new DisposableStore()));
|
|
26
|
+
this.resizeListener = this._register(( (new DisposableStore())));
|
|
26
27
|
}
|
|
27
28
|
render(index, beforeElement) {
|
|
28
29
|
const outputItemDiv = document.createElement('div');
|
|
@@ -35,10 +36,10 @@ class OutputElement extends Disposable {
|
|
|
35
36
|
mimeTypePicker.classList.add(...ThemeIcon.asClassNameArray(mimetypeIcon));
|
|
36
37
|
mimeTypePicker.tabIndex = 0;
|
|
37
38
|
mimeTypePicker.title = ( localizeWithPath(
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
_moduleId,
|
|
40
|
+
0,
|
|
40
41
|
"Choose a different output mimetype, available mimetypes: {0}",
|
|
41
|
-
( mimeTypes.map(mimeType => mimeType.mimeType)).join(', ')
|
|
42
|
+
( (mimeTypes.map(mimeType => mimeType.mimeType))).join(', ')
|
|
42
43
|
));
|
|
43
44
|
outputItemDiv.appendChild(mimeTypePicker);
|
|
44
45
|
this.resizeListener.add(addStandardDisposableListener(mimeTypePicker, 'mousedown', async (e) => {
|
|
@@ -49,7 +50,7 @@ class OutputElement extends Disposable {
|
|
|
49
50
|
}
|
|
50
51
|
}));
|
|
51
52
|
this.resizeListener.add((addDisposableListener(mimeTypePicker, EventType.KEY_DOWN, async (e) => {
|
|
52
|
-
const event = ( new StandardKeyboardEvent(e));
|
|
53
|
+
const event = ( (new StandardKeyboardEvent(e)));
|
|
53
54
|
if ((event.equals(3 ) || event.equals(10 ))) {
|
|
54
55
|
e.preventDefault();
|
|
55
56
|
e.stopPropagation();
|
|
@@ -83,18 +84,14 @@ class OutputElement extends Disposable {
|
|
|
83
84
|
}
|
|
84
85
|
_renderMissingRenderer(viewModel, preferredMimeType) {
|
|
85
86
|
if (!viewModel.model.outputs.length) {
|
|
86
|
-
return this._renderMessage(viewModel, ( localizeWithPath(
|
|
87
|
-
'vs/workbench/contrib/notebook/browser/diff/diffElementOutputs',
|
|
88
|
-
'empty',
|
|
89
|
-
"Cell has no output"
|
|
90
|
-
)));
|
|
87
|
+
return this._renderMessage(viewModel, ( localizeWithPath(_moduleId, 1, "Cell has no output")));
|
|
91
88
|
}
|
|
92
89
|
if (!preferredMimeType) {
|
|
93
|
-
const mimeTypes = ( viewModel.model.outputs.map(op => op.mime));
|
|
90
|
+
const mimeTypes = ( (viewModel.model.outputs.map(op => op.mime)));
|
|
94
91
|
const mimeTypesMessage = mimeTypes.join(', ');
|
|
95
92
|
return this._renderMessage(viewModel, ( localizeWithPath(
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
_moduleId,
|
|
94
|
+
2,
|
|
98
95
|
"No renderer could be found for output. It has the following mimetypes: {0}",
|
|
99
96
|
mimeTypesMessage
|
|
100
97
|
)));
|
|
@@ -117,39 +114,31 @@ class OutputElement extends Disposable {
|
|
|
117
114
|
}
|
|
118
115
|
async pickActiveMimeTypeRenderer(notebookTextModel, viewModel) {
|
|
119
116
|
const [mimeTypes, currIndex] = viewModel.resolveMimeTypes(notebookTextModel, undefined);
|
|
120
|
-
const items = ( mimeTypes.filter(mimeType => mimeType.isTrusted).map((mimeType, index) => ({
|
|
117
|
+
const items = ( (mimeTypes.filter(mimeType => mimeType.isTrusted).map((mimeType, index) => ({
|
|
121
118
|
label: mimeType.mimeType,
|
|
122
119
|
id: mimeType.mimeType,
|
|
123
120
|
index: index,
|
|
124
121
|
picked: index === currIndex,
|
|
125
122
|
detail: this.generateRendererInfo(mimeType.rendererId),
|
|
126
|
-
description: index === currIndex ? ( localizeWithPath(
|
|
127
|
-
|
|
128
|
-
'curruentActiveMimeType',
|
|
129
|
-
"Currently Active"
|
|
130
|
-
)) : undefined
|
|
131
|
-
})));
|
|
123
|
+
description: index === currIndex ? ( localizeWithPath(_moduleId, 3, "Currently Active")) : undefined
|
|
124
|
+
}))));
|
|
132
125
|
const picker = this._quickInputService.createQuickPick();
|
|
133
126
|
picker.items = items;
|
|
134
127
|
picker.activeItems = items.filter(item => !!item.picked);
|
|
135
128
|
picker.placeholder = items.length !== mimeTypes.length
|
|
136
129
|
? ( localizeWithPath(
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
_moduleId,
|
|
131
|
+
4,
|
|
139
132
|
"Select mimetype to render for current output. Rich mimetypes are available only when the notebook is trusted"
|
|
140
133
|
))
|
|
141
|
-
: ( localizeWithPath(
|
|
142
|
-
|
|
143
|
-
'promptChooseMimeType.placeHolder',
|
|
144
|
-
"Select mimetype to render for current output"
|
|
145
|
-
));
|
|
146
|
-
const pick = await ( new Promise(resolve => {
|
|
134
|
+
: ( localizeWithPath(_moduleId, 5, "Select mimetype to render for current output"));
|
|
135
|
+
const pick = await ( (new Promise(resolve => {
|
|
147
136
|
picker.onDidAccept(() => {
|
|
148
137
|
resolve(picker.selectedItems.length === 1 ? picker.selectedItems[0].index : undefined);
|
|
149
138
|
picker.dispose();
|
|
150
139
|
});
|
|
151
140
|
picker.show();
|
|
152
|
-
}));
|
|
141
|
+
})));
|
|
153
142
|
if (pick === undefined) {
|
|
154
143
|
return;
|
|
155
144
|
}
|
|
@@ -172,11 +161,7 @@ class OutputElement extends Disposable {
|
|
|
172
161
|
const displayName = renderInfo.displayName !== '' ? renderInfo.displayName : renderInfo.id;
|
|
173
162
|
return `${displayName} (${renderInfo.extensionId.value})`;
|
|
174
163
|
}
|
|
175
|
-
return ( localizeWithPath(
|
|
176
|
-
'vs/workbench/contrib/notebook/browser/diff/diffElementOutputs',
|
|
177
|
-
'builtinRenderInfo',
|
|
178
|
-
"built-in"
|
|
179
|
-
));
|
|
164
|
+
return ( localizeWithPath(_moduleId, 6, "built-in"));
|
|
180
165
|
}
|
|
181
166
|
getCellOutputCurrentIndex() {
|
|
182
167
|
return this._diffElementViewModel.getNestedCellViewModel(this._diffSide).outputs.indexOf(this.output.model);
|
|
@@ -202,7 +187,7 @@ let OutputContainer = class OutputContainer extends Disposable {
|
|
|
202
187
|
this._outputContainer = _outputContainer;
|
|
203
188
|
this._notebookService = _notebookService;
|
|
204
189
|
this._quickInputService = _quickInputService;
|
|
205
|
-
this._outputEntries = ( new Map());
|
|
190
|
+
this._outputEntries = ( (new Map()));
|
|
206
191
|
this._register(this._diffElementViewModel.onDidLayoutChange(() => {
|
|
207
192
|
this._outputEntries.forEach((value, key) => {
|
|
208
193
|
const index = _nestedCellViewModel.outputs.indexOf(key.model);
|
|
@@ -232,7 +217,7 @@ let OutputContainer = class OutputContainer extends Disposable {
|
|
|
232
217
|
let prevElement = undefined;
|
|
233
218
|
const outputsToRender = this._nestedCellViewModel.outputsViewModels;
|
|
234
219
|
outputsToRender.reverse().forEach(output => {
|
|
235
|
-
if (( this._outputEntries.has(output))) {
|
|
220
|
+
if (( (this._outputEntries.has(output)))) {
|
|
236
221
|
prevElement = this._outputEntries.get(output).domNode;
|
|
237
222
|
return;
|
|
238
223
|
}
|
|
@@ -259,8 +244,8 @@ let OutputContainer = class OutputContainer extends Disposable {
|
|
|
259
244
|
});
|
|
260
245
|
}
|
|
261
246
|
_renderOutput(currOutput, index, beforeElement) {
|
|
262
|
-
if (!( this._outputEntries.has(currOutput))) {
|
|
263
|
-
this._outputEntries.set(currOutput, ( new OutputElement(
|
|
247
|
+
if (!( (this._outputEntries.has(currOutput)))) {
|
|
248
|
+
this._outputEntries.set(currOutput, ( (new OutputElement(
|
|
264
249
|
this._editor,
|
|
265
250
|
this._notebookTextModel,
|
|
266
251
|
this._notebookService,
|
|
@@ -270,15 +255,15 @@ let OutputContainer = class OutputContainer extends Disposable {
|
|
|
270
255
|
this._nestedCellViewModel,
|
|
271
256
|
this._outputContainer,
|
|
272
257
|
currOutput
|
|
273
|
-
)));
|
|
258
|
+
))));
|
|
274
259
|
}
|
|
275
260
|
const renderElement = this._outputEntries.get(currOutput);
|
|
276
261
|
renderElement.render(index, beforeElement);
|
|
277
262
|
}
|
|
278
263
|
};
|
|
279
|
-
OutputContainer = ( __decorate([
|
|
280
|
-
( __param(6, INotebookService)),
|
|
281
|
-
( __param(7, IQuickInputService))
|
|
282
|
-
], OutputContainer));
|
|
264
|
+
OutputContainer = ( (__decorate([
|
|
265
|
+
( (__param(6, INotebookService))),
|
|
266
|
+
( (__param(7, IQuickInputService)))
|
|
267
|
+
], OutputContainer)));
|
|
283
268
|
|
|
284
269
|
export { OutputContainer, OutputElement };
|
|
@@ -19,43 +19,43 @@ class DiffElementViewModelBase extends Disposable {
|
|
|
19
19
|
this._layout({ rawOutputHeight: Math.min(OUTPUT_EDITOR_HEIGHT_MAGIC, height) });
|
|
20
20
|
}
|
|
21
21
|
get rawOutputHeight() {
|
|
22
|
-
throw new Error('Use Cell.layoutInfo.rawOutputHeight');
|
|
22
|
+
throw ( new Error('Use Cell.layoutInfo.rawOutputHeight'));
|
|
23
23
|
}
|
|
24
24
|
set outputStatusHeight(height) {
|
|
25
25
|
this._layout({ outputStatusHeight: height });
|
|
26
26
|
}
|
|
27
27
|
get outputStatusHeight() {
|
|
28
|
-
throw new Error('Use Cell.layoutInfo.outputStatusHeight');
|
|
28
|
+
throw ( new Error('Use Cell.layoutInfo.outputStatusHeight'));
|
|
29
29
|
}
|
|
30
30
|
set outputMetadataHeight(height) {
|
|
31
31
|
this._layout({ outputMetadataHeight: height });
|
|
32
32
|
}
|
|
33
33
|
get outputMetadataHeight() {
|
|
34
|
-
throw new Error('Use Cell.layoutInfo.outputStatusHeight');
|
|
34
|
+
throw ( new Error('Use Cell.layoutInfo.outputStatusHeight'));
|
|
35
35
|
}
|
|
36
36
|
set editorHeight(height) {
|
|
37
37
|
this._layout({ editorHeight: height });
|
|
38
38
|
}
|
|
39
39
|
get editorHeight() {
|
|
40
|
-
throw new Error('Use Cell.layoutInfo.editorHeight');
|
|
40
|
+
throw ( new Error('Use Cell.layoutInfo.editorHeight'));
|
|
41
41
|
}
|
|
42
42
|
set editorMargin(margin) {
|
|
43
43
|
this._layout({ editorMargin: margin });
|
|
44
44
|
}
|
|
45
45
|
get editorMargin() {
|
|
46
|
-
throw new Error('Use Cell.layoutInfo.editorMargin');
|
|
46
|
+
throw ( new Error('Use Cell.layoutInfo.editorMargin'));
|
|
47
47
|
}
|
|
48
48
|
set metadataStatusHeight(height) {
|
|
49
49
|
this._layout({ metadataStatusHeight: height });
|
|
50
50
|
}
|
|
51
51
|
get metadataStatusHeight() {
|
|
52
|
-
throw new Error('Use Cell.layoutInfo.outputStatusHeight');
|
|
52
|
+
throw ( new Error('Use Cell.layoutInfo.outputStatusHeight'));
|
|
53
53
|
}
|
|
54
54
|
set metadataHeight(height) {
|
|
55
55
|
this._layout({ metadataHeight: height });
|
|
56
56
|
}
|
|
57
57
|
get metadataHeight() {
|
|
58
|
-
throw new Error('Use Cell.layoutInfo.metadataHeight');
|
|
58
|
+
throw ( new Error('Use Cell.layoutInfo.metadataHeight'));
|
|
59
59
|
}
|
|
60
60
|
set renderOutput(value) {
|
|
61
61
|
this._renderOutput = value;
|
|
@@ -83,13 +83,13 @@ let DiffNestedCellViewModel = class DiffNestedCellViewModel extends Disposable {
|
|
|
83
83
|
getOutputOffset(index) {
|
|
84
84
|
this._ensureOutputsTop();
|
|
85
85
|
if (index >= this._outputCollection.length) {
|
|
86
|
-
throw new Error('Output index out of range!');
|
|
86
|
+
throw ( new Error('Output index out of range!'));
|
|
87
87
|
}
|
|
88
88
|
return this._outputsTop.getPrefixSum(index - 1);
|
|
89
89
|
}
|
|
90
90
|
updateOutputHeight(index, height) {
|
|
91
91
|
if (index >= this._outputCollection.length) {
|
|
92
|
-
throw new Error('Output index out of range!');
|
|
92
|
+
throw ( new Error('Output index out of range!'));
|
|
93
93
|
}
|
|
94
94
|
this._ensureOutputsTop();
|
|
95
95
|
this._outputCollection[index] = height;
|
|
@@ -14,21 +14,18 @@ import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/confi
|
|
|
14
14
|
import { DEFAULT_EDITOR_ASSOCIATION } from 'vscode/vscode/vs/workbench/common/editor';
|
|
15
15
|
import { NOTEBOOK_DIFF_EDITOR_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
16
16
|
|
|
17
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/diff/notebookDiffActions";
|
|
17
18
|
registerAction2(class extends Action2 {
|
|
18
19
|
constructor() {
|
|
19
20
|
super({
|
|
20
21
|
id: 'notebook.diff.switchToText',
|
|
21
22
|
icon: openAsTextIcon,
|
|
22
|
-
title: ( localize2WithPath(
|
|
23
|
-
|
|
24
|
-
'notebook.diff.switchToText',
|
|
25
|
-
'Open Text Diff Editor'
|
|
26
|
-
)),
|
|
27
|
-
precondition: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)),
|
|
23
|
+
title: ( localize2WithPath(_moduleId, 0, 'Open Text Diff Editor')),
|
|
24
|
+
precondition: ( (ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))),
|
|
28
25
|
menu: [{
|
|
29
26
|
id: MenuId.EditorTitle,
|
|
30
27
|
group: 'navigation',
|
|
31
|
-
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
28
|
+
when: ( (ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)))
|
|
32
29
|
}]
|
|
33
30
|
});
|
|
34
31
|
}
|
|
@@ -53,11 +50,7 @@ registerAction2(class extends Action2 {
|
|
|
53
50
|
constructor() {
|
|
54
51
|
super({
|
|
55
52
|
id: 'notebook.diff.cell.revertMetadata',
|
|
56
|
-
title: ( localizeWithPath(
|
|
57
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
58
|
-
'notebook.diff.cell.revertMetadata',
|
|
59
|
-
"Revert Metadata"
|
|
60
|
-
)),
|
|
53
|
+
title: ( localizeWithPath(_moduleId, 1, "Revert Metadata")),
|
|
61
54
|
icon: revertIcon,
|
|
62
55
|
f1: false,
|
|
63
56
|
menu: {
|
|
@@ -83,11 +76,7 @@ registerAction2(class extends Action2 {
|
|
|
83
76
|
constructor() {
|
|
84
77
|
super({
|
|
85
78
|
id: 'notebook.diff.cell.switchOutputRenderingStyleToText',
|
|
86
|
-
title: ( localizeWithPath(
|
|
87
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
88
|
-
'notebook.diff.cell.switchOutputRenderingStyleToText',
|
|
89
|
-
"Switch Output Rendering"
|
|
90
|
-
)),
|
|
79
|
+
title: ( localizeWithPath(_moduleId, 2, "Switch Output Rendering")),
|
|
91
80
|
icon: renderOutputIcon,
|
|
92
81
|
f1: false,
|
|
93
82
|
menu: {
|
|
@@ -107,11 +96,7 @@ registerAction2(class extends Action2 {
|
|
|
107
96
|
constructor() {
|
|
108
97
|
super({
|
|
109
98
|
id: 'notebook.diff.cell.revertOutputs',
|
|
110
|
-
title: ( localizeWithPath(
|
|
111
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
112
|
-
'notebook.diff.cell.revertOutputs',
|
|
113
|
-
"Revert Outputs"
|
|
114
|
-
)),
|
|
99
|
+
title: ( localizeWithPath(_moduleId, 3, "Revert Outputs")),
|
|
115
100
|
icon: revertIcon,
|
|
116
101
|
f1: false,
|
|
117
102
|
menu: {
|
|
@@ -143,11 +128,7 @@ registerAction2(class extends Action2 {
|
|
|
143
128
|
constructor() {
|
|
144
129
|
super({
|
|
145
130
|
id: 'notebook.diff.cell.revertInput',
|
|
146
|
-
title: ( localizeWithPath(
|
|
147
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
148
|
-
'notebook.diff.cell.revertInput',
|
|
149
|
-
"Revert Input"
|
|
150
|
-
)),
|
|
131
|
+
title: ( localizeWithPath(_moduleId, 4, "Revert Input")),
|
|
151
132
|
icon: revertIcon,
|
|
152
133
|
f1: false,
|
|
153
134
|
menu: {
|
|
@@ -168,10 +149,10 @@ registerAction2(class extends Action2 {
|
|
|
168
149
|
}
|
|
169
150
|
const bulkEditService = accessor.get(IBulkEditService);
|
|
170
151
|
return bulkEditService.apply([
|
|
171
|
-
( new ResourceTextEdit(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
152
|
+
( (new ResourceTextEdit(
|
|
153
|
+
modified.uri,
|
|
154
|
+
{ range: modified.textModel.getFullModelRange(), text: original.textModel.getValue() }
|
|
155
|
+
))),
|
|
175
156
|
], { quotableLabel: 'Revert Notebook Cell Content Change' });
|
|
176
157
|
}
|
|
177
158
|
});
|
|
@@ -206,42 +187,30 @@ class ToggleRenderAction extends Action2 {
|
|
|
206
187
|
}
|
|
207
188
|
registerAction2(class extends ToggleRenderAction {
|
|
208
189
|
constructor() {
|
|
209
|
-
super('notebook.diff.showOutputs', ( localize2WithPath(
|
|
210
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
211
|
-
'notebook.diff.showOutputs',
|
|
212
|
-
'Show Outputs Differences'
|
|
213
|
-
)), ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)), ( ContextKeyExpr.notEquals('config.notebook.diff.ignoreOutputs', true)), 2, true, undefined);
|
|
190
|
+
super('notebook.diff.showOutputs', ( localize2WithPath(_moduleId, 5, 'Show Outputs Differences')), ( (ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))), ( (ContextKeyExpr.notEquals('config.notebook.diff.ignoreOutputs', true))), 2, true, undefined);
|
|
214
191
|
}
|
|
215
192
|
});
|
|
216
193
|
registerAction2(class extends ToggleRenderAction {
|
|
217
194
|
constructor() {
|
|
218
|
-
super('notebook.diff.showMetadata', ( localize2WithPath(
|
|
219
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
220
|
-
'notebook.diff.showMetadata',
|
|
221
|
-
'Show Metadata Differences'
|
|
222
|
-
)), ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)), ( ContextKeyExpr.notEquals('config.notebook.diff.ignoreMetadata', true)), 1, undefined, true);
|
|
195
|
+
super('notebook.diff.showMetadata', ( localize2WithPath(_moduleId, 6, 'Show Metadata Differences')), ( (ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))), ( (ContextKeyExpr.notEquals('config.notebook.diff.ignoreMetadata', true))), 1, undefined, true);
|
|
223
196
|
}
|
|
224
197
|
});
|
|
225
198
|
registerAction2(class extends Action2 {
|
|
226
199
|
constructor() {
|
|
227
200
|
super({
|
|
228
201
|
id: 'notebook.diff.action.previous',
|
|
229
|
-
title: ( localizeWithPath(
|
|
230
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
231
|
-
'notebook.diff.action.previous.title',
|
|
232
|
-
"Show Previous Change"
|
|
233
|
-
)),
|
|
202
|
+
title: ( localizeWithPath(_moduleId, 7, "Show Previous Change")),
|
|
234
203
|
icon: previousChangeIcon,
|
|
235
204
|
f1: false,
|
|
236
205
|
keybinding: {
|
|
237
206
|
primary: 1024 | 512 | 61 ,
|
|
238
207
|
weight: 200 ,
|
|
239
|
-
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
208
|
+
when: ( (ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)))
|
|
240
209
|
},
|
|
241
210
|
menu: {
|
|
242
211
|
id: MenuId.EditorTitle,
|
|
243
212
|
group: 'navigation',
|
|
244
|
-
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
213
|
+
when: ( (ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)))
|
|
245
214
|
}
|
|
246
215
|
});
|
|
247
216
|
}
|
|
@@ -258,22 +227,18 @@ registerAction2(class extends Action2 {
|
|
|
258
227
|
constructor() {
|
|
259
228
|
super({
|
|
260
229
|
id: 'notebook.diff.action.next',
|
|
261
|
-
title: ( localizeWithPath(
|
|
262
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
263
|
-
'notebook.diff.action.next.title',
|
|
264
|
-
"Show Next Change"
|
|
265
|
-
)),
|
|
230
|
+
title: ( localizeWithPath(_moduleId, 8, "Show Next Change")),
|
|
266
231
|
icon: nextChangeIcon,
|
|
267
232
|
f1: false,
|
|
268
233
|
keybinding: {
|
|
269
234
|
primary: 512 | 61 ,
|
|
270
235
|
weight: 200 ,
|
|
271
|
-
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
236
|
+
when: ( (ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)))
|
|
272
237
|
},
|
|
273
238
|
menu: {
|
|
274
239
|
id: MenuId.EditorTitle,
|
|
275
240
|
group: 'navigation',
|
|
276
|
-
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
241
|
+
when: ( (ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)))
|
|
277
242
|
}
|
|
278
243
|
});
|
|
279
244
|
}
|
|
@@ -286,7 +251,7 @@ registerAction2(class extends Action2 {
|
|
|
286
251
|
editor?.nextChange();
|
|
287
252
|
}
|
|
288
253
|
});
|
|
289
|
-
( Registry.as(Extensions.Configuration)).registerConfiguration({
|
|
254
|
+
( (Registry.as(Extensions.Configuration))).registerConfiguration({
|
|
290
255
|
id: 'notebook',
|
|
291
256
|
order: 100,
|
|
292
257
|
type: 'object',
|
|
@@ -294,20 +259,12 @@ registerAction2(class extends Action2 {
|
|
|
294
259
|
'notebook.diff.ignoreMetadata': {
|
|
295
260
|
type: 'boolean',
|
|
296
261
|
default: false,
|
|
297
|
-
markdownDescription: ( localizeWithPath(
|
|
298
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
299
|
-
'notebook.diff.ignoreMetadata',
|
|
300
|
-
"Hide Metadata Differences"
|
|
301
|
-
))
|
|
262
|
+
markdownDescription: ( localizeWithPath(_moduleId, 9, "Hide Metadata Differences"))
|
|
302
263
|
},
|
|
303
264
|
'notebook.diff.ignoreOutputs': {
|
|
304
265
|
type: 'boolean',
|
|
305
266
|
default: false,
|
|
306
|
-
markdownDescription: ( localizeWithPath(
|
|
307
|
-
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
308
|
-
'notebook.diff.ignoreOutputs',
|
|
309
|
-
"Hide Outputs Differences"
|
|
310
|
-
))
|
|
267
|
+
markdownDescription: ( localizeWithPath(_moduleId, 10, "Hide Outputs Differences"))
|
|
311
268
|
},
|
|
312
269
|
}
|
|
313
270
|
});
|