@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.
Files changed (80) hide show
  1. package/notebook.js +13 -13
  2. package/package.json +2 -2
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  6. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +0 -6
  7. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +0 -389
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +0 -608
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +0 -109
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +0 -173
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +0 -488
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +0 -106
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +0 -67
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +0 -165
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +0 -67
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +0 -320
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +0 -72
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +0 -168
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +0 -209
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +0 -84
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +0 -82
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +0 -67
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +0 -91
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +0 -393
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +0 -5
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +0 -97
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +0 -118
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +0 -59
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +0 -148
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +0 -383
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +0 -77
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +0 -511
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +0 -159
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +0 -56
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +0 -94
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +0 -51
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -565
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -31
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +0 -744
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +0 -707
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -351
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +0 -267
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -45
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1297
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -284
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -563
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -108
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +0 -313
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -890
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -393
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -175
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +0 -1174
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -159
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +0 -451
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +0 -192
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +0 -106
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +0 -509
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +0 -130
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +0 -341
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +0 -111
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +0 -28
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +0 -65
  67. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +0 -641
  68. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +0 -200
  69. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +0 -80
  70. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +0 -1003
  71. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -103
  72. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +0 -202
  73. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +0 -80
  74. package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -98
  75. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +0 -237
  76. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +0 -89
  77. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +0 -376
  78. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +0 -408
  79. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +0 -144
  80. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +0 -129
