@codingame/monaco-vscode-notebook-service-override 2.2.2 → 3.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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +6 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +101 -161
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +4 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +85 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +8 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +3 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +34 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +5 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +55 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +39 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +17 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +3 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +565 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +31 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +744 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +28 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +351 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +41 -42
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +31 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +25 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +118 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +6 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +2 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +3 -39
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +43 -11
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-notebook-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@3.0.0",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
@@ -61,6 +61,11 @@ let EmptyTextEditorHintContribution = class EmptyTextEditorHintContribution {
|
|
|
61
61
|
this.toDispose.push(this.editor.onDidChangeModelContent(() => this.update()));
|
|
62
62
|
this.toDispose.push(this.inlineChatService.onDidChangeProviders(() => this.update()));
|
|
63
63
|
this.toDispose.push(this.editor.onDidChangeModelDecorations(() => this.update()));
|
|
64
|
+
this.toDispose.push(this.editor.onDidChangeConfiguration((e) => {
|
|
65
|
+
if (e.hasChanged(91 )) {
|
|
66
|
+
this.update();
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
64
69
|
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
|
|
65
70
|
if (e.affectsConfiguration(emptyTextEditorHintSetting)) {
|
|
66
71
|
this.update();
|
|
@@ -85,7 +90,7 @@ let EmptyTextEditorHintContribution = class EmptyTextEditorHintContribution {
|
|
|
85
90
|
if (configValue === 'hidden') {
|
|
86
91
|
return false;
|
|
87
92
|
}
|
|
88
|
-
if (this.editor.getOption(
|
|
93
|
+
if (this.editor.getOption(91 )) {
|
|
89
94
|
return false;
|
|
90
95
|
}
|
|
91
96
|
const model = this.editor.getModel();
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
2
2
|
import { Mimes } from 'vscode/vscode/vs/base/common/mime';
|
|
3
3
|
import { IBulkEditService, ResourceTextEdit } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
|
|
4
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
+
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
5
5
|
import { registerAction2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
6
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
7
7
|
import { InputFocusedContext, InputFocusedContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
@@ -24,14 +24,11 @@ registerAction2(class extends NotebookCellAction {
|
|
|
24
24
|
constructor() {
|
|
25
25
|
super({
|
|
26
26
|
id: MOVE_CELL_UP_COMMAND_ID,
|
|
27
|
-
title:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)),
|
|
33
|
-
original: 'Move Cell Up'
|
|
34
|
-
},
|
|
27
|
+
title: ( localize2WithPath(
|
|
28
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
29
|
+
'notebookActions.moveCellUp',
|
|
30
|
+
"Move Cell Up"
|
|
31
|
+
)),
|
|
35
32
|
icon: moveUpIcon,
|
|
36
33
|
keybinding: {
|
|
37
34
|
primary: 512 | 16 ,
|
|
@@ -54,14 +51,11 @@ registerAction2(class extends NotebookCellAction {
|
|
|
54
51
|
constructor() {
|
|
55
52
|
super({
|
|
56
53
|
id: MOVE_CELL_DOWN_COMMAND_ID,
|
|
57
|
-
title:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
)),
|
|
63
|
-
original: 'Move Cell Down'
|
|
64
|
-
},
|
|
54
|
+
title: ( localize2WithPath(
|
|
55
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
56
|
+
'notebookActions.moveCellDown',
|
|
57
|
+
"Move Cell Down"
|
|
58
|
+
)),
|
|
65
59
|
icon: moveDownIcon,
|
|
66
60
|
keybinding: {
|
|
67
61
|
primary: 512 | 18 ,
|
|
@@ -84,14 +78,11 @@ registerAction2(class extends NotebookCellAction {
|
|
|
84
78
|
constructor() {
|
|
85
79
|
super({
|
|
86
80
|
id: COPY_CELL_UP_COMMAND_ID,
|
|
87
|
-
title:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
)),
|
|
93
|
-
original: 'Copy Cell Up'
|
|
94
|
-
},
|
|
81
|
+
title: ( localize2WithPath(
|
|
82
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
83
|
+
'notebookActions.copyCellUp',
|
|
84
|
+
"Copy Cell Up"
|
|
85
|
+
)),
|
|
95
86
|
keybinding: {
|
|
96
87
|
primary: 512 | 1024 | 16 ,
|
|
97
88
|
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( InputFocusedContext.toNegated()))),
|
|
@@ -107,14 +98,11 @@ registerAction2(class extends NotebookCellAction {
|
|
|
107
98
|
constructor() {
|
|
108
99
|
super({
|
|
109
100
|
id: COPY_CELL_DOWN_COMMAND_ID,
|
|
110
|
-
title:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
)),
|
|
116
|
-
original: 'Copy Cell Down'
|
|
117
|
-
},
|
|
101
|
+
title: ( localize2WithPath(
|
|
102
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
103
|
+
'notebookActions.copyCellDown',
|
|
104
|
+
"Copy Cell Down"
|
|
105
|
+
)),
|
|
118
106
|
keybinding: {
|
|
119
107
|
primary: 512 | 1024 | 18 ,
|
|
120
108
|
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( InputFocusedContext.toNegated()))),
|
|
@@ -140,14 +128,11 @@ registerAction2(class extends NotebookCellAction {
|
|
|
140
128
|
constructor() {
|
|
141
129
|
super({
|
|
142
130
|
id: SPLIT_CELL_COMMAND_ID,
|
|
143
|
-
title:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
)),
|
|
149
|
-
original: 'Split Cell'
|
|
150
|
-
},
|
|
131
|
+
title: ( localize2WithPath(
|
|
132
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
133
|
+
'notebookActions.splitCell',
|
|
134
|
+
"Split Cell"
|
|
135
|
+
)),
|
|
151
136
|
menu: {
|
|
152
137
|
id: MenuId.NotebookCellTitle,
|
|
153
138
|
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE, ( NOTEBOOK_CELL_INPUT_COLLAPSED.toNegated()))),
|
|
@@ -213,14 +198,11 @@ registerAction2(class extends NotebookCellAction {
|
|
|
213
198
|
constructor() {
|
|
214
199
|
super({
|
|
215
200
|
id: JOIN_CELL_ABOVE_COMMAND_ID,
|
|
216
|
-
title:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
)),
|
|
222
|
-
original: 'Join With Previous Cell'
|
|
223
|
-
},
|
|
201
|
+
title: ( localize2WithPath(
|
|
202
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
203
|
+
'notebookActions.joinCellAbove',
|
|
204
|
+
"Join With Previous Cell"
|
|
205
|
+
)),
|
|
224
206
|
keybinding: {
|
|
225
207
|
when: NOTEBOOK_EDITOR_FOCUSED,
|
|
226
208
|
primary: 256 | 512 | 1024 | 40 ,
|
|
@@ -243,14 +225,11 @@ registerAction2(class extends NotebookCellAction {
|
|
|
243
225
|
constructor() {
|
|
244
226
|
super({
|
|
245
227
|
id: JOIN_CELL_BELOW_COMMAND_ID,
|
|
246
|
-
title:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)),
|
|
252
|
-
original: 'Join With Next Cell'
|
|
253
|
-
},
|
|
228
|
+
title: ( localize2WithPath(
|
|
229
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
230
|
+
'notebookActions.joinCellBelow',
|
|
231
|
+
"Join With Next Cell"
|
|
232
|
+
)),
|
|
254
233
|
keybinding: {
|
|
255
234
|
when: NOTEBOOK_EDITOR_FOCUSED,
|
|
256
235
|
primary: 256 | 512 | 40 ,
|
|
@@ -273,14 +252,11 @@ registerAction2(class extends NotebookCellAction {
|
|
|
273
252
|
constructor() {
|
|
274
253
|
super({
|
|
275
254
|
id: JOIN_SELECTED_CELLS_COMMAND_ID,
|
|
276
|
-
title:
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
)),
|
|
282
|
-
original: 'Join Selected Cells'
|
|
283
|
-
},
|
|
255
|
+
title: ( localize2WithPath(
|
|
256
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
257
|
+
'notebookActions.joinSelectedCells',
|
|
258
|
+
"Join Selected Cells"
|
|
259
|
+
)),
|
|
284
260
|
menu: {
|
|
285
261
|
id: MenuId.NotebookCellTitle,
|
|
286
262
|
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE)),
|
|
@@ -301,14 +277,11 @@ registerAction2(class ChangeCellToCodeAction extends NotebookMultiCellAction {
|
|
|
301
277
|
constructor() {
|
|
302
278
|
super({
|
|
303
279
|
id: CHANGE_CELL_TO_CODE_COMMAND_ID,
|
|
304
|
-
title:
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
)),
|
|
310
|
-
original: 'Change Cell to Code'
|
|
311
|
-
},
|
|
280
|
+
title: ( localize2WithPath(
|
|
281
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
282
|
+
'notebookActions.changeCellToCode',
|
|
283
|
+
"Change Cell to Code"
|
|
284
|
+
)),
|
|
312
285
|
keybinding: {
|
|
313
286
|
when: ( ContextKeyExpr.and(
|
|
314
287
|
NOTEBOOK_EDITOR_FOCUSED,
|
|
@@ -339,14 +312,11 @@ registerAction2(class ChangeCellToMarkdownAction extends NotebookMultiCellAction
|
|
|
339
312
|
constructor() {
|
|
340
313
|
super({
|
|
341
314
|
id: CHANGE_CELL_TO_MARKDOWN_COMMAND_ID,
|
|
342
|
-
title:
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
)),
|
|
348
|
-
original: 'Change Cell to Markdown'
|
|
349
|
-
},
|
|
315
|
+
title: ( localize2WithPath(
|
|
316
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
317
|
+
'notebookActions.changeCellToMarkdown',
|
|
318
|
+
"Change Cell to Markdown"
|
|
319
|
+
)),
|
|
350
320
|
keybinding: {
|
|
351
321
|
when: ( ContextKeyExpr.and(
|
|
352
322
|
NOTEBOOK_EDITOR_FOCUSED,
|
|
@@ -385,14 +355,11 @@ registerAction2(class CollapseCellInputAction extends NotebookMultiCellAction {
|
|
|
385
355
|
constructor() {
|
|
386
356
|
super({
|
|
387
357
|
id: COLLAPSE_CELL_INPUT_COMMAND_ID,
|
|
388
|
-
title:
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
)),
|
|
394
|
-
original: 'Collapse Cell Input'
|
|
395
|
-
},
|
|
358
|
+
title: ( localize2WithPath(
|
|
359
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
360
|
+
'notebookActions.collapseCellInput',
|
|
361
|
+
"Collapse Cell Input"
|
|
362
|
+
)),
|
|
396
363
|
keybinding: {
|
|
397
364
|
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, ( NOTEBOOK_CELL_INPUT_COLLAPSED.toNegated()), ( InputFocusedContext.toNegated()))),
|
|
398
365
|
primary: KeyChord(2048 | 41 , 2048 | 33 ),
|
|
@@ -416,14 +383,11 @@ registerAction2(class ExpandCellInputAction extends NotebookMultiCellAction {
|
|
|
416
383
|
constructor() {
|
|
417
384
|
super({
|
|
418
385
|
id: EXPAND_CELL_INPUT_COMMAND_ID,
|
|
419
|
-
title:
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
)),
|
|
425
|
-
original: 'Expand Cell Input'
|
|
426
|
-
},
|
|
386
|
+
title: ( localize2WithPath(
|
|
387
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
388
|
+
'notebookActions.expandCellInput',
|
|
389
|
+
"Expand Cell Input"
|
|
390
|
+
)),
|
|
427
391
|
keybinding: {
|
|
428
392
|
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_CELL_INPUT_COLLAPSED)),
|
|
429
393
|
primary: KeyChord(2048 | 41 , 2048 | 33 ),
|
|
@@ -447,14 +411,11 @@ registerAction2(class CollapseCellOutputAction extends NotebookMultiCellAction {
|
|
|
447
411
|
constructor() {
|
|
448
412
|
super({
|
|
449
413
|
id: COLLAPSE_CELL_OUTPUT_COMMAND_ID,
|
|
450
|
-
title:
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
)),
|
|
456
|
-
original: 'Collapse Cell Output'
|
|
457
|
-
},
|
|
414
|
+
title: ( localize2WithPath(
|
|
415
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
416
|
+
'notebookActions.collapseCellOutput',
|
|
417
|
+
"Collapse Cell Output"
|
|
418
|
+
)),
|
|
458
419
|
keybinding: {
|
|
459
420
|
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, ( NOTEBOOK_CELL_OUTPUT_COLLAPSED.toNegated()), ( InputFocusedContext.toNegated()), NOTEBOOK_CELL_HAS_OUTPUTS)),
|
|
460
421
|
primary: KeyChord(2048 | 41 , 50 ),
|
|
@@ -475,14 +436,11 @@ registerAction2(class ExpandCellOuputAction extends NotebookMultiCellAction {
|
|
|
475
436
|
constructor() {
|
|
476
437
|
super({
|
|
477
438
|
id: EXPAND_CELL_OUTPUT_COMMAND_ID,
|
|
478
|
-
title:
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
)),
|
|
484
|
-
original: 'Expand Cell Output'
|
|
485
|
-
},
|
|
439
|
+
title: ( localize2WithPath(
|
|
440
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
441
|
+
'notebookActions.expandCellOutput',
|
|
442
|
+
"Expand Cell Output"
|
|
443
|
+
)),
|
|
486
444
|
keybinding: {
|
|
487
445
|
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_CELL_OUTPUT_COLLAPSED)),
|
|
488
446
|
primary: KeyChord(2048 | 41 , 50 ),
|
|
@@ -504,14 +462,11 @@ registerAction2(class extends NotebookMultiCellAction {
|
|
|
504
462
|
super({
|
|
505
463
|
id: TOGGLE_CELL_OUTPUTS_COMMAND_ID,
|
|
506
464
|
precondition: NOTEBOOK_CELL_LIST_FOCUSED,
|
|
507
|
-
title:
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
)),
|
|
513
|
-
original: 'Toggle Outputs'
|
|
514
|
-
},
|
|
465
|
+
title: ( localize2WithPath(
|
|
466
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
467
|
+
'notebookActions.toggleOutputs',
|
|
468
|
+
"Toggle Outputs"
|
|
469
|
+
)),
|
|
515
470
|
metadata: {
|
|
516
471
|
description: ( localizeWithPath(
|
|
517
472
|
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
@@ -542,14 +497,11 @@ registerAction2(class CollapseAllCellInputsAction extends NotebookMultiCellActio
|
|
|
542
497
|
constructor() {
|
|
543
498
|
super({
|
|
544
499
|
id: COLLAPSE_ALL_CELL_INPUTS_COMMAND_ID,
|
|
545
|
-
title:
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
)),
|
|
551
|
-
original: 'Collapse All Cell Inputs'
|
|
552
|
-
},
|
|
500
|
+
title: ( localize2WithPath(
|
|
501
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
502
|
+
'notebookActions.collapseAllCellInput',
|
|
503
|
+
"Collapse All Cell Inputs"
|
|
504
|
+
)),
|
|
553
505
|
f1: true,
|
|
554
506
|
});
|
|
555
507
|
}
|
|
@@ -561,14 +513,11 @@ registerAction2(class ExpandAllCellInputsAction extends NotebookMultiCellAction
|
|
|
561
513
|
constructor() {
|
|
562
514
|
super({
|
|
563
515
|
id: EXPAND_ALL_CELL_INPUTS_COMMAND_ID,
|
|
564
|
-
title:
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
)),
|
|
570
|
-
original: 'Expand All Cell Inputs'
|
|
571
|
-
},
|
|
516
|
+
title: ( localize2WithPath(
|
|
517
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
518
|
+
'notebookActions.expandAllCellInput',
|
|
519
|
+
"Expand All Cell Inputs"
|
|
520
|
+
)),
|
|
572
521
|
f1: true
|
|
573
522
|
});
|
|
574
523
|
}
|
|
@@ -580,14 +529,11 @@ registerAction2(class CollapseAllCellOutputsAction extends NotebookMultiCellActi
|
|
|
580
529
|
constructor() {
|
|
581
530
|
super({
|
|
582
531
|
id: COLLAPSE_ALL_CELL_OUTPUTS_COMMAND_ID,
|
|
583
|
-
title:
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
)),
|
|
589
|
-
original: 'Collapse All Cell Outputs'
|
|
590
|
-
},
|
|
532
|
+
title: ( localize2WithPath(
|
|
533
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
534
|
+
'notebookActions.collapseAllCellOutput',
|
|
535
|
+
"Collapse All Cell Outputs"
|
|
536
|
+
)),
|
|
591
537
|
f1: true,
|
|
592
538
|
});
|
|
593
539
|
}
|
|
@@ -599,14 +545,11 @@ registerAction2(class ExpandAllCellOutputsAction extends NotebookMultiCellAction
|
|
|
599
545
|
constructor() {
|
|
600
546
|
super({
|
|
601
547
|
id: EXPAND_ALL_CELL_OUTPUTS_COMMAND_ID,
|
|
602
|
-
title:
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
)),
|
|
608
|
-
original: 'Expand All Cell Outputs'
|
|
609
|
-
},
|
|
548
|
+
title: ( localize2WithPath(
|
|
549
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
550
|
+
'notebookActions.expandAllCellOutput',
|
|
551
|
+
"Expand All Cell Outputs"
|
|
552
|
+
)),
|
|
610
553
|
f1: true
|
|
611
554
|
});
|
|
612
555
|
}
|
|
@@ -618,14 +561,11 @@ registerAction2(class ToggleCellOutputScrolling extends NotebookMultiCellAction
|
|
|
618
561
|
constructor() {
|
|
619
562
|
super({
|
|
620
563
|
id: TOGGLE_CELL_OUTPUT_SCROLLING,
|
|
621
|
-
title:
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
)),
|
|
627
|
-
original: 'Toggle Scroll Cell Output'
|
|
628
|
-
},
|
|
564
|
+
title: ( localize2WithPath(
|
|
565
|
+
'vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands',
|
|
566
|
+
'notebookActions.toggleScrolling',
|
|
567
|
+
"Toggle Scroll Cell Output"
|
|
568
|
+
)),
|
|
629
569
|
keybinding: {
|
|
630
570
|
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, ( InputFocusedContext.toNegated()), NOTEBOOK_CELL_HAS_OUTPUTS)),
|
|
631
571
|
primary: KeyChord(2048 | 41 , 55 ),
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import {
|
|
5
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
4
|
+
import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
6
5
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
7
6
|
import { NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
8
|
-
import { expandCellRangesWithHiddenCells, cellRangeToViewCells
|
|
7
|
+
import { getNotebookEditorFromEditorPane, expandCellRangesWithHiddenCells, cellRangeToViewCells } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
9
8
|
import { CopyAction, PasteAction, CutAction } from 'vscode/vscode/vs/editor/contrib/clipboard/browser/clipboard';
|
|
10
9
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
11
10
|
import { cloneNotebookCellTextModel } from 'vscode/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
|
|
@@ -217,6 +216,7 @@ function runCutCells(accessor, editor, targetCell) {
|
|
|
217
216
|
return true;
|
|
218
217
|
}
|
|
219
218
|
let NotebookClipboardContribution = class NotebookClipboardContribution extends Disposable {
|
|
219
|
+
static { this.ID = 'workbench.contrib.notebookClipboard'; }
|
|
220
220
|
constructor(_editorService) {
|
|
221
221
|
super();
|
|
222
222
|
this._editorService = _editorService;
|
|
@@ -323,8 +323,7 @@ let NotebookClipboardContribution = class NotebookClipboardContribution extends
|
|
|
323
323
|
NotebookClipboardContribution = ( __decorate([
|
|
324
324
|
( __param(0, IEditorService))
|
|
325
325
|
], NotebookClipboardContribution));
|
|
326
|
-
|
|
327
|
-
workbenchContributionsRegistry.registerWorkbenchContribution(NotebookClipboardContribution, 2 );
|
|
326
|
+
registerWorkbenchContribution2(NotebookClipboardContribution.ID, NotebookClipboardContribution, 2 );
|
|
328
327
|
const COPY_CELL_COMMAND_ID = 'notebook.cell.copy';
|
|
329
328
|
const CUT_CELL_COMMAND_ID = 'notebook.cell.cut';
|
|
330
329
|
const PASTE_CELL_COMMAND_ID = 'notebook.cell.paste';
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
2
3
|
import { Disposable, DisposableStore, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
4
5
|
import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
|
|
5
|
-
import {
|
|
6
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
6
7
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
8
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
8
9
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
9
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
10
|
+
import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
10
11
|
import { CENTER_ACTIVE_CELL } from '../navigation/arrow.js';
|
|
11
12
|
import { SELECT_KERNEL_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
13
|
+
import { SELECT_NOTEBOOK_INDENTATION_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/editActions';
|
|
12
14
|
import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
13
15
|
import { NotebookCellsChangeType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
14
16
|
import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
|
|
@@ -234,5 +236,85 @@ ActiveCellStatus = ( __decorate([
|
|
|
234
236
|
( __param(1, IStatusbarService))
|
|
235
237
|
], ActiveCellStatus));
|
|
236
238
|
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ActiveCellStatus, 3 );
|
|
239
|
+
let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposable {
|
|
240
|
+
static { this.ID = 'selectNotebookIndentation'; }
|
|
241
|
+
constructor(_editorService, _statusbarService, _configurationService) {
|
|
242
|
+
super();
|
|
243
|
+
this._editorService = _editorService;
|
|
244
|
+
this._statusbarService = _statusbarService;
|
|
245
|
+
this._configurationService = _configurationService;
|
|
246
|
+
this._itemDisposables = this._register(( new DisposableStore()));
|
|
247
|
+
this._accessor = this._register(( new MutableDisposable()));
|
|
248
|
+
this._register(this._editorService.onDidActiveEditorChange(() => this._update()));
|
|
249
|
+
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
250
|
+
if (e.affectsConfiguration('editor') || e.affectsConfiguration('notebook')) {
|
|
251
|
+
this._update();
|
|
252
|
+
}
|
|
253
|
+
}));
|
|
254
|
+
}
|
|
255
|
+
_update() {
|
|
256
|
+
this._itemDisposables.clear();
|
|
257
|
+
const activeEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
|
|
258
|
+
if (activeEditor) {
|
|
259
|
+
this._show(activeEditor);
|
|
260
|
+
this._itemDisposables.add(activeEditor.onDidChangeSelection(() => {
|
|
261
|
+
this._accessor.clear();
|
|
262
|
+
this._show(activeEditor);
|
|
263
|
+
}));
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
this._accessor.clear();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
_show(editor) {
|
|
270
|
+
if (!editor.hasModel()) {
|
|
271
|
+
this._accessor.clear();
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const cellOptions = editor.getActiveCell()?.textModel?.getOptions();
|
|
275
|
+
if (!cellOptions) {
|
|
276
|
+
this._accessor.clear();
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const cellEditorOverridesRaw = editor.notebookOptions.getDisplayOptions().editorOptionsCustomizations;
|
|
280
|
+
const indentSize = cellEditorOverridesRaw['editor.indentSize'] ?? cellOptions?.indentSize;
|
|
281
|
+
const insertSpaces = cellEditorOverridesRaw['editor.insertSpaces'] ?? cellOptions?.tabSize;
|
|
282
|
+
const tabSize = cellEditorOverridesRaw['editor.tabSize'] ?? cellOptions?.insertSpaces;
|
|
283
|
+
const width = typeof indentSize === 'number' ? indentSize : tabSize;
|
|
284
|
+
const message = insertSpaces ? `Spaces: ${width}` : `Tab Size: ${width}`;
|
|
285
|
+
const newText = message;
|
|
286
|
+
if (!newText) {
|
|
287
|
+
this._accessor.clear();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const entry = {
|
|
291
|
+
name: ( localizeWithPath(
|
|
292
|
+
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
293
|
+
'notebook.indentation',
|
|
294
|
+
"Notebook Indentation"
|
|
295
|
+
)),
|
|
296
|
+
text: newText,
|
|
297
|
+
ariaLabel: newText,
|
|
298
|
+
tooltip: ( localizeWithPath(
|
|
299
|
+
'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
|
|
300
|
+
'selectNotebookIndentation',
|
|
301
|
+
"Select Indentation"
|
|
302
|
+
)),
|
|
303
|
+
command: SELECT_NOTEBOOK_INDENTATION_ID
|
|
304
|
+
};
|
|
305
|
+
if (!this._accessor.value) {
|
|
306
|
+
this._accessor.value = this._statusbarService.addEntry(entry, 'notebook.status.indentation', 1 , 100.4);
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
this._accessor.value.update(entry);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
NotebookIndentationStatus = ( __decorate([
|
|
314
|
+
( __param(0, IEditorService)),
|
|
315
|
+
( __param(1, IStatusbarService)),
|
|
316
|
+
( __param(2, IConfigurationService))
|
|
317
|
+
], NotebookIndentationStatus));
|
|
318
|
+
registerWorkbenchContribution2(NotebookIndentationStatus.ID, NotebookIndentationStatus, 3 );
|
|
237
319
|
|
|
238
|
-
export { ActiveCellStatus, KernelStatus };
|
|
320
|
+
export { ActiveCellStatus, KernelStatus, NotebookIndentationStatus };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import {
|
|
3
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
+
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
4
5
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
5
6
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
6
7
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
7
8
|
import { ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
8
9
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
9
10
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
10
|
-
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
11
11
|
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
12
12
|
import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
|
|
13
|
-
import { HAS_OPENED_NOTEBOOK } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
14
13
|
import { NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
14
|
+
import { HAS_OPENED_NOTEBOOK } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
15
15
|
import { NotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
16
16
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
17
17
|
|
|
@@ -62,14 +62,11 @@ registerAction2(class NotebookClearNotebookLayoutAction extends Action2 {
|
|
|
62
62
|
constructor() {
|
|
63
63
|
super({
|
|
64
64
|
id: 'workbench.notebook.layout.gettingStarted',
|
|
65
|
-
title:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
)),
|
|
71
|
-
original: 'Reset notebook getting started'
|
|
72
|
-
},
|
|
65
|
+
title: ( localize2WithPath(
|
|
66
|
+
'vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted',
|
|
67
|
+
'workbench.notebook.layout.gettingStarted.label',
|
|
68
|
+
"Reset notebook getting started"
|
|
69
|
+
)),
|
|
73
70
|
f1: true,
|
|
74
71
|
precondition: ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)),
|
|
75
72
|
category: Categories.Developer,
|