@codingame/monaco-vscode-notebook-service-override 3.2.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/notebook.js +13 -13
- package/package.json +2 -2
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/external/tslib/tslib.es6.js +0 -11
- package/override/vs/platform/dialogs/common/dialogs.js +0 -8
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +0 -389
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +0 -608
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +0 -109
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +0 -173
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +0 -488
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +0 -106
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +0 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +0 -165
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +0 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +0 -320
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +0 -72
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +0 -168
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +0 -209
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +0 -84
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +0 -82
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +0 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +0 -91
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +0 -393
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +0 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +0 -97
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +0 -118
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +0 -59
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +0 -148
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +0 -383
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +0 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +0 -511
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +0 -159
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +0 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +0 -94
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +0 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -565
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -31
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +0 -744
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +0 -707
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -351
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +0 -267
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -45
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1297
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -284
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -563
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -108
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +0 -313
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -890
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -393
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -175
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +0 -1174
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -159
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +0 -451
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +0 -192
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +0 -106
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +0 -509
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +0 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +0 -341
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +0 -111
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +0 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +0 -65
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +0 -641
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +0 -200
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +0 -80
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +0 -1003
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -103
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +0 -202
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +0 -80
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -98
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +0 -237
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +0 -89
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +0 -376
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +0 -408
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +0 -144
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +0 -129
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
2
|
-
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
3
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
-
import { registerAction2, MenuId, MenuRegistry } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
5
|
-
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
6
|
-
import { InputFocusedContext } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
7
|
-
import { insertCell } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/cellOperations';
|
|
8
|
-
import { NotebookAction } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
9
|
-
import { NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_EDITOR_EDITABLE } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
10
|
-
import { CellKind, NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
11
|
-
import { CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION } from './chat/notebookChatContext.js';
|
|
12
|
-
|
|
13
|
-
const INSERT_CODE_CELL_ABOVE_COMMAND_ID = 'notebook.cell.insertCodeCellAbove';
|
|
14
|
-
const INSERT_CODE_CELL_BELOW_COMMAND_ID = 'notebook.cell.insertCodeCellBelow';
|
|
15
|
-
const INSERT_CODE_CELL_ABOVE_AND_FOCUS_CONTAINER_COMMAND_ID = 'notebook.cell.insertCodeCellAboveAndFocusContainer';
|
|
16
|
-
const INSERT_CODE_CELL_BELOW_AND_FOCUS_CONTAINER_COMMAND_ID = 'notebook.cell.insertCodeCellBelowAndFocusContainer';
|
|
17
|
-
const INSERT_CODE_CELL_AT_TOP_COMMAND_ID = 'notebook.cell.insertCodeCellAtTop';
|
|
18
|
-
const INSERT_MARKDOWN_CELL_ABOVE_COMMAND_ID = 'notebook.cell.insertMarkdownCellAbove';
|
|
19
|
-
const INSERT_MARKDOWN_CELL_BELOW_COMMAND_ID = 'notebook.cell.insertMarkdownCellBelow';
|
|
20
|
-
const INSERT_MARKDOWN_CELL_AT_TOP_COMMAND_ID = 'notebook.cell.insertMarkdownCellAtTop';
|
|
21
|
-
function insertNewCell(accessor, context, kind, direction, focusEditor) {
|
|
22
|
-
let newCell = null;
|
|
23
|
-
if (context.ui) {
|
|
24
|
-
context.notebookEditor.focus();
|
|
25
|
-
}
|
|
26
|
-
const languageService = accessor.get(ILanguageService);
|
|
27
|
-
if (context.cell) {
|
|
28
|
-
const idx = context.notebookEditor.getCellIndex(context.cell);
|
|
29
|
-
newCell = insertCell(languageService, context.notebookEditor, idx, kind, direction, undefined, true);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
const focusRange = context.notebookEditor.getFocus();
|
|
33
|
-
const next = Math.max(focusRange.end - 1, 0);
|
|
34
|
-
newCell = insertCell(languageService, context.notebookEditor, next, kind, direction, undefined, true);
|
|
35
|
-
}
|
|
36
|
-
return newCell;
|
|
37
|
-
}
|
|
38
|
-
class InsertCellCommand extends NotebookAction {
|
|
39
|
-
constructor(desc, kind, direction, focusEditor) {
|
|
40
|
-
super(desc);
|
|
41
|
-
this.kind = kind;
|
|
42
|
-
this.direction = direction;
|
|
43
|
-
this.focusEditor = focusEditor;
|
|
44
|
-
}
|
|
45
|
-
async runWithContext(accessor, context) {
|
|
46
|
-
const newCell = await insertNewCell(accessor, context, this.kind, this.direction);
|
|
47
|
-
if (newCell) {
|
|
48
|
-
await context.notebookEditor.focusNotebookCell(newCell, this.focusEditor ? 'editor' : 'container');
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
registerAction2(class InsertCodeCellAboveAction extends InsertCellCommand {
|
|
53
|
-
constructor() {
|
|
54
|
-
super({
|
|
55
|
-
id: INSERT_CODE_CELL_ABOVE_COMMAND_ID,
|
|
56
|
-
title: ( localizeWithPath(
|
|
57
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
58
|
-
'notebookActions.insertCodeCellAbove',
|
|
59
|
-
"Insert Code Cell Above"
|
|
60
|
-
)),
|
|
61
|
-
keybinding: {
|
|
62
|
-
primary: 2048 | 1024 | 3 ,
|
|
63
|
-
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, ( InputFocusedContext.toNegated()))),
|
|
64
|
-
weight: 200
|
|
65
|
-
},
|
|
66
|
-
menu: {
|
|
67
|
-
id: MenuId.NotebookCellInsert,
|
|
68
|
-
order: 0
|
|
69
|
-
}
|
|
70
|
-
}, CellKind.Code, 'above', true);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
registerAction2(class InsertCodeCellAboveAndFocusContainerAction extends InsertCellCommand {
|
|
74
|
-
constructor() {
|
|
75
|
-
super({
|
|
76
|
-
id: INSERT_CODE_CELL_ABOVE_AND_FOCUS_CONTAINER_COMMAND_ID,
|
|
77
|
-
title: ( localizeWithPath(
|
|
78
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
79
|
-
'notebookActions.insertCodeCellAboveAndFocusContainer',
|
|
80
|
-
"Insert Code Cell Above and Focus Container"
|
|
81
|
-
))
|
|
82
|
-
}, CellKind.Code, 'above', false);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
registerAction2(class InsertCodeCellBelowAction extends InsertCellCommand {
|
|
86
|
-
constructor() {
|
|
87
|
-
super({
|
|
88
|
-
id: INSERT_CODE_CELL_BELOW_COMMAND_ID,
|
|
89
|
-
title: ( localizeWithPath(
|
|
90
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
91
|
-
'notebookActions.insertCodeCellBelow',
|
|
92
|
-
"Insert Code Cell Below"
|
|
93
|
-
)),
|
|
94
|
-
keybinding: {
|
|
95
|
-
primary: 2048 | 3 ,
|
|
96
|
-
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, ( InputFocusedContext.toNegated()), ( CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION.isEqualTo('')))),
|
|
97
|
-
weight: 200
|
|
98
|
-
},
|
|
99
|
-
menu: {
|
|
100
|
-
id: MenuId.NotebookCellInsert,
|
|
101
|
-
order: 1
|
|
102
|
-
}
|
|
103
|
-
}, CellKind.Code, 'below', true);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
registerAction2(class InsertCodeCellBelowAndFocusContainerAction extends InsertCellCommand {
|
|
107
|
-
constructor() {
|
|
108
|
-
super({
|
|
109
|
-
id: INSERT_CODE_CELL_BELOW_AND_FOCUS_CONTAINER_COMMAND_ID,
|
|
110
|
-
title: ( localizeWithPath(
|
|
111
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
112
|
-
'notebookActions.insertCodeCellBelowAndFocusContainer',
|
|
113
|
-
"Insert Code Cell Below and Focus Container"
|
|
114
|
-
)),
|
|
115
|
-
}, CellKind.Code, 'below', false);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
registerAction2(class InsertMarkdownCellAboveAction extends InsertCellCommand {
|
|
119
|
-
constructor() {
|
|
120
|
-
super({
|
|
121
|
-
id: INSERT_MARKDOWN_CELL_ABOVE_COMMAND_ID,
|
|
122
|
-
title: ( localizeWithPath(
|
|
123
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
124
|
-
'notebookActions.insertMarkdownCellAbove',
|
|
125
|
-
"Insert Markdown Cell Above"
|
|
126
|
-
)),
|
|
127
|
-
menu: {
|
|
128
|
-
id: MenuId.NotebookCellInsert,
|
|
129
|
-
order: 2
|
|
130
|
-
}
|
|
131
|
-
}, CellKind.Markup, 'above', true);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
registerAction2(class InsertMarkdownCellBelowAction extends InsertCellCommand {
|
|
135
|
-
constructor() {
|
|
136
|
-
super({
|
|
137
|
-
id: INSERT_MARKDOWN_CELL_BELOW_COMMAND_ID,
|
|
138
|
-
title: ( localizeWithPath(
|
|
139
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
140
|
-
'notebookActions.insertMarkdownCellBelow',
|
|
141
|
-
"Insert Markdown Cell Below"
|
|
142
|
-
)),
|
|
143
|
-
menu: {
|
|
144
|
-
id: MenuId.NotebookCellInsert,
|
|
145
|
-
order: 3
|
|
146
|
-
}
|
|
147
|
-
}, CellKind.Markup, 'below', true);
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
registerAction2(class InsertCodeCellAtTopAction extends NotebookAction {
|
|
151
|
-
constructor() {
|
|
152
|
-
super({
|
|
153
|
-
id: INSERT_CODE_CELL_AT_TOP_COMMAND_ID,
|
|
154
|
-
title: ( localizeWithPath(
|
|
155
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
156
|
-
'notebookActions.insertCodeCellAtTop',
|
|
157
|
-
"Add Code Cell At Top"
|
|
158
|
-
)),
|
|
159
|
-
f1: false
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
async run(accessor, context) {
|
|
163
|
-
context = context ?? this.getEditorContextFromArgsOrActive(accessor);
|
|
164
|
-
if (context) {
|
|
165
|
-
this.runWithContext(accessor, context);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
async runWithContext(accessor, context) {
|
|
169
|
-
const languageService = accessor.get(ILanguageService);
|
|
170
|
-
const newCell = insertCell(languageService, context.notebookEditor, 0, CellKind.Code, 'above', undefined, true);
|
|
171
|
-
if (newCell) {
|
|
172
|
-
await context.notebookEditor.focusNotebookCell(newCell, 'editor');
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
registerAction2(class InsertMarkdownCellAtTopAction extends NotebookAction {
|
|
177
|
-
constructor() {
|
|
178
|
-
super({
|
|
179
|
-
id: INSERT_MARKDOWN_CELL_AT_TOP_COMMAND_ID,
|
|
180
|
-
title: ( localizeWithPath(
|
|
181
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
182
|
-
'notebookActions.insertMarkdownCellAtTop',
|
|
183
|
-
"Add Markdown Cell At Top"
|
|
184
|
-
)),
|
|
185
|
-
f1: false
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
async run(accessor, context) {
|
|
189
|
-
context = context ?? this.getEditorContextFromArgsOrActive(accessor);
|
|
190
|
-
if (context) {
|
|
191
|
-
this.runWithContext(accessor, context);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
async runWithContext(accessor, context) {
|
|
195
|
-
const languageService = accessor.get(ILanguageService);
|
|
196
|
-
const newCell = insertCell(languageService, context.notebookEditor, 0, CellKind.Markup, 'above', undefined, true);
|
|
197
|
-
if (newCell) {
|
|
198
|
-
await context.notebookEditor.focusNotebookCell(newCell, 'editor');
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
MenuRegistry.appendMenuItem(MenuId.NotebookCellBetween, {
|
|
203
|
-
command: {
|
|
204
|
-
id: INSERT_CODE_CELL_BELOW_COMMAND_ID,
|
|
205
|
-
title: '$(add) ' + ( localizeWithPath(
|
|
206
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
207
|
-
'notebookActions.menu.insertCode',
|
|
208
|
-
"Code"
|
|
209
|
-
)),
|
|
210
|
-
tooltip: ( localizeWithPath(
|
|
211
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
212
|
-
'notebookActions.menu.insertCode.tooltip',
|
|
213
|
-
"Add Code Cell"
|
|
214
|
-
))
|
|
215
|
-
},
|
|
216
|
-
order: 0,
|
|
217
|
-
group: 'inline',
|
|
218
|
-
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), ( ContextKeyExpr.notEquals('config.notebook.experimental.insertToolbarAlignment', 'left'))))
|
|
219
|
-
});
|
|
220
|
-
MenuRegistry.appendMenuItem(MenuId.NotebookCellBetween, {
|
|
221
|
-
command: {
|
|
222
|
-
id: INSERT_CODE_CELL_BELOW_COMMAND_ID,
|
|
223
|
-
title: ( localizeWithPath(
|
|
224
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
225
|
-
'notebookActions.menu.insertCode.minimalToolbar',
|
|
226
|
-
"Add Code"
|
|
227
|
-
)),
|
|
228
|
-
icon: Codicon.add,
|
|
229
|
-
tooltip: ( localizeWithPath(
|
|
230
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
231
|
-
'notebookActions.menu.insertCode.tooltip',
|
|
232
|
-
"Add Code Cell"
|
|
233
|
-
))
|
|
234
|
-
},
|
|
235
|
-
order: 0,
|
|
236
|
-
group: 'inline',
|
|
237
|
-
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), ( ContextKeyExpr.equals('config.notebook.experimental.insertToolbarAlignment', 'left'))))
|
|
238
|
-
});
|
|
239
|
-
MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
|
240
|
-
command: {
|
|
241
|
-
id: INSERT_CODE_CELL_BELOW_COMMAND_ID,
|
|
242
|
-
icon: Codicon.add,
|
|
243
|
-
title: ( localizeWithPath(
|
|
244
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
245
|
-
'notebookActions.menu.insertCode.ontoolbar',
|
|
246
|
-
"Code"
|
|
247
|
-
)),
|
|
248
|
-
tooltip: ( localizeWithPath(
|
|
249
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
250
|
-
'notebookActions.menu.insertCode.tooltip',
|
|
251
|
-
"Add Code Cell"
|
|
252
|
-
))
|
|
253
|
-
},
|
|
254
|
-
order: -5,
|
|
255
|
-
group: 'navigation/add',
|
|
256
|
-
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), ( ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'betweenCells')), ( ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'hidden'))))
|
|
257
|
-
});
|
|
258
|
-
MenuRegistry.appendMenuItem(MenuId.NotebookCellListTop, {
|
|
259
|
-
command: {
|
|
260
|
-
id: INSERT_CODE_CELL_AT_TOP_COMMAND_ID,
|
|
261
|
-
title: '$(add) ' + ( localizeWithPath(
|
|
262
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
263
|
-
'notebookActions.menu.insertCode',
|
|
264
|
-
"Code"
|
|
265
|
-
)),
|
|
266
|
-
tooltip: ( localizeWithPath(
|
|
267
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
268
|
-
'notebookActions.menu.insertCode.tooltip',
|
|
269
|
-
"Add Code Cell"
|
|
270
|
-
))
|
|
271
|
-
},
|
|
272
|
-
order: 0,
|
|
273
|
-
group: 'inline',
|
|
274
|
-
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), ( ContextKeyExpr.notEquals('config.notebook.experimental.insertToolbarAlignment', 'left'))))
|
|
275
|
-
});
|
|
276
|
-
MenuRegistry.appendMenuItem(MenuId.NotebookCellListTop, {
|
|
277
|
-
command: {
|
|
278
|
-
id: INSERT_CODE_CELL_AT_TOP_COMMAND_ID,
|
|
279
|
-
title: ( localizeWithPath(
|
|
280
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
281
|
-
'notebookActions.menu.insertCode.minimaltoolbar',
|
|
282
|
-
"Add Code"
|
|
283
|
-
)),
|
|
284
|
-
icon: Codicon.add,
|
|
285
|
-
tooltip: ( localizeWithPath(
|
|
286
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
287
|
-
'notebookActions.menu.insertCode.tooltip',
|
|
288
|
-
"Add Code Cell"
|
|
289
|
-
))
|
|
290
|
-
},
|
|
291
|
-
order: 0,
|
|
292
|
-
group: 'inline',
|
|
293
|
-
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), ( ContextKeyExpr.equals('config.notebook.experimental.insertToolbarAlignment', 'left'))))
|
|
294
|
-
});
|
|
295
|
-
MenuRegistry.appendMenuItem(MenuId.NotebookCellBetween, {
|
|
296
|
-
command: {
|
|
297
|
-
id: INSERT_MARKDOWN_CELL_BELOW_COMMAND_ID,
|
|
298
|
-
title: '$(add) ' + ( localizeWithPath(
|
|
299
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
300
|
-
'notebookActions.menu.insertMarkdown',
|
|
301
|
-
"Markdown"
|
|
302
|
-
)),
|
|
303
|
-
tooltip: ( localizeWithPath(
|
|
304
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
305
|
-
'notebookActions.menu.insertMarkdown.tooltip',
|
|
306
|
-
"Add Markdown Cell"
|
|
307
|
-
))
|
|
308
|
-
},
|
|
309
|
-
order: 1,
|
|
310
|
-
group: 'inline',
|
|
311
|
-
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), ( ContextKeyExpr.notEquals('config.notebook.experimental.insertToolbarAlignment', 'left'))))
|
|
312
|
-
});
|
|
313
|
-
MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
|
314
|
-
command: {
|
|
315
|
-
id: INSERT_MARKDOWN_CELL_BELOW_COMMAND_ID,
|
|
316
|
-
icon: Codicon.add,
|
|
317
|
-
title: ( localizeWithPath(
|
|
318
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
319
|
-
'notebookActions.menu.insertMarkdown.ontoolbar',
|
|
320
|
-
"Markdown"
|
|
321
|
-
)),
|
|
322
|
-
tooltip: ( localizeWithPath(
|
|
323
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
324
|
-
'notebookActions.menu.insertMarkdown.tooltip',
|
|
325
|
-
"Add Markdown Cell"
|
|
326
|
-
))
|
|
327
|
-
},
|
|
328
|
-
order: -5,
|
|
329
|
-
group: 'navigation/add',
|
|
330
|
-
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), ( ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'betweenCells')), ( ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'hidden')), ( ContextKeyExpr.notEquals(`config.${NotebookSetting.globalToolbarShowLabel}`, false)), ( ContextKeyExpr.notEquals(`config.${NotebookSetting.globalToolbarShowLabel}`, 'never'))))
|
|
331
|
-
});
|
|
332
|
-
MenuRegistry.appendMenuItem(MenuId.NotebookCellListTop, {
|
|
333
|
-
command: {
|
|
334
|
-
id: INSERT_MARKDOWN_CELL_AT_TOP_COMMAND_ID,
|
|
335
|
-
title: '$(add) ' + ( localizeWithPath(
|
|
336
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
337
|
-
'notebookActions.menu.insertMarkdown',
|
|
338
|
-
"Markdown"
|
|
339
|
-
)),
|
|
340
|
-
tooltip: ( localizeWithPath(
|
|
341
|
-
'vs/workbench/contrib/notebook/browser/controller/insertCellActions',
|
|
342
|
-
'notebookActions.menu.insertMarkdown.tooltip',
|
|
343
|
-
"Add Markdown Cell"
|
|
344
|
-
))
|
|
345
|
-
},
|
|
346
|
-
order: 1,
|
|
347
|
-
group: 'inline',
|
|
348
|
-
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), ( ContextKeyExpr.notEquals('config.notebook.experimental.insertToolbarAlignment', 'left'))))
|
|
349
|
-
});
|
|
350
|
-
|
|
351
|
-
export { InsertCellCommand, insertNewCell };
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
2
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
3
|
-
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
-
import { registerAction2, Action2, MenuId, MenuRegistry } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
5
|
-
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
6
|
-
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
7
|
-
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
|
|
8
|
-
import { NOTEBOOK_ACTIONS_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
9
|
-
import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
10
|
-
import { INotebookEditorService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService';
|
|
11
|
-
import { NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
12
|
-
import { NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_EDITOR_FOCUSED } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
13
|
-
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
14
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
15
|
-
import { IPreferencesService } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences';
|
|
16
|
-
|
|
17
|
-
registerAction2(class NotebookConfigureLayoutAction extends Action2 {
|
|
18
|
-
constructor() {
|
|
19
|
-
super({
|
|
20
|
-
id: 'workbench.notebook.layout.select',
|
|
21
|
-
title: ( localize2WithPath(
|
|
22
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
23
|
-
'workbench.notebook.layout.select.label',
|
|
24
|
-
"Select between Notebook Layouts"
|
|
25
|
-
)),
|
|
26
|
-
f1: true,
|
|
27
|
-
precondition: ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)),
|
|
28
|
-
category: NOTEBOOK_ACTIONS_CATEGORY,
|
|
29
|
-
menu: [
|
|
30
|
-
{
|
|
31
|
-
id: MenuId.EditorTitle,
|
|
32
|
-
group: 'notebookLayout',
|
|
33
|
-
when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, ( ContextKeyExpr.notEquals('config.notebook.globalToolbar', true)), ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)))),
|
|
34
|
-
order: 0
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: MenuId.NotebookToolbar,
|
|
38
|
-
group: 'notebookLayout',
|
|
39
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('config.notebook.globalToolbar', true)), ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)))),
|
|
40
|
-
order: 0
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
run(accessor) {
|
|
46
|
-
accessor.get(ICommandService).executeCommand('workbench.action.openWalkthrough', { category: 'notebooks', step: 'notebookProfile' }, true);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
registerAction2(class NotebookConfigureLayoutAction extends Action2 {
|
|
50
|
-
constructor() {
|
|
51
|
-
super({
|
|
52
|
-
id: 'workbench.notebook.layout.configure',
|
|
53
|
-
title: ( localize2WithPath(
|
|
54
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
55
|
-
'workbench.notebook.layout.configure.label',
|
|
56
|
-
"Customize Notebook Layout"
|
|
57
|
-
)),
|
|
58
|
-
f1: true,
|
|
59
|
-
category: NOTEBOOK_ACTIONS_CATEGORY,
|
|
60
|
-
menu: [
|
|
61
|
-
{
|
|
62
|
-
id: MenuId.NotebookToolbar,
|
|
63
|
-
group: 'notebookLayout',
|
|
64
|
-
when: ( ContextKeyExpr.equals('config.notebook.globalToolbar', true)),
|
|
65
|
-
order: 1
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
run(accessor) {
|
|
71
|
-
accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@tag:notebookLayout' });
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
registerAction2(class NotebookConfigureLayoutFromEditorTitle extends Action2 {
|
|
75
|
-
constructor() {
|
|
76
|
-
super({
|
|
77
|
-
id: 'workbench.notebook.layout.configure.editorTitle',
|
|
78
|
-
title: ( localize2WithPath(
|
|
79
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
80
|
-
'workbench.notebook.layout.configure.label',
|
|
81
|
-
"Customize Notebook Layout"
|
|
82
|
-
)),
|
|
83
|
-
f1: false,
|
|
84
|
-
category: NOTEBOOK_ACTIONS_CATEGORY,
|
|
85
|
-
menu: [
|
|
86
|
-
{
|
|
87
|
-
id: MenuId.NotebookEditorLayoutConfigure,
|
|
88
|
-
group: 'notebookLayout',
|
|
89
|
-
when: NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
90
|
-
order: 1
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
run(accessor) {
|
|
96
|
-
accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@tag:notebookLayout' });
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|
100
|
-
submenu: MenuId.NotebookEditorLayoutConfigure,
|
|
101
|
-
rememberDefaultAction: false,
|
|
102
|
-
title: ( localize2WithPath(
|
|
103
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
104
|
-
'customizeNotebook',
|
|
105
|
-
"Customize Notebook..."
|
|
106
|
-
)),
|
|
107
|
-
icon: Codicon.gear,
|
|
108
|
-
group: 'navigation',
|
|
109
|
-
order: -1,
|
|
110
|
-
when: NOTEBOOK_IS_ACTIVE_EDITOR
|
|
111
|
-
});
|
|
112
|
-
registerAction2(class ToggleLineNumberFromEditorTitle extends Action2 {
|
|
113
|
-
constructor() {
|
|
114
|
-
super({
|
|
115
|
-
id: 'notebook.toggleLineNumbersFromEditorTitle',
|
|
116
|
-
title: ( localize2WithPath(
|
|
117
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
118
|
-
'notebook.toggleLineNumbers',
|
|
119
|
-
'Toggle Notebook Line Numbers'
|
|
120
|
-
)),
|
|
121
|
-
precondition: NOTEBOOK_EDITOR_FOCUSED,
|
|
122
|
-
menu: [
|
|
123
|
-
{
|
|
124
|
-
id: MenuId.NotebookEditorLayoutConfigure,
|
|
125
|
-
group: 'notebookLayoutDetails',
|
|
126
|
-
order: 1,
|
|
127
|
-
when: NOTEBOOK_IS_ACTIVE_EDITOR
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
category: NOTEBOOK_ACTIONS_CATEGORY,
|
|
131
|
-
f1: true,
|
|
132
|
-
toggled: {
|
|
133
|
-
condition: ( ContextKeyExpr.notEquals('config.notebook.lineNumbers', 'off')),
|
|
134
|
-
title: ( localizeWithPath(
|
|
135
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
136
|
-
'notebook.showLineNumbers',
|
|
137
|
-
"Notebook Line Numbers"
|
|
138
|
-
)),
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
async run(accessor) {
|
|
143
|
-
return accessor.get(ICommandService).executeCommand('notebook.toggleLineNumbers');
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
registerAction2(class ToggleCellToolbarPositionFromEditorTitle extends Action2 {
|
|
147
|
-
constructor() {
|
|
148
|
-
super({
|
|
149
|
-
id: 'notebook.toggleCellToolbarPositionFromEditorTitle',
|
|
150
|
-
title: ( localize2WithPath(
|
|
151
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
152
|
-
'notebook.toggleCellToolbarPosition',
|
|
153
|
-
'Toggle Cell Toolbar Position'
|
|
154
|
-
)),
|
|
155
|
-
menu: [{
|
|
156
|
-
id: MenuId.NotebookEditorLayoutConfigure,
|
|
157
|
-
group: 'notebookLayoutDetails',
|
|
158
|
-
order: 3
|
|
159
|
-
}],
|
|
160
|
-
category: NOTEBOOK_ACTIONS_CATEGORY,
|
|
161
|
-
f1: false
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
async run(accessor, ...args) {
|
|
165
|
-
return accessor.get(ICommandService).executeCommand('notebook.toggleCellToolbarPosition', ...args);
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
registerAction2(class ToggleBreadcrumbFromEditorTitle extends Action2 {
|
|
169
|
-
constructor() {
|
|
170
|
-
super({
|
|
171
|
-
id: 'breadcrumbs.toggleFromEditorTitle',
|
|
172
|
-
title: ( localize2WithPath(
|
|
173
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
174
|
-
'notebook.toggleBreadcrumb',
|
|
175
|
-
'Toggle Breadcrumbs'
|
|
176
|
-
)),
|
|
177
|
-
menu: [{
|
|
178
|
-
id: MenuId.NotebookEditorLayoutConfigure,
|
|
179
|
-
group: 'notebookLayoutDetails',
|
|
180
|
-
order: 2
|
|
181
|
-
}],
|
|
182
|
-
f1: false
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
async run(accessor) {
|
|
186
|
-
return accessor.get(ICommandService).executeCommand('breadcrumbs.toggle');
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
registerAction2(class SaveMimeTypeDisplayOrder extends Action2 {
|
|
190
|
-
constructor() {
|
|
191
|
-
super({
|
|
192
|
-
id: 'notebook.saveMimeTypeOrder',
|
|
193
|
-
title: ( localize2WithPath(
|
|
194
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
195
|
-
'notebook.saveMimeTypeOrder',
|
|
196
|
-
"Save Mimetype Display Order"
|
|
197
|
-
)),
|
|
198
|
-
f1: true,
|
|
199
|
-
category: NOTEBOOK_ACTIONS_CATEGORY,
|
|
200
|
-
precondition: NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
run(accessor) {
|
|
204
|
-
const service = accessor.get(INotebookService);
|
|
205
|
-
const qp = accessor.get(IQuickInputService).createQuickPick();
|
|
206
|
-
qp.placeholder = ( localizeWithPath(
|
|
207
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
208
|
-
'notebook.placeholder',
|
|
209
|
-
'Settings file to save in'
|
|
210
|
-
));
|
|
211
|
-
qp.items = [
|
|
212
|
-
{ target: 2 , label: ( localizeWithPath(
|
|
213
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
214
|
-
'saveTarget.machine',
|
|
215
|
-
'User Settings'
|
|
216
|
-
)) },
|
|
217
|
-
{ target: 5 , label: ( localizeWithPath(
|
|
218
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
219
|
-
'saveTarget.workspace',
|
|
220
|
-
'Workspace Settings'
|
|
221
|
-
)) },
|
|
222
|
-
];
|
|
223
|
-
qp.onDidAccept(() => {
|
|
224
|
-
const target = qp.selectedItems[0]?.target;
|
|
225
|
-
if (target !== undefined) {
|
|
226
|
-
service.saveMimeDisplayOrder(target);
|
|
227
|
-
}
|
|
228
|
-
qp.dispose();
|
|
229
|
-
});
|
|
230
|
-
qp.onDidHide(() => qp.dispose());
|
|
231
|
-
qp.show();
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
registerAction2(class NotebookWebviewResetAction extends Action2 {
|
|
235
|
-
constructor() {
|
|
236
|
-
super({
|
|
237
|
-
id: 'workbench.notebook.layout.webview.reset',
|
|
238
|
-
title: ( localize2WithPath(
|
|
239
|
-
'vs/workbench/contrib/notebook/browser/controller/layoutActions',
|
|
240
|
-
'workbench.notebook.layout.webview.reset.label',
|
|
241
|
-
"Reset Notebook Webview"
|
|
242
|
-
)),
|
|
243
|
-
f1: false,
|
|
244
|
-
category: NOTEBOOK_ACTIONS_CATEGORY
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
run(accessor, args) {
|
|
248
|
-
const editorService = accessor.get(IEditorService);
|
|
249
|
-
if (args) {
|
|
250
|
-
const uri = URI.revive(args);
|
|
251
|
-
const notebookEditorService = accessor.get(INotebookEditorService);
|
|
252
|
-
const widgets = notebookEditorService.listNotebookEditors().filter(widget => widget.hasModel() && ( widget.textModel.uri.toString()) === ( uri.toString()));
|
|
253
|
-
for (const widget of widgets) {
|
|
254
|
-
if (widget.hasModel()) {
|
|
255
|
-
widget.getInnerWebview()?.reload();
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
const editor = getNotebookEditorFromEditorPane(editorService.activeEditorPane);
|
|
261
|
-
if (!editor) {
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
editor.getInnerWebview()?.reload();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const fixedEditorPadding = {
|
|
2
|
-
top: 12,
|
|
3
|
-
bottom: 12
|
|
4
|
-
};
|
|
5
|
-
const fixedEditorOptions = {
|
|
6
|
-
padding: fixedEditorPadding,
|
|
7
|
-
scrollBeyondLastLine: false,
|
|
8
|
-
scrollbar: {
|
|
9
|
-
verticalScrollbarSize: 14,
|
|
10
|
-
horizontal: 'auto',
|
|
11
|
-
vertical: 'auto',
|
|
12
|
-
useShadows: true,
|
|
13
|
-
verticalHasArrows: false,
|
|
14
|
-
horizontalHasArrows: false,
|
|
15
|
-
alwaysConsumeMouseWheel: false,
|
|
16
|
-
},
|
|
17
|
-
renderLineHighlightOnlyWhenFocus: true,
|
|
18
|
-
overviewRulerLanes: 0,
|
|
19
|
-
overviewRulerBorder: false,
|
|
20
|
-
selectOnLineNumbers: false,
|
|
21
|
-
wordWrap: 'off',
|
|
22
|
-
lineNumbers: 'off',
|
|
23
|
-
lineDecorationsWidth: 0,
|
|
24
|
-
glyphMargin: false,
|
|
25
|
-
fixedOverflowWidgets: true,
|
|
26
|
-
minimap: { enabled: false },
|
|
27
|
-
renderValidationDecorations: 'on',
|
|
28
|
-
renderLineHighlight: 'none',
|
|
29
|
-
readOnly: true
|
|
30
|
-
};
|
|
31
|
-
const fixedDiffEditorOptions = {
|
|
32
|
-
...fixedEditorOptions,
|
|
33
|
-
glyphMargin: true,
|
|
34
|
-
enableSplitViewResizing: false,
|
|
35
|
-
renderIndicators: true,
|
|
36
|
-
renderMarginRevertIcon: false,
|
|
37
|
-
readOnly: false,
|
|
38
|
-
isInEmbeddedEditor: true,
|
|
39
|
-
renderOverviewRuler: false,
|
|
40
|
-
wordWrap: 'off',
|
|
41
|
-
diffWordWrap: 'off',
|
|
42
|
-
diffAlgorithm: 'advanced',
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export { fixedDiffEditorOptions, fixedEditorOptions, fixedEditorPadding };
|