@@ -1,383 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { IconLabel } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabel';
4
- import { Emitter } from 'vscode/vscode/vs/base/common/event';
5
- import { createMatches } from 'vscode/vscode/vs/base/common/filters';
6
- import { DisposableStore, Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
7
- import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
8
- import { getIconClassesForLanguageId } from 'vscode/vscode/vs/editor/common/services/getIconClasses';
9
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
10
- import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
11
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
12
- import { MarkerSeverity } from 'vscode/vscode/vs/platform/markers/common/markers';
13
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
14
- import { listErrorForeground, listWarningForeground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
15
- import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
16
- import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
17
- import { NotebookEditor } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditor';
18
- import { NotebookCellOutlineProvider } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider';
19
- import { NotebookSetting, CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
20
- import { SIDE_GROUP, IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
21
- import { IOutlineService } from 'vscode/vscode/vs/workbench/services/outline/browser/outline';
22
- import { Range } from 'vscode/vscode/vs/editor/common/core/range';
23
- import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
24
- import { WindowIdleValue } from 'vscode/vscode/vs/base/browser/dom';
25
-
26
- var NotebookCellOutline_1;
27
- class NotebookOutlineTemplate {
28
- static { this.templateId = 'NotebookOutlineRenderer'; }
29
- constructor(container, iconClass, iconLabel, decoration) {
30
- this.container = container;
31
- this.iconClass = iconClass;
32
- this.iconLabel = iconLabel;
33
- this.decoration = decoration;
34
- }
35
- }
36
- let NotebookOutlineRenderer = class NotebookOutlineRenderer {
37
- constructor(_themeService, _configurationService) {
38
- this._themeService = _themeService;
39
- this._configurationService = _configurationService;
40
- this.templateId = NotebookOutlineTemplate.templateId;
41
- }
42
- renderTemplate(container) {
43
- container.classList.add('notebook-outline-element', 'show-file-icons');
44
- const iconClass = document.createElement('div');
45
- container.append(iconClass);
46
- const iconLabel = ( new IconLabel(container, { supportHighlights: true }));
47
- const decoration = document.createElement('div');
48
- decoration.className = 'element-decoration';
49
- container.append(decoration);
50
- return ( new NotebookOutlineTemplate(container, iconClass, iconLabel, decoration));
51
- }
52
- renderElement(node, _index, template, _height) {
53
- const extraClasses = [];
54
- const options = {
55
- matches: createMatches(node.filterData),
56
- labelEscapeNewLines: true,
57
- extraClasses,
58
- };
59
- if (node.element.cell.cellKind === CellKind.Code && this._themeService.getFileIconTheme().hasFileIcons && !node.element.isExecuting) {
60
- template.iconClass.className = '';
61
- extraClasses.push(...getIconClassesForLanguageId(node.element.cell.language ?? ''));
62
- }
63
- else {
64
- template.iconClass.className = 'element-icon ' + ThemeIcon.asClassNameArray(node.element.icon).join(' ');
65
- }
66
- template.iconLabel.setLabel(node.element.label, undefined, options);
67
- const { markerInfo } = node.element;
68
- template.container.style.removeProperty('--outline-element-color');
69
- template.decoration.innerText = '';
70
- if (markerInfo) {
71
- const problem = this._configurationService.getValue('problems.visibility');
72
- const useBadges = this._configurationService.getValue("outline.problems.badges" );
73
- if (!useBadges || !problem) {
74
- template.decoration.classList.remove('bubble');
75
- template.decoration.innerText = '';
76
- }
77
- else if (markerInfo.count === 0) {
78
- template.decoration.classList.add('bubble');
79
- template.decoration.innerText = '\uea71';
80
- }
81
- else {
82
- template.decoration.classList.remove('bubble');
83
- template.decoration.innerText = markerInfo.count > 9 ? '9+' : String(markerInfo.count);
84
- }
85
- const color = this._themeService.getColorTheme().getColor(markerInfo.topSev === MarkerSeverity.Error ? listErrorForeground : listWarningForeground);
86
- if (problem === undefined) {
87
- return;
88
- }
89
- const useColors = this._configurationService.getValue("outline.problems.colors" );
90
- if (!useColors || !problem) {
91
- template.container.style.removeProperty('--outline-element-color');
92
- template.decoration.style.setProperty('--outline-element-color', color?.toString() ?? 'inherit');
93
- }
94
- else {
95
- template.container.style.setProperty('--outline-element-color', color?.toString() ?? 'inherit');
96
- }
97
- }
98
- }
99
- disposeTemplate(templateData) {
100
- templateData.iconLabel.dispose();
101
- }
102
- };
103
- NotebookOutlineRenderer = ( __decorate([
104
- ( __param(0, IThemeService)),
105
- ( __param(1, IConfigurationService))
106
- ], NotebookOutlineRenderer));
107
- class NotebookOutlineAccessibility {
108
- getAriaLabel(element) {
109
- return element.label;
110
- }
111
- getWidgetAriaLabel() {
112
- return '';
113
- }
114
- }
115
- class NotebookNavigationLabelProvider {
116
- getKeyboardNavigationLabel(element) {
117
- return element.label;
118
- }
119
- }
120
- class NotebookOutlineVirtualDelegate {
121
- getHeight(_element) {
122
- return 22;
123
- }
124
- getTemplateId(_element) {
125
- return NotebookOutlineTemplate.templateId;
126
- }
127
- }
128
- let NotebookQuickPickProvider = class NotebookQuickPickProvider {
129
- constructor(_getEntries, _themeService) {
130
- this._getEntries = _getEntries;
131
- this._themeService = _themeService;
132
- }
133
- getQuickPickElements() {
134
- const bucket = [];
135
- for (const entry of this._getEntries()) {
136
- entry.asFlatList(bucket);
137
- }
138
- const result = [];
139
- const { hasFileIcons } = this._themeService.getFileIconTheme();
140
- for (const element of bucket) {
141
- const useFileIcon = hasFileIcons && !element.symbolKind;
142
- result.push({
143
- element,
144
- label: useFileIcon ? element.label : `$(${element.icon.id}) ${element.label}`,
145
- ariaLabel: element.label,
146
- iconClasses: useFileIcon ? getIconClassesForLanguageId(element.cell.language ?? '') : undefined,
147
- });
148
- }
149
- return result;
150
- }
151
- };
152
- NotebookQuickPickProvider = ( __decorate([
153
- ( __param(1, IThemeService))
154
- ], NotebookQuickPickProvider));
155
- class NotebookComparator {
156
- constructor() {
157
- this._collator = ( new WindowIdleValue(mainWindow, () => new Intl.Collator(undefined, { numeric: true })));
158
- }
159
- compareByPosition(a, b) {
160
- return a.index - b.index;
161
- }
162
- compareByType(a, b) {
163
- return a.cell.cellKind - b.cell.cellKind || this._collator.value.compare(a.label, b.label);
164
- }
165
- compareByName(a, b) {
166
- return this._collator.value.compare(a.label, b.label);
167
- }
168
- }
169
- let NotebookCellOutline = NotebookCellOutline_1 = class NotebookCellOutline {
170
- get entries() {
171
- return this._outlineProvider?.entries ?? [];
172
- }
173
- get activeElement() {
174
- return this._outlineProvider?.activeElement;
175
- }
176
- constructor(_editor, _target, instantiationService, _editorService, _configurationService) {
177
- this._editor = _editor;
178
- this._editorService = _editorService;
179
- this._dispoables = ( new DisposableStore());
180
- this._onDidChange = ( new Emitter());
181
- this.onDidChange = this._onDidChange.event;
182
- this._entriesDisposables = ( new DisposableStore());
183
- this.outlineKind = 'notebookCells';
184
- this._localDisposables = ( new DisposableStore());
185
- const installSelectionListener = () => {
186
- const notebookEditor = _editor.getControl();
187
- if (!notebookEditor?.hasModel()) {
188
- this._outlineProvider?.dispose();
189
- this._outlineProvider = undefined;
190
- this._localDisposables.clear();
191
- }
192
- else {
193
- this._outlineProvider?.dispose();
194
- this._localDisposables.clear();
195
- this._outlineProvider = instantiationService.createInstance(NotebookCellOutlineProvider, notebookEditor, _target);
196
- this._localDisposables.add(this._outlineProvider.onDidChange(e => {
197
- this._onDidChange.fire(e);
198
- }));
199
- }
200
- };
201
- this._dispoables.add(_editor.onDidChangeModel(() => {
202
- installSelectionListener();
203
- }));
204
- installSelectionListener();
205
- const treeDataSource = { getChildren: parent => parent instanceof NotebookCellOutline_1 ? (this._outlineProvider?.entries ?? []) : parent.children };
206
- const delegate = ( new NotebookOutlineVirtualDelegate());
207
- const renderers = [instantiationService.createInstance(NotebookOutlineRenderer)];
208
- const comparator = ( new NotebookComparator());
209
- const options = {
210
- collapseByDefault: _target === 2 || ((_target === 1 && _configurationService.getValue("outline.collapseItems" ) === "alwaysCollapse") ),
211
- expandOnlyOnTwistieClick: true,
212
- multipleSelectionSupport: false,
213
- accessibilityProvider: ( new NotebookOutlineAccessibility()),
214
- identityProvider: { getId: element => ( element.cell.uri.toString()) },
215
- keyboardNavigationLabelProvider: ( new NotebookNavigationLabelProvider())
216
- };
217
- this.config = {
218
- breadcrumbsDataSource: {
219
- getBreadcrumbElements: () => {
220
- const result = [];
221
- let candidate = this.activeElement;
222
- while (candidate) {
223
- result.unshift(candidate);
224
- candidate = candidate.parent;
225
- }
226
- return result;
227
- }
228
- },
229
- quickPickDataSource: instantiationService.createInstance(NotebookQuickPickProvider, () => (this._outlineProvider?.entries ?? [])),
230
- treeDataSource,
231
- delegate,
232
- renderers,
233
- comparator,
234
- options
235
- };
236
- }
237
- async setFullSymbols(cancelToken) {
238
- await this._outlineProvider?.setFullSymbols(cancelToken);
239
- }
240
- get uri() {
241
- return this._outlineProvider?.uri;
242
- }
243
- get isEmpty() {
244
- return this._outlineProvider?.isEmpty ?? true;
245
- }
246
- async reveal(entry, options, sideBySide) {
247
- await this._editorService.openEditor({
248
- resource: entry.cell.uri,
249
- options: {
250
- ...options,
251
- override: this._editor.input?.editorId,
252
- cellRevealType: 5 ,
253
- selection: entry.position
254
- },
255
- }, sideBySide ? SIDE_GROUP : undefined);
256
- }
257
- preview(entry) {
258
- const widget = this._editor.getControl();
259
- if (!widget) {
260
- return Disposable.None;
261
- }
262
- if (entry.range) {
263
- const range = Range.lift(entry.range);
264
- widget.revealRangeInCenterIfOutsideViewportAsync(entry.cell, range);
265
- }
266
- else {
267
- widget.revealInCenterIfOutsideViewport(entry.cell);
268
- }
269
- const ids = widget.deltaCellDecorations([], [{
270
- handle: entry.cell.handle,
271
- options: { className: 'nb-symbolHighlight', outputClassName: 'nb-symbolHighlight' }
272
- }]);
273
- let editorDecorations;
274
- widget.changeModelDecorations(accessor => {
275
- if (entry.range) {
276
- const decorations = [
277
- {
278
- range: entry.range, options: {
279
- description: 'document-symbols-outline-range-highlight',
280
- className: 'rangeHighlight',
281
- isWholeLine: true
282
- }
283
- }
284
- ];
285
- const deltaDecoration = {
286
- ownerId: entry.cell.handle,
287
- decorations: decorations
288
- };
289
- editorDecorations = accessor.deltaDecorations([], [deltaDecoration]);
290
- }
291
- });
292
- return toDisposable(() => {
293
- widget.deltaCellDecorations(ids, []);
294
- if (editorDecorations?.length) {
295
- widget.changeModelDecorations(accessor => {
296
- accessor.deltaDecorations(editorDecorations, []);
297
- });
298
- }
299
- });
300
- }
301
- captureViewState() {
302
- const widget = this._editor.getControl();
303
- const viewState = widget?.getEditorViewState();
304
- return toDisposable(() => {
305
- if (viewState) {
306
- widget?.restoreListViewState(viewState);
307
- }
308
- });
309
- }
310
- dispose() {
311
- this._onDidChange.dispose();
312
- this._dispoables.dispose();
313
- this._entriesDisposables.dispose();
314
- this._outlineProvider?.dispose();
315
- this._localDisposables.dispose();
316
- }
317
- };
318
- NotebookCellOutline = NotebookCellOutline_1 = ( __decorate([
319
- ( __param(2, IInstantiationService)),
320
- ( __param(3, IEditorService)),
321
- ( __param(4, IConfigurationService))
322
- ], NotebookCellOutline));
323
- let NotebookOutlineCreator = class NotebookOutlineCreator {
324
- constructor(outlineService, _instantiationService, _configurationService) {
325
- this._instantiationService = _instantiationService;
326
- this._configurationService = _configurationService;
327
- const reg = outlineService.registerOutlineCreator(this);
328
- this.dispose = () => reg.dispose();
329
- }
330
- matches(candidate) {
331
- return candidate.getId() === NotebookEditor.ID;
332
- }
333
- async createOutline(editor, target, cancelToken) {
334
- const outline = this._instantiationService.createInstance(NotebookCellOutline, editor, target);
335
- const showAllSymbols = this._configurationService.getValue(NotebookSetting.gotoSymbolsAllSymbols);
336
- if (target === 4 && showAllSymbols) {
337
- await outline.setFullSymbols(cancelToken);
338
- }
339
- return outline;
340
- }
341
- };
342
- NotebookOutlineCreator = ( __decorate([
343
- ( __param(0, IOutlineService)),
344
- ( __param(1, IInstantiationService)),
345
- ( __param(2, IConfigurationService))
346
- ], NotebookOutlineCreator));
347
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(NotebookOutlineCreator, 4 );
348
- ( Registry.as(Extensions$1.Configuration)).registerConfiguration({
349
- id: 'notebook',
350
- order: 100,
351
- type: 'object',
352
- 'properties': {
353
- 'notebook.outline.showCodeCells': {
354
- type: 'boolean',
355
- default: false,
356
- markdownDescription: ( localizeWithPath(
357
- 'vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline',
358
- 'outline.showCodeCells',
359
- "When enabled notebook outline shows code cells."
360
- ))
361
- },
362
- 'notebook.breadcrumbs.showCodeCells': {
363
- type: 'boolean',
364
- default: true,
365
- markdownDescription: ( localizeWithPath(
366
- 'vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline',
367
- 'breadcrumbs.showCodeCells',
368
- "When enabled notebook breadcrumbs contain code cells."
369
- ))
370
- },
371
- [NotebookSetting.gotoSymbolsAllSymbols]: {
372
- type: 'boolean',
373
- default: true,
374
- markdownDescription: ( localizeWithPath(
375
- 'vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline',
376
- 'notebook.gotoSymbols.showAllSymbols',
377
- "When enabled the Go to Symbol Quick Pick will display full code symbols from the notebook, as well as Markdown headers."
378
- ))
379
- },
380
- }
381
- });
382
-
383
- export { NotebookCellOutline, NotebookOutlineCreator };
@@ -1,77 +0,0 @@
1
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
2
- import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
3
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
4
- import { NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
5
-
6
- var NotebookProfileType;
7
- ( (function(NotebookProfileType) {
8
- NotebookProfileType["default"] = "default";
9
- NotebookProfileType["jupyter"] = "jupyter";
10
- NotebookProfileType["colab"] = "colab";
11
- })(NotebookProfileType || (NotebookProfileType = {})));
12
- const profiles = {
13
- [NotebookProfileType.default]: {
14
- [NotebookSetting.focusIndicator]: 'gutter',
15
- [NotebookSetting.insertToolbarLocation]: 'both',
16
- [NotebookSetting.globalToolbar]: true,
17
- [NotebookSetting.cellToolbarLocation]: { default: 'right' },
18
- [NotebookSetting.compactView]: true,
19
- [NotebookSetting.showCellStatusBar]: 'visible',
20
- [NotebookSetting.consolidatedRunButton]: true,
21
- [NotebookSetting.undoRedoPerCell]: false
22
- },
23
- [NotebookProfileType.jupyter]: {
24
- [NotebookSetting.focusIndicator]: 'gutter',
25
- [NotebookSetting.insertToolbarLocation]: 'notebookToolbar',
26
- [NotebookSetting.globalToolbar]: true,
27
- [NotebookSetting.cellToolbarLocation]: { default: 'left' },
28
- [NotebookSetting.compactView]: true,
29
- [NotebookSetting.showCellStatusBar]: 'visible',
30
- [NotebookSetting.consolidatedRunButton]: false,
31
- [NotebookSetting.undoRedoPerCell]: true
32
- },
33
- [NotebookProfileType.colab]: {
34
- [NotebookSetting.focusIndicator]: 'border',
35
- [NotebookSetting.insertToolbarLocation]: 'betweenCells',
36
- [NotebookSetting.globalToolbar]: false,
37
- [NotebookSetting.cellToolbarLocation]: { default: 'right' },
38
- [NotebookSetting.compactView]: false,
39
- [NotebookSetting.showCellStatusBar]: 'hidden',
40
- [NotebookSetting.consolidatedRunButton]: true,
41
- [NotebookSetting.undoRedoPerCell]: false
42
- }
43
- };
44
- async function applyProfile(configService, profile) {
45
- const promises = [];
46
- for (const settingKey in profile) {
47
- promises.push(configService.updateValue(settingKey, profile[settingKey]));
48
- }
49
- await Promise.all(promises);
50
- }
51
- registerAction2(class extends Action2 {
52
- constructor() {
53
- super({
54
- id: 'notebook.setProfile',
55
- title: ( localizeWithPath(
56
- 'vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile',
57
- 'setProfileTitle',
58
- "Set Profile"
59
- ))
60
- });
61
- }
62
- async run(accessor, args) {
63
- if (!isSetProfileArgs(args)) {
64
- return;
65
- }
66
- const configService = accessor.get(IConfigurationService);
67
- return applyProfile(configService, profiles[args.profile]);
68
- }
69
- });
70
- function isSetProfileArgs(args) {
71
- const setProfileArgs = args;
72
- return setProfileArgs.profile === NotebookProfileType.colab ||
73
- setProfileArgs.profile === NotebookProfileType.default ||
74
- setProfileArgs.profile === NotebookProfileType.jupyter;
75
- }
76
-
77
- export { NotebookProfileType };