@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
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js
CHANGED
|
@@ -17,9 +17,10 @@ import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/noteb
|
|
|
17
17
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
18
18
|
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
19
19
|
|
|
20
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar";
|
|
20
21
|
let ImplictKernelSelector = class ImplictKernelSelector {
|
|
21
22
|
constructor(notebook, suggested, notebookKernelService, languageFeaturesService, logService) {
|
|
22
|
-
const disposables = ( new DisposableStore());
|
|
23
|
+
const disposables = ( (new DisposableStore()));
|
|
23
24
|
this.dispose = disposables.dispose.bind(disposables);
|
|
24
25
|
const selectKernel = () => {
|
|
25
26
|
disposables.clear();
|
|
@@ -47,11 +48,11 @@ let ImplictKernelSelector = class ImplictKernelSelector {
|
|
|
47
48
|
}));
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
|
-
ImplictKernelSelector = ( __decorate([
|
|
51
|
-
( __param(2, INotebookKernelService)),
|
|
52
|
-
( __param(3, ILanguageFeaturesService)),
|
|
53
|
-
( __param(4, ILogService))
|
|
54
|
-
], ImplictKernelSelector));
|
|
51
|
+
ImplictKernelSelector = ( (__decorate([
|
|
52
|
+
( (__param(2, INotebookKernelService))),
|
|
53
|
+
( (__param(3, ILanguageFeaturesService))),
|
|
54
|
+
( (__param(4, ILogService)))
|
|
55
|
+
], ImplictKernelSelector)));
|
|
55
56
|
let KernelStatus = class KernelStatus extends Disposable {
|
|
56
57
|
constructor(_editorService, _statusbarService, _notebookKernelService, _instantiationService) {
|
|
57
58
|
super();
|
|
@@ -59,8 +60,8 @@ let KernelStatus = class KernelStatus extends Disposable {
|
|
|
59
60
|
this._statusbarService = _statusbarService;
|
|
60
61
|
this._notebookKernelService = _notebookKernelService;
|
|
61
62
|
this._instantiationService = _instantiationService;
|
|
62
|
-
this._editorDisposables = this._register(( new DisposableStore()));
|
|
63
|
-
this._kernelInfoElement = this._register(( new DisposableStore()));
|
|
63
|
+
this._editorDisposables = this._register(( (new DisposableStore())));
|
|
64
|
+
this._kernelInfoElement = this._register(( (new DisposableStore())));
|
|
64
65
|
this._register(this._editorService.onDidActiveEditorChange(() => this._updateStatusbar()));
|
|
65
66
|
}
|
|
66
67
|
_updateStatusbar() {
|
|
@@ -108,60 +109,39 @@ let KernelStatus = class KernelStatus extends Disposable {
|
|
|
108
109
|
}
|
|
109
110
|
const tooltip = kernel.description ?? kernel.detail ?? kernel.label;
|
|
110
111
|
this._kernelInfoElement.add(this._statusbarService.addEntry({
|
|
111
|
-
name: ( localizeWithPath(
|
|
112
|
-
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
113
|
-
'notebook.info',
|
|
114
|
-
"Notebook Kernel Info"
|
|
115
|
-
)),
|
|
112
|
+
name: ( localizeWithPath(_moduleId, 0, "Notebook Kernel Info")),
|
|
116
113
|
text: `$(notebook-kernel-select) ${kernel.label}`,
|
|
117
114
|
ariaLabel: kernel.label,
|
|
118
|
-
tooltip: isSuggested ? ( localizeWithPath(
|
|
119
|
-
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
120
|
-
'tooltop',
|
|
121
|
-
"{0} (suggestion)",
|
|
122
|
-
tooltip
|
|
123
|
-
)) : tooltip,
|
|
115
|
+
tooltip: isSuggested ? ( localizeWithPath(_moduleId, 1, "{0} (suggestion)", tooltip)) : tooltip,
|
|
124
116
|
command: SELECT_KERNEL_ID,
|
|
125
117
|
}, SELECT_KERNEL_ID, 1 , 10));
|
|
126
118
|
this._kernelInfoElement.add(kernel.onDidChange(() => this._showKernelStatus(notebook)));
|
|
127
119
|
}
|
|
128
120
|
else {
|
|
129
121
|
this._kernelInfoElement.add(this._statusbarService.addEntry({
|
|
130
|
-
name: ( localizeWithPath(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"Notebook Kernel Selection"
|
|
134
|
-
)),
|
|
135
|
-
text: ( localizeWithPath(
|
|
136
|
-
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
137
|
-
'kernel.select.label',
|
|
138
|
-
"Select Kernel"
|
|
139
|
-
)),
|
|
140
|
-
ariaLabel: ( localizeWithPath(
|
|
141
|
-
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
142
|
-
'kernel.select.label',
|
|
143
|
-
"Select Kernel"
|
|
144
|
-
)),
|
|
122
|
+
name: ( localizeWithPath(_moduleId, 2, "Notebook Kernel Selection")),
|
|
123
|
+
text: ( localizeWithPath(_moduleId, 3, "Select Kernel")),
|
|
124
|
+
ariaLabel: ( localizeWithPath(_moduleId, 3, "Select Kernel")),
|
|
145
125
|
command: SELECT_KERNEL_ID,
|
|
146
126
|
kind: 'prominent'
|
|
147
127
|
}, SELECT_KERNEL_ID, 1 , 10));
|
|
148
128
|
}
|
|
149
129
|
}
|
|
150
130
|
};
|
|
151
|
-
KernelStatus = ( __decorate([
|
|
152
|
-
( __param(0, IEditorService)),
|
|
153
|
-
( __param(1, IStatusbarService)),
|
|
154
|
-
( __param(2, INotebookKernelService)),
|
|
155
|
-
( __param(3, IInstantiationService))
|
|
156
|
-
], KernelStatus));
|
|
157
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(KernelStatus, 3 );
|
|
131
|
+
KernelStatus = ( (__decorate([
|
|
132
|
+
( (__param(0, IEditorService))),
|
|
133
|
+
( (__param(1, IStatusbarService))),
|
|
134
|
+
( (__param(2, INotebookKernelService))),
|
|
135
|
+
( (__param(3, IInstantiationService)))
|
|
136
|
+
], KernelStatus)));
|
|
137
|
+
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(KernelStatus, 3 );
|
|
158
138
|
let ActiveCellStatus = class ActiveCellStatus extends Disposable {
|
|
159
139
|
constructor(_editorService, _statusbarService) {
|
|
160
140
|
super();
|
|
161
141
|
this._editorService = _editorService;
|
|
162
142
|
this._statusbarService = _statusbarService;
|
|
163
|
-
this._itemDisposables = this._register(( new DisposableStore()));
|
|
164
|
-
this._accessor = this._register(( new MutableDisposable()));
|
|
143
|
+
this._itemDisposables = this._register(( (new DisposableStore())));
|
|
144
|
+
this._accessor = this._register(( (new MutableDisposable())));
|
|
165
145
|
this._register(this._editorService.onDidActiveEditorChange(() => this._update()));
|
|
166
146
|
}
|
|
167
147
|
_update() {
|
|
@@ -187,11 +167,7 @@ let ActiveCellStatus = class ActiveCellStatus extends Disposable {
|
|
|
187
167
|
return;
|
|
188
168
|
}
|
|
189
169
|
const entry = {
|
|
190
|
-
name: ( localizeWithPath(
|
|
191
|
-
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
192
|
-
'notebook.activeCellStatusName',
|
|
193
|
-
"Notebook Editor Selections"
|
|
194
|
-
)),
|
|
170
|
+
name: ( localizeWithPath(_moduleId, 4, "Notebook Editor Selections")),
|
|
195
171
|
text: newText,
|
|
196
172
|
ariaLabel: newText,
|
|
197
173
|
command: CENTER_ACTIVE_CELL
|
|
@@ -215,27 +191,15 @@ let ActiveCellStatus = class ActiveCellStatus extends Disposable {
|
|
|
215
191
|
const numSelected = editor.getSelections().reduce((prev, range) => prev + (range.end - range.start), 0);
|
|
216
192
|
const totalCells = editor.getLength();
|
|
217
193
|
return numSelected > 1 ?
|
|
218
|
-
( localizeWithPath(
|
|
219
|
-
|
|
220
|
-
'notebook.multiActiveCellIndicator',
|
|
221
|
-
"Cell {0} ({1} selected)",
|
|
222
|
-
idxFocused,
|
|
223
|
-
numSelected
|
|
224
|
-
)) :
|
|
225
|
-
( localizeWithPath(
|
|
226
|
-
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
227
|
-
'notebook.singleActiveCellIndicator',
|
|
228
|
-
"Cell {0} of {1}",
|
|
229
|
-
idxFocused,
|
|
230
|
-
totalCells
|
|
231
|
-
));
|
|
194
|
+
( localizeWithPath(_moduleId, 5, "Cell {0} ({1} selected)", idxFocused, numSelected)) :
|
|
195
|
+
( localizeWithPath(_moduleId, 6, "Cell {0} of {1}", idxFocused, totalCells));
|
|
232
196
|
}
|
|
233
197
|
};
|
|
234
|
-
ActiveCellStatus = ( __decorate([
|
|
235
|
-
( __param(0, IEditorService)),
|
|
236
|
-
( __param(1, IStatusbarService))
|
|
237
|
-
], ActiveCellStatus));
|
|
238
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ActiveCellStatus, 3 );
|
|
198
|
+
ActiveCellStatus = ( (__decorate([
|
|
199
|
+
( (__param(0, IEditorService))),
|
|
200
|
+
( (__param(1, IStatusbarService)))
|
|
201
|
+
], ActiveCellStatus)));
|
|
202
|
+
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(ActiveCellStatus, 3 );
|
|
239
203
|
let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposable {
|
|
240
204
|
static { this.ID = 'selectNotebookIndentation'; }
|
|
241
205
|
constructor(_editorService, _statusbarService, _configurationService) {
|
|
@@ -243,8 +207,8 @@ let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposab
|
|
|
243
207
|
this._editorService = _editorService;
|
|
244
208
|
this._statusbarService = _statusbarService;
|
|
245
209
|
this._configurationService = _configurationService;
|
|
246
|
-
this._itemDisposables = this._register(( new DisposableStore()));
|
|
247
|
-
this._accessor = this._register(( new MutableDisposable()));
|
|
210
|
+
this._itemDisposables = this._register(( (new DisposableStore())));
|
|
211
|
+
this._accessor = this._register(( (new MutableDisposable())));
|
|
248
212
|
this._register(this._editorService.onDidActiveEditorChange(() => this._update()));
|
|
249
213
|
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
250
214
|
if (e.affectsConfiguration('editor') || e.affectsConfiguration('notebook')) {
|
|
@@ -288,18 +252,10 @@ let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposab
|
|
|
288
252
|
return;
|
|
289
253
|
}
|
|
290
254
|
const entry = {
|
|
291
|
-
name: ( localizeWithPath(
|
|
292
|
-
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
293
|
-
'notebook.indentation',
|
|
294
|
-
"Notebook Indentation"
|
|
295
|
-
)),
|
|
255
|
+
name: ( localizeWithPath(_moduleId, 7, "Notebook Indentation")),
|
|
296
256
|
text: newText,
|
|
297
257
|
ariaLabel: newText,
|
|
298
|
-
tooltip: ( localizeWithPath(
|
|
299
|
-
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
300
|
-
'selectNotebookIndentation',
|
|
301
|
-
"Select Indentation"
|
|
302
|
-
)),
|
|
258
|
+
tooltip: ( localizeWithPath(_moduleId, 8, "Select Indentation")),
|
|
303
259
|
command: SELECT_NOTEBOOK_INDENTATION_ID
|
|
304
260
|
};
|
|
305
261
|
if (!this._accessor.value) {
|
|
@@ -310,11 +266,11 @@ let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposab
|
|
|
310
266
|
}
|
|
311
267
|
}
|
|
312
268
|
};
|
|
313
|
-
NotebookIndentationStatus = ( __decorate([
|
|
314
|
-
( __param(0, IEditorService)),
|
|
315
|
-
( __param(1, IStatusbarService)),
|
|
316
|
-
( __param(2, IConfigurationService))
|
|
317
|
-
], NotebookIndentationStatus));
|
|
269
|
+
NotebookIndentationStatus = ( (__decorate([
|
|
270
|
+
( (__param(0, IEditorService))),
|
|
271
|
+
( (__param(1, IStatusbarService))),
|
|
272
|
+
( (__param(2, IConfigurationService)))
|
|
273
|
+
], NotebookIndentationStatus)));
|
|
318
274
|
registerWorkbenchContribution2(NotebookIndentationStatus.ID, NotebookIndentationStatus, 3 );
|
|
319
275
|
|
|
320
276
|
export { ActiveCellStatus, KernelStatus, NotebookIndentationStatus };
|
|
@@ -14,18 +14,15 @@ import { CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/note
|
|
|
14
14
|
import { NOTEBOOK_EDITOR_FOCUSED, KEYBINDING_CONTEXT_NOTEBOOK_FIND_WIDGET_FOCUSED, NOTEBOOK_IS_ACTIVE_EDITOR, INTERACTIVE_WINDOW_IS_ACTIVE_EDITOR } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
15
15
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
16
16
|
|
|
17
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/find/notebookFind";
|
|
17
18
|
registerNotebookContribution(NotebookFindContrib.id, NotebookFindContrib);
|
|
18
19
|
registerAction2(class extends Action2 {
|
|
19
20
|
constructor() {
|
|
20
21
|
super({
|
|
21
22
|
id: 'notebook.hideFind',
|
|
22
|
-
title: ( localize2WithPath(
|
|
23
|
-
'vs/workbench/contrib/notebook/browser/contrib/find/notebookFind',
|
|
24
|
-
'notebookActions.hideFind',
|
|
25
|
-
'Hide Find in Notebook'
|
|
26
|
-
)),
|
|
23
|
+
title: ( localize2WithPath(_moduleId, 0, 'Hide Find in Notebook')),
|
|
27
24
|
keybinding: {
|
|
28
|
-
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, KEYBINDING_CONTEXT_NOTEBOOK_FIND_WIDGET_FOCUSED)),
|
|
25
|
+
when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, KEYBINDING_CONTEXT_NOTEBOOK_FIND_WIDGET_FOCUSED))),
|
|
29
26
|
primary: 9 ,
|
|
30
27
|
weight: 200
|
|
31
28
|
}
|
|
@@ -46,13 +43,13 @@ registerAction2(class extends Action2 {
|
|
|
46
43
|
constructor() {
|
|
47
44
|
super({
|
|
48
45
|
id: 'notebook.find',
|
|
49
|
-
title: ( localize2WithPath(
|
|
50
|
-
'vs/workbench/contrib/notebook/browser/contrib/find/notebookFind',
|
|
51
|
-
'notebookActions.findInNotebook',
|
|
52
|
-
'Find in Notebook'
|
|
53
|
-
)),
|
|
46
|
+
title: ( localize2WithPath(_moduleId, 1, 'Find in Notebook')),
|
|
54
47
|
keybinding: {
|
|
55
|
-
when: ( ContextKeyExpr.and(
|
|
48
|
+
when: ( (ContextKeyExpr.and(
|
|
49
|
+
NOTEBOOK_EDITOR_FOCUSED,
|
|
50
|
+
(ContextKeyExpr.or(NOTEBOOK_IS_ACTIVE_EDITOR, INTERACTIVE_WINDOW_IS_ACTIVE_EDITOR)),
|
|
51
|
+
(EditorContextKeys.focus.toNegated())
|
|
52
|
+
))),
|
|
56
53
|
primary: 36 | 2048 ,
|
|
57
54
|
weight: 200
|
|
58
55
|
}
|
|
@@ -24,19 +24,16 @@ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
|
24
24
|
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
25
25
|
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
26
26
|
|
|
27
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/format/formatting";
|
|
27
28
|
registerAction2(class extends Action2 {
|
|
28
29
|
constructor() {
|
|
29
30
|
super({
|
|
30
31
|
id: 'notebook.format',
|
|
31
|
-
title: ( localize2WithPath(
|
|
32
|
-
'vs/workbench/contrib/notebook/browser/contrib/format/formatting',
|
|
33
|
-
'format.title',
|
|
34
|
-
'Format Notebook'
|
|
35
|
-
)),
|
|
32
|
+
title: ( localize2WithPath(_moduleId, 0, 'Format Notebook')),
|
|
36
33
|
category: NOTEBOOK_ACTIONS_CATEGORY,
|
|
37
|
-
precondition: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_EDITOR_EDITABLE)),
|
|
34
|
+
precondition: ( (ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_EDITOR_EDITABLE))),
|
|
38
35
|
keybinding: {
|
|
39
|
-
when: ( EditorContextKeys.editorTextFocus.toNegated()),
|
|
36
|
+
when: ( (EditorContextKeys.editorTextFocus.toNegated())),
|
|
40
37
|
primary: 1024 | 512 | 36 ,
|
|
41
38
|
linux: { primary: 2048 | 1024 | 39 },
|
|
42
39
|
weight: 200
|
|
@@ -44,10 +41,10 @@ registerAction2(class extends Action2 {
|
|
|
44
41
|
f1: true,
|
|
45
42
|
menu: {
|
|
46
43
|
id: MenuId.EditorContext,
|
|
47
|
-
when: ( ContextKeyExpr.and(
|
|
44
|
+
when: ( (ContextKeyExpr.and(
|
|
48
45
|
EditorContextKeys.inCompositeEditor,
|
|
49
46
|
EditorContextKeys.hasDocumentFormattingProvider
|
|
50
|
-
)),
|
|
47
|
+
))),
|
|
51
48
|
group: '1_modification',
|
|
52
49
|
order: 1.3
|
|
53
50
|
}
|
|
@@ -64,9 +61,9 @@ registerAction2(class extends Action2 {
|
|
|
64
61
|
return;
|
|
65
62
|
}
|
|
66
63
|
const notebook = editor.textModel;
|
|
67
|
-
const disposable = ( new DisposableStore());
|
|
64
|
+
const disposable = ( (new DisposableStore()));
|
|
68
65
|
try {
|
|
69
|
-
const allCellEdits = await Promise.all(( notebook.cells.map(async (cell) => {
|
|
66
|
+
const allCellEdits = await Promise.all(( (notebook.cells.map(async (cell) => {
|
|
70
67
|
const ref = await textModelService.createModelReference(cell.uri);
|
|
71
68
|
disposable.add(ref);
|
|
72
69
|
const model = ref.object.textEditorModel;
|
|
@@ -74,17 +71,13 @@ registerAction2(class extends Action2 {
|
|
|
74
71
|
const edits = [];
|
|
75
72
|
if (formatEdits) {
|
|
76
73
|
for (const edit of formatEdits) {
|
|
77
|
-
edits.push(( new ResourceTextEdit(model.uri, edit, model.getVersionId())));
|
|
74
|
+
edits.push(( (new ResourceTextEdit(model.uri, edit, model.getVersionId()))));
|
|
78
75
|
}
|
|
79
76
|
return edits;
|
|
80
77
|
}
|
|
81
78
|
return [];
|
|
82
|
-
})));
|
|
83
|
-
await bulkEditService.apply( allCellEdits.flat(), { label: ( localizeWithPath(
|
|
84
|
-
'vs/workbench/contrib/notebook/browser/contrib/format/formatting',
|
|
85
|
-
'label',
|
|
86
|
-
"Format Notebook"
|
|
87
|
-
)), code: 'undoredo.formatNotebook', });
|
|
79
|
+
}))));
|
|
80
|
+
await bulkEditService.apply( allCellEdits.flat(), { label: ( localizeWithPath(_moduleId, 1, "Format Notebook")), code: 'undoredo.formatNotebook', });
|
|
88
81
|
}
|
|
89
82
|
finally {
|
|
90
83
|
disposable.dispose();
|
|
@@ -95,21 +88,17 @@ registerEditorAction(class FormatCellAction extends EditorAction {
|
|
|
95
88
|
constructor() {
|
|
96
89
|
super({
|
|
97
90
|
id: 'notebook.formatCell',
|
|
98
|
-
label: ( localizeWithPath(
|
|
99
|
-
'vs/workbench/contrib/notebook/browser/contrib/format/formatting',
|
|
100
|
-
'formatCell.label',
|
|
101
|
-
"Format Cell"
|
|
102
|
-
)),
|
|
91
|
+
label: ( localizeWithPath(_moduleId, 2, "Format Cell")),
|
|
103
92
|
alias: 'Format Cell',
|
|
104
|
-
precondition: ( ContextKeyExpr.and(
|
|
93
|
+
precondition: ( (ContextKeyExpr.and(
|
|
105
94
|
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
106
95
|
NOTEBOOK_EDITOR_EDITABLE,
|
|
107
96
|
EditorContextKeys.inCompositeEditor,
|
|
108
97
|
EditorContextKeys.writable,
|
|
109
98
|
EditorContextKeys.hasDocumentFormattingProvider
|
|
110
|
-
)),
|
|
99
|
+
))),
|
|
111
100
|
kbOpts: {
|
|
112
|
-
kbExpr: ( ContextKeyExpr.and(EditorContextKeys.editorTextFocus)),
|
|
101
|
+
kbExpr: ( (ContextKeyExpr.and(EditorContextKeys.editorTextFocus))),
|
|
113
102
|
primary: 1024 | 512 | 36 ,
|
|
114
103
|
linux: { primary: 2048 | 1024 | 39 },
|
|
115
104
|
weight: 100
|
|
@@ -141,9 +130,9 @@ let FormatOnCellExecutionParticipant = class FormatOnCellExecutionParticipant {
|
|
|
141
130
|
if (!enabled) {
|
|
142
131
|
return;
|
|
143
132
|
}
|
|
144
|
-
const disposable = ( new DisposableStore());
|
|
133
|
+
const disposable = ( (new DisposableStore()));
|
|
145
134
|
try {
|
|
146
|
-
const allCellEdits = await Promise.all(( executions.map(async (cellExecution) => {
|
|
135
|
+
const allCellEdits = await Promise.all(( (executions.map(async (cellExecution) => {
|
|
147
136
|
const nbModel = this._notebookService.getNotebookTextModel(cellExecution.notebook);
|
|
148
137
|
if (!nbModel) {
|
|
149
138
|
return [];
|
|
@@ -164,30 +153,28 @@ let FormatOnCellExecutionParticipant = class FormatOnCellExecutionParticipant {
|
|
|
164
153
|
const formatEdits = await getDocumentFormattingEditsUntilResult(this.editorWorkerService, this.languageFeaturesService, model, model.getOptions(), CancellationToken.None);
|
|
165
154
|
const edits = [];
|
|
166
155
|
if (formatEdits) {
|
|
167
|
-
edits.push(...( formatEdits.map(
|
|
156
|
+
edits.push(...( (formatEdits.map(
|
|
157
|
+
edit => ( (new ResourceTextEdit(model.uri, edit, model.getVersionId())))
|
|
158
|
+
))));
|
|
168
159
|
return edits;
|
|
169
160
|
}
|
|
170
161
|
return [];
|
|
171
|
-
})));
|
|
172
|
-
await this.bulkEditService.apply( allCellEdits.flat(), { label: ( localizeWithPath(
|
|
173
|
-
'vs/workbench/contrib/notebook/browser/contrib/format/formatting',
|
|
174
|
-
'formatCells.label',
|
|
175
|
-
"Format Cells"
|
|
176
|
-
)), code: 'undoredo.notebooks.onWillExecuteFormat', });
|
|
162
|
+
}))));
|
|
163
|
+
await this.bulkEditService.apply( allCellEdits.flat(), { label: ( localizeWithPath(_moduleId, 3, "Format Cells")), code: 'undoredo.notebooks.onWillExecuteFormat', });
|
|
177
164
|
}
|
|
178
165
|
finally {
|
|
179
166
|
disposable.dispose();
|
|
180
167
|
}
|
|
181
168
|
}
|
|
182
169
|
};
|
|
183
|
-
FormatOnCellExecutionParticipant = ( __decorate([
|
|
184
|
-
( __param(0, IBulkEditService)),
|
|
185
|
-
( __param(1, ILanguageFeaturesService)),
|
|
186
|
-
( __param(2, ITextModelService)),
|
|
187
|
-
( __param(3, IEditorWorkerService)),
|
|
188
|
-
( __param(4, IConfigurationService)),
|
|
189
|
-
( __param(5, INotebookService))
|
|
190
|
-
], FormatOnCellExecutionParticipant));
|
|
170
|
+
FormatOnCellExecutionParticipant = ( (__decorate([
|
|
171
|
+
( (__param(0, IBulkEditService))),
|
|
172
|
+
( (__param(1, ILanguageFeaturesService))),
|
|
173
|
+
( (__param(2, ITextModelService))),
|
|
174
|
+
( (__param(3, IEditorWorkerService))),
|
|
175
|
+
( (__param(4, IConfigurationService))),
|
|
176
|
+
( (__param(5, INotebookService)))
|
|
177
|
+
], FormatOnCellExecutionParticipant)));
|
|
191
178
|
let CellExecutionParticipantsContribution = class CellExecutionParticipantsContribution extends Disposable {
|
|
192
179
|
constructor(instantiationService, notebookExecutionService) {
|
|
193
180
|
super();
|
|
@@ -199,11 +186,11 @@ let CellExecutionParticipantsContribution = class CellExecutionParticipantsContr
|
|
|
199
186
|
this._register(this.notebookExecutionService.registerExecutionParticipant(this.instantiationService.createInstance(FormatOnCellExecutionParticipant)));
|
|
200
187
|
}
|
|
201
188
|
};
|
|
202
|
-
CellExecutionParticipantsContribution = ( __decorate([
|
|
203
|
-
( __param(0, IInstantiationService)),
|
|
204
|
-
( __param(1, INotebookExecutionService))
|
|
205
|
-
], CellExecutionParticipantsContribution));
|
|
206
|
-
const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
|
|
189
|
+
CellExecutionParticipantsContribution = ( (__decorate([
|
|
190
|
+
( (__param(0, IInstantiationService))),
|
|
191
|
+
( (__param(1, INotebookExecutionService)))
|
|
192
|
+
], CellExecutionParticipantsContribution)));
|
|
193
|
+
const workbenchContributionsRegistry = ( (Registry.as(Extensions.Workbench)));
|
|
207
194
|
workbenchContributionsRegistry.registerWorkbenchContribution(CellExecutionParticipantsContribution, 3 );
|
|
208
195
|
|
|
209
196
|
export { CellExecutionParticipantsContribution };
|
|
@@ -16,13 +16,14 @@ import { HAS_OPENED_NOTEBOOK } from 'vscode/vscode/vs/workbench/contrib/notebook
|
|
|
16
16
|
import { NotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
17
17
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
18
18
|
|
|
19
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted";
|
|
19
20
|
const hasOpenedNotebookKey = 'hasOpenedNotebook';
|
|
20
21
|
const hasShownGettingStartedKey = 'hasShownNotebookGettingStarted';
|
|
21
22
|
let NotebookGettingStarted = class NotebookGettingStarted extends Disposable {
|
|
22
23
|
constructor(_editorService, _storageService, _contextKeyService, _commandService, _configurationService) {
|
|
23
24
|
super();
|
|
24
25
|
const hasOpenedNotebook = HAS_OPENED_NOTEBOOK.bindTo(_contextKeyService);
|
|
25
|
-
const memento = ( new Memento('notebookGettingStarted2', _storageService));
|
|
26
|
+
const memento = ( (new Memento('notebookGettingStarted2', _storageService)));
|
|
26
27
|
const storedValue = memento.getMemento(0 , 0 );
|
|
27
28
|
if (storedValue[hasOpenedNotebookKey]) {
|
|
28
29
|
hasOpenedNotebook.set(true);
|
|
@@ -51,31 +52,27 @@ let NotebookGettingStarted = class NotebookGettingStarted extends Disposable {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
|
-
NotebookGettingStarted = ( __decorate([
|
|
55
|
-
( __param(0, IEditorService)),
|
|
56
|
-
( __param(1, IStorageService)),
|
|
57
|
-
( __param(2, IContextKeyService)),
|
|
58
|
-
( __param(3, ICommandService)),
|
|
59
|
-
( __param(4, IConfigurationService))
|
|
60
|
-
], NotebookGettingStarted));
|
|
61
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(NotebookGettingStarted, 3 );
|
|
55
|
+
NotebookGettingStarted = ( (__decorate([
|
|
56
|
+
( (__param(0, IEditorService))),
|
|
57
|
+
( (__param(1, IStorageService))),
|
|
58
|
+
( (__param(2, IContextKeyService))),
|
|
59
|
+
( (__param(3, ICommandService))),
|
|
60
|
+
( (__param(4, IConfigurationService)))
|
|
61
|
+
], NotebookGettingStarted)));
|
|
62
|
+
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(NotebookGettingStarted, 3 );
|
|
62
63
|
registerAction2(class NotebookClearNotebookLayoutAction extends Action2 {
|
|
63
64
|
constructor() {
|
|
64
65
|
super({
|
|
65
66
|
id: 'workbench.notebook.layout.gettingStarted',
|
|
66
|
-
title: ( localize2WithPath(
|
|
67
|
-
'vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted',
|
|
68
|
-
'workbench.notebook.layout.gettingStarted.label',
|
|
69
|
-
"Reset notebook getting started"
|
|
70
|
-
)),
|
|
67
|
+
title: ( localize2WithPath(_moduleId, 0, "Reset notebook getting started")),
|
|
71
68
|
f1: true,
|
|
72
|
-
precondition: ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)),
|
|
69
|
+
precondition: ( (ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true))),
|
|
73
70
|
category: Categories.Developer,
|
|
74
71
|
});
|
|
75
72
|
}
|
|
76
73
|
run(accessor) {
|
|
77
74
|
const storageService = accessor.get(IStorageService);
|
|
78
|
-
const memento = ( new Memento('notebookGettingStarted', storageService));
|
|
75
|
+
const memento = ( (new Memento('notebookGettingStarted', storageService)));
|
|
79
76
|
const storedValue = memento.getMemento(0 , 0 );
|
|
80
77
|
storedValue[hasOpenedNotebookKey] = undefined;
|
|
81
78
|
memento.saveMemento();
|
|
@@ -4,16 +4,13 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
|
|
|
4
4
|
import { NOTEBOOK_ACTIONS_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
5
5
|
import { NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
6
6
|
|
|
7
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions";
|
|
7
8
|
const TOGGLE_CELL_TOOLBAR_POSITION = 'notebook.toggleCellToolbarPosition';
|
|
8
9
|
class ToggleCellToolbarPositionAction extends Action2 {
|
|
9
10
|
constructor() {
|
|
10
11
|
super({
|
|
11
12
|
id: TOGGLE_CELL_TOOLBAR_POSITION,
|
|
12
|
-
title: ( localize2WithPath(
|
|
13
|
-
'vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions',
|
|
14
|
-
'notebook.toggleCellToolbarPosition',
|
|
15
|
-
'Toggle Cell Toolbar Position'
|
|
16
|
-
)),
|
|
13
|
+
title: ( localize2WithPath(_moduleId, 0, 'Toggle Cell Toolbar Position')),
|
|
17
14
|
menu: [{
|
|
18
15
|
id: MenuId.NotebookCellTitle,
|
|
19
16
|
group: 'View',
|