@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.
Files changed (31) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +6 -1
  3. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +101 -161
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +4 -5
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +85 -3
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +8 -11
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +3 -5
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +34 -12
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +5 -0
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +55 -17
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +39 -3
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -41
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +17 -26
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +3 -4
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +565 -0
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +31 -0
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +744 -0
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +28 -23
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +351 -0
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +41 -42
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +31 -13
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +4 -4
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +4 -4
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +25 -16
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +118 -6
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +6 -6
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +6 -9
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +2 -3
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +3 -39
  30. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +43 -11
  31. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +5 -1
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
2
2
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { append, $ as $$1, addStandardDisposableGenericMouseDownListener, addStandardDisposableGenericMouseUpListener, getActiveWindow, scheduleAtNextAnimationFrame, getWindow } from 'vscode/vscode/vs/base/browser/dom';
3
+ import { getWindowById, append, $ as $$1, getWindow, addStandardDisposableGenericMouseDownListener, addStandardDisposableGenericMouseUpListener, getActiveWindow, scheduleAtNextAnimationFrame } from 'vscode/vscode/vs/base/browser/dom';
4
4
  import { findLastIdx } from 'vscode/vscode/vs/base/common/arraysFind';
5
5
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
6
6
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
@@ -15,7 +15,7 @@ import { editorBackground, foreground, focusBorder, diffDiagonalFill } from 'vsc
15
15
  import { INotebookEditorWorkerService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService';
16
16
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
17
17
  import { BareFontInfo } from 'vscode/vscode/vs/editor/common/config/fontInfo';
18
- import { PixelRatio } from 'vscode/vscode/vs/base/browser/browser';
18
+ import { PixelRatio } from 'vscode/vscode/vs/base/browser/pixelRatio';
19
19
  import { DiffSide, DIFF_CELL_MARGIN } from './notebookDiffEditorBrowser.js';
20
20
  import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
21
21
  import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
@@ -32,6 +32,8 @@ import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contr
32
32
  import { cellRangesToIndexes, cellIndexesToRanges } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookRange';
33
33
  import { NotebookDiffOverviewRuler } from './notebookDiffOverviewRuler.js';
34
34
  import { registerZIndex, ZIndex } from 'vscode/vscode/vs/platform/layout/browser/zIndexRegistry';
35
+ import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
36
+ import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
35
37
 
36
38
  var NotebookTextDiffEditor_1;
37
39
  const $ = $$1;
@@ -74,7 +76,7 @@ let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
74
76
  get isDisposed() {
75
77
  return this._isDisposed;
76
78
  }
77
- constructor(instantiationService, themeService, contextKeyService, notebookEditorWorkerService, configurationService, telemetryService, storageService, notebookExecutionStateService) {
79
+ constructor(instantiationService, themeService, contextKeyService, notebookEditorWorkerService, configurationService, telemetryService, storageService, notebookExecutionStateService, codeEditorService) {
78
80
  super(NotebookTextDiffEditor_1.ID, telemetryService, themeService, storageService);
79
81
  this.instantiationService = instantiationService;
80
82
  this.contextKeyService = contextKeyService;
@@ -100,12 +102,27 @@ let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
100
102
  this.onDidChangeSelection = this._onDidChangeSelection.event;
101
103
  this._isDisposed = false;
102
104
  this.pendingLayouts = ( new WeakMap());
103
- this._notebookOptions = ( new NotebookOptions(this.configurationService, notebookExecutionStateService, false));
105
+ this._notebookOptions = ( new NotebookOptions(
106
+ getWindowById(this.group?.windowId, true).window ?? mainWindow,
107
+ this.configurationService,
108
+ notebookExecutionStateService,
109
+ codeEditorService,
110
+ false
111
+ ));
104
112
  this._register(this._notebookOptions);
105
- const editorOptions = this.configurationService.getValue('editor');
106
- this._fontInfo = FontMeasurements.readFontInfo(BareFontInfo.createFromRawSettings(editorOptions, PixelRatio.value));
107
113
  this._revealFirst = true;
108
114
  }
115
+ get fontInfo() {
116
+ if (!this._fontInfo) {
117
+ this._fontInfo = this.createFontInfo();
118
+ }
119
+ return this._fontInfo;
120
+ }
121
+ createFontInfo() {
122
+ const window = getWindowById(this.group?.windowId, true).window;
123
+ const editorOptions = this.configurationService.getValue('editor');
124
+ return FontMeasurements.readFontInfo(window, BareFontInfo.createFromRawSettings(editorOptions, PixelRatio.getInstance(window).value));
125
+ }
109
126
  isOverviewRulerEnabled() {
110
127
  return this.configurationService.getValue(NotebookSetting.diffOverviewRuler) ?? false;
111
128
  }
@@ -172,7 +189,7 @@ let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
172
189
  this.instantiationService.createInstance(CellDiffSideBySideRenderer, this),
173
190
  ];
174
191
  this._listViewContainer = append(this._rootElement, $$1('.notebook-diff-list-view'));
175
- this._list = this.instantiationService.createInstance(NotebookTextDiffList, 'NotebookTextDiff', this._listViewContainer, this.instantiationService.createInstance(NotebookCellTextDiffListDelegate), renderers, this.contextKeyService, {
192
+ this._list = this.instantiationService.createInstance(NotebookTextDiffList, 'NotebookTextDiff', this._listViewContainer, this.instantiationService.createInstance(NotebookCellTextDiffListDelegate, getWindow(this._listViewContainer)), renderers, this.contextKeyService, {
176
193
  setRowLineHeight: false,
177
194
  setRowHeight: false,
178
195
  supportDynamicHeights: true,
@@ -361,7 +378,7 @@ let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
361
378
  this._modifiedWebview.element.style.left = `calc(50%)`;
362
379
  }
363
380
  _generateFontFamily() {
364
- return this._fontInfo?.fontFamily ?? `"SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace`;
381
+ return this.fontInfo.fontFamily ?? `"SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace`;
365
382
  }
366
383
  async _createOriginalWebview(id, viewType, resource) {
367
384
  this._originalWebview?.dispose();
@@ -389,7 +406,7 @@ let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
389
406
  return;
390
407
  }
391
408
  NotebookTextDiffEditor_1.prettyChanges(this._model, diffResult.cellsDiff);
392
- const { viewModels, firstChangeIndex } = NotebookTextDiffEditor_1.computeDiff(this.instantiationService, this.configurationService, this._model, this._eventDispatcher, diffResult, this._fontInfo);
409
+ const { viewModels, firstChangeIndex } = NotebookTextDiffEditor_1.computeDiff(this.instantiationService, this.configurationService, this._model, this._eventDispatcher, diffResult, this.fontInfo);
393
410
  const isSame = this._isViewModelTheSame(viewModels);
394
411
  if (!isSame) {
395
412
  this._originalWebview?.removeInsets([...this._originalWebview?.insetMapping.keys()]);
@@ -761,7 +778,7 @@ let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
761
778
  return {
762
779
  width: this._dimension.width,
763
780
  height: this._dimension.height,
764
- fontInfo: this._fontInfo,
781
+ fontInfo: this.fontInfo,
765
782
  scrollHeight: this._list?.getScrollHeight() ?? 0,
766
783
  stickyHeight: 0,
767
784
  };
@@ -795,14 +812,14 @@ let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
795
812
  return {
796
813
  width: this._dimension.width / 2,
797
814
  height: this._dimension.height / 2,
798
- fontInfo: this._fontInfo
815
+ fontInfo: this.fontInfo
799
816
  };
800
817
  }
801
818
  if (viewModel.checkIfOutputsModified()) {
802
819
  return {
803
820
  width: this._dimension.width / 2,
804
821
  height: this._dimension.height / 2,
805
- fontInfo: this._fontInfo
822
+ fontInfo: this.fontInfo
806
823
  };
807
824
  }
808
825
  else {
@@ -849,7 +866,8 @@ NotebookTextDiffEditor = NotebookTextDiffEditor_1 = ( __decorate([
849
866
  ( __param(4, IConfigurationService)),
850
867
  ( __param(5, ITelemetryService)),
851
868
  ( __param(6, IStorageService)),
852
- ( __param(7, INotebookExecutionStateService))
869
+ ( __param(7, INotebookExecutionStateService)),
870
+ ( __param(8, ICodeEditorService))
853
871
  ], NotebookTextDiffEditor));
854
872
  registerZIndex(ZIndex.Base, 10, 'notebook-diff-view-viewport-slider');
855
873
  registerThemingParticipant((theme, collector) => {
@@ -18,17 +18,17 @@ import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/brows
18
18
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
19
19
  import { CodiconActionViewItem } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView';
20
20
  import { BareFontInfo } from 'vscode/vscode/vs/editor/common/config/fontInfo';
21
- import { PixelRatio } from 'vscode/vscode/vs/base/browser/browser';
21
+ import { PixelRatio } from 'vscode/vscode/vs/base/browser/pixelRatio';
22
22
  import { WorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
23
23
  import { fixedEditorOptions, fixedDiffEditorOptions } from './diffCellEditorOptions.js';
24
24
  import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
25
25
 
26
26
  var CellDiffSingleSideRenderer_1, CellDiffSideBySideRenderer_1;
27
27
  let NotebookCellTextDiffListDelegate = class NotebookCellTextDiffListDelegate {
28
- constructor(configurationService) {
28
+ constructor(targetWindow, configurationService) {
29
29
  this.configurationService = configurationService;
30
30
  const editorOptions = this.configurationService.getValue('editor');
31
- this.lineHeight = BareFontInfo.createFromRawSettings(editorOptions, PixelRatio.value).lineHeight;
31
+ this.lineHeight = BareFontInfo.createFromRawSettings(editorOptions, PixelRatio.getInstance(targetWindow).value).lineHeight;
32
32
  }
33
33
  getHeight(element) {
34
34
  return element.getHeight(this.lineHeight);
@@ -48,7 +48,7 @@ let NotebookCellTextDiffListDelegate = class NotebookCellTextDiffListDelegate {
48
48
  }
49
49
  };
50
50
  NotebookCellTextDiffListDelegate = ( __decorate([
51
- ( __param(0, IConfigurationService))
51
+ ( __param(1, IConfigurationService))
52
52
  ], NotebookCellTextDiffListDelegate));
53
53
  let CellDiffSingleSideRenderer = class CellDiffSingleSideRenderer {
54
54
  static { CellDiffSingleSideRenderer_1 = this; }
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
2
- import { PixelRatio } from 'vscode/vscode/vs/base/browser/browser';
3
- import { addStandardDisposableListener, EventType, runAtThisOrScheduleAtNextAnimationFrame, getWindow } from 'vscode/vscode/vs/base/browser/dom';
2
+ import { getWindow, addStandardDisposableListener, EventType, runAtThisOrScheduleAtNextAnimationFrame } from 'vscode/vscode/vs/base/browser/dom';
4
3
  import { createFastDomNode } from 'vscode/vscode/vs/base/browser/fastDomNode';
4
+ import { PixelRatio } from 'vscode/vscode/vs/base/browser/pixelRatio';
5
5
  import { Color } from 'vscode/vscode/vs/base/common/color';
6
6
  import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
7
7
  import { diffOverviewRulerInserted, diffInserted, defaultInsertColor, diffOverviewRulerRemoved, diffRemoved, defaultRemoveColor } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
@@ -31,7 +31,7 @@ let NotebookDiffOverviewRuler = class NotebookDiffOverviewRuler extends Themable
31
31
  this._overviewViewportDomElement.setPosition('absolute');
32
32
  this._overviewViewportDomElement.setWidth(width);
33
33
  container.appendChild(this._overviewViewportDomElement.domNode);
34
- this._register(PixelRatio.onDidChange(() => {
34
+ this._register(PixelRatio.getInstance(getWindow(this._domNode.domNode)).onDidChange(() => {
35
35
  this._scheduleRender();
36
36
  }));
37
37
  this._register(this.themeService.onDidColorThemeChange(e => {
@@ -91,7 +91,7 @@ let NotebookDiffOverviewRuler = class NotebookDiffOverviewRuler extends Themable
91
91
  const layoutInfo = this.notebookEditor.getLayoutInfo();
92
92
  const height = layoutInfo.height;
93
93
  const contentHeight = ( this._diffElementViewModels.map(view => view.layoutInfo.totalHeight)).reduce((a, b) => a + b, 0);
94
- const ratio = PixelRatio.value;
94
+ const ratio = PixelRatio.getInstance(getWindow(this._domNode.domNode)).value;
95
95
  this._domNode.setWidth(this.width);
96
96
  this._domNode.setHeight(height);
97
97
  this._domNode.domNode.width = this.width * ratio;
@@ -10,18 +10,18 @@ import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
10
10
  import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
11
11
  import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
12
12
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
13
- import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
13
+ import { Extensions as Extensions$2 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
14
14
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
15
15
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
16
16
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
17
17
  import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
18
- import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
18
+ import { Extensions as Extensions$1, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
19
19
  import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
20
20
  import { NotebookEditor } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditor';
21
21
  import { NotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
22
22
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
23
23
  import './services/notebookServiceImpl.js';
24
- import { NotebookSetting, CellUri, CellKind, NotebookWorkingCopyTypeIdentifier } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
24
+ import { NotebookSetting, CellUri, NotebookWorkingCopyTypeIdentifier, CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
25
25
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
26
26
  import { IUndoRedoService } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo';
27
27
  import { INotebookEditorModelResolverService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService';
@@ -30,7 +30,7 @@ import { NotebookTextDiffEditor } from './diff/notebookDiffEditor.js';
30
30
  import './services/notebookWorkerServiceImpl.js';
31
31
  import { Event } from 'vscode/vscode/vs/base/common/event';
32
32
  import './services/notebookEditorServiceImpl.js';
33
- import { Extensions as Extensions$2 } from 'vscode/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
33
+ import { Extensions } from 'vscode/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
34
34
  import { getFormattedMetadataJSON, getStreamOutputData } from './diff/diffElementViewModel.js';
35
35
  import './services/notebookKernelServiceImpl.js';
36
36
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
@@ -40,13 +40,14 @@ import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
40
40
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
41
41
  import './services/notebookRendererMessagingServiceImpl.js';
42
42
  import 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
43
- import 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/insertCellActions';
43
+ import './controller/insertCellActions.js';
44
44
  import './controller/executeActions.js';
45
45
  import './controller/layoutActions.js';
46
46
  import 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/editActions';
47
47
  import 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/cellOutputActions';
48
48
  import './controller/apiActions.js';
49
49
  import 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/foldingController';
50
+ import './controller/chat/cellChatActions.js';
50
51
  import './contrib/editorHint/emptyCellEditorHint.js';
51
52
  import './contrib/clipboard/notebookClipboard.js';
52
53
  import './contrib/find/notebookFind.js';
@@ -157,7 +158,9 @@ class NotebookEditorSerializer {
157
158
  }
158
159
  ( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(NotebookEditorInput.ID, NotebookEditorSerializer);
159
160
  ( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(NotebookDiffEditorInput.ID, NotebookDiffEditorSerializer);
160
- let NotebookContribution = NotebookContribution_1 = class NotebookContribution extends Disposable {
161
+ let NotebookContribution = class NotebookContribution extends Disposable {
162
+ static { NotebookContribution_1 = this; }
163
+ static { this.ID = 'workbench.contrib.notebook'; }
161
164
  constructor(undoRedoService, configurationService, codeEditorService) {
162
165
  super();
163
166
  this.codeEditorService = codeEditorService;
@@ -206,6 +209,7 @@ NotebookContribution = NotebookContribution_1 = ( __decorate([
206
209
  ( __param(2, ICodeEditorService))
207
210
  ], NotebookContribution));
208
211
  let CellContentProvider = class CellContentProvider {
212
+ static { this.ID = 'workbench.contrib.cellContentProvider'; }
209
213
  constructor(textModelService, _modelService, _languageService, _notebookModelResolverService) {
210
214
  this._modelService = _modelService;
211
215
  this._languageService = _languageService;
@@ -265,6 +269,7 @@ CellContentProvider = ( __decorate([
265
269
  ( __param(3, INotebookEditorModelResolverService))
266
270
  ], CellContentProvider));
267
271
  let CellInfoContentProvider = class CellInfoContentProvider {
272
+ static { this.ID = 'workbench.contrib.cellInfoContentProvider'; }
268
273
  constructor(textModelService, _modelService, _languageService, _labelService, _notebookModelResolverService) {
269
274
  this._modelService = _modelService;
270
275
  this._languageService = _languageService;
@@ -405,12 +410,13 @@ CellInfoContentProvider = ( __decorate([
405
410
  ( __param(4, INotebookEditorModelResolverService))
406
411
  ], CellInfoContentProvider));
407
412
  class RegisterSchemasContribution extends Disposable {
413
+ static { this.ID = 'workbench.contrib.registerCellSchemas'; }
408
414
  constructor() {
409
415
  super();
410
416
  this.registerMetadataSchemas();
411
417
  }
412
418
  registerMetadataSchemas() {
413
- const jsonRegistry = ( Registry.as(Extensions$2.JSONContribution));
419
+ const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
414
420
  const metadataSchema = {
415
421
  properties: {
416
422
  ['language']: {
@@ -426,6 +432,7 @@ class RegisterSchemasContribution extends Disposable {
426
432
  }
427
433
  }
428
434
  let NotebookEditorManager = class NotebookEditorManager {
435
+ static { this.ID = 'workbench.contrib.notebookEditorManager'; }
429
436
  constructor(_editorService, _notebookEditorModelService, editorGroups) {
430
437
  this._editorService = _editorService;
431
438
  this._notebookEditorModelService = _notebookEditorModelService;
@@ -463,6 +470,7 @@ NotebookEditorManager = ( __decorate([
463
470
  ( __param(2, IEditorGroupsService))
464
471
  ], NotebookEditorManager));
465
472
  let SimpleNotebookWorkingCopyEditorHandler = class SimpleNotebookWorkingCopyEditorHandler extends Disposable {
473
+ static { this.ID = 'workbench.contrib.simpleNotebookWorkingCopyEditorHandler'; }
466
474
  constructor(_instantiationService, _workingCopyEditorService, _extensionService, _notebookService) {
467
475
  super();
468
476
  this._instantiationService = _instantiationService;
@@ -509,6 +517,7 @@ SimpleNotebookWorkingCopyEditorHandler = ( __decorate([
509
517
  ( __param(3, INotebookService))
510
518
  ], SimpleNotebookWorkingCopyEditorHandler));
511
519
  let NotebookLanguageSelectorScoreRefine = class NotebookLanguageSelectorScoreRefine {
520
+ static { this.ID = 'workbench.contrib.notebookLanguageSelectorScoreRefine'; }
512
521
  constructor(_notebookService, languageFeaturesService) {
513
522
  this._notebookService = _notebookService;
514
523
  languageFeaturesService.setNotebookTypeResolver(this._getNotebookInfo.bind(this));
@@ -555,14 +564,14 @@ class NotebookAccessibleViewContribution extends Disposable {
555
564
  }, ( ContextKeyExpr.and(NOTEBOOK_OUTPUT_FOCUSED, ( ContextKeyExpr.equals('resourceExtname', '.ipynb'))))));
556
565
  }
557
566
  }
558
- const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
559
- workbenchContributionsRegistry.registerWorkbenchContribution(NotebookContribution, 1 );
560
- workbenchContributionsRegistry.registerWorkbenchContribution(CellContentProvider, 1 );
561
- workbenchContributionsRegistry.registerWorkbenchContribution(CellInfoContentProvider, 1 );
562
- workbenchContributionsRegistry.registerWorkbenchContribution(RegisterSchemasContribution, 1 );
563
- workbenchContributionsRegistry.registerWorkbenchContribution(NotebookEditorManager, 2 );
564
- workbenchContributionsRegistry.registerWorkbenchContribution(NotebookLanguageSelectorScoreRefine, 2 );
565
- workbenchContributionsRegistry.registerWorkbenchContribution(SimpleNotebookWorkingCopyEditorHandler, 2 );
567
+ const workbenchContributionsRegistry = ( Registry.as(Extensions$1.Workbench));
568
+ registerWorkbenchContribution2(NotebookContribution.ID, NotebookContribution, 1 );
569
+ registerWorkbenchContribution2(CellContentProvider.ID, CellContentProvider, 1 );
570
+ registerWorkbenchContribution2(CellInfoContentProvider.ID, CellInfoContentProvider, 1 );
571
+ registerWorkbenchContribution2(RegisterSchemasContribution.ID, RegisterSchemasContribution, 1 );
572
+ registerWorkbenchContribution2(NotebookEditorManager.ID, NotebookEditorManager, 2 );
573
+ registerWorkbenchContribution2(NotebookLanguageSelectorScoreRefine.ID, NotebookLanguageSelectorScoreRefine, 2 );
574
+ registerWorkbenchContribution2(SimpleNotebookWorkingCopyEditorHandler.ID, SimpleNotebookWorkingCopyEditorHandler, 2 );
566
575
  workbenchContributionsRegistry.registerWorkbenchContribution(NotebookAccessibilityHelpContribution, 4 );
567
576
  workbenchContributionsRegistry.registerWorkbenchContribution(NotebookAccessibleViewContribution, 4 );
568
577
  workbenchContributionsRegistry.registerWorkbenchContribution(NotebookVariables, 4 );
@@ -599,7 +608,7 @@ const editorOptionsCustomizationSchema = {
599
608
  ],
600
609
  tags: ['notebookLayout']
601
610
  };
602
- const configurationRegistry = ( Registry.as(Extensions$1.Configuration));
611
+ const configurationRegistry = ( Registry.as(Extensions$2.Configuration));
603
612
  configurationRegistry.registerConfiguration({
604
613
  id: 'notebook',
605
614
  order: 100,
@@ -1,6 +1,10 @@
1
1
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
2
2
  import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
3
3
  import { NotebookEditorPriority } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
4
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
+ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
6
+ import { Extensions } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures';
7
+ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
8
 
5
9
  const NotebookEditorContribution = ( Object.freeze({
6
10
  type: 'type',
@@ -309,7 +313,7 @@ const notebookPreloadContribution = {
309
313
  }
310
314
  }
311
315
  };
312
- const notebooksExtensionPoint = ( ExtensionsRegistry.registerExtensionPoint({
316
+ const notebooksExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
313
317
  extensionPoint: 'notebooks',
314
318
  jsonSchema: notebookProviderContribution,
315
319
  activationEventsGenerator: (contribs, result) => {
@@ -319,8 +323,8 @@ const notebooksExtensionPoint = ( ExtensionsRegistry.registerExtensionPoint({
319
323
  }
320
324
  }
321
325
  }
322
- }));
323
- const notebookRendererExtensionPoint = ( ExtensionsRegistry.registerExtensionPoint({
326
+ });
327
+ const notebookRendererExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
324
328
  extensionPoint: 'notebookRenderer',
325
329
  jsonSchema: notebookRendererContribution,
326
330
  activationEventsGenerator: (contribs, result) => {
@@ -330,10 +334,118 @@ const notebookRendererExtensionPoint = ( ExtensionsRegistry.registerExtensionPoi
330
334
  }
331
335
  }
332
336
  }
333
- }));
334
- const notebookPreloadExtensionPoint = ( ExtensionsRegistry.registerExtensionPoint({
337
+ });
338
+ const notebookPreloadExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
335
339
  extensionPoint: 'notebookPreload',
336
340
  jsonSchema: notebookPreloadContribution,
337
- }));
341
+ });
342
+ class NotebooksDataRenderer extends Disposable {
343
+ constructor() {
344
+ super(...arguments);
345
+ this.type = 'table';
346
+ }
347
+ shouldRender(manifest) {
348
+ return !!manifest.contributes?.notebooks;
349
+ }
350
+ render(manifest) {
351
+ const contrib = manifest.contributes?.notebooks || [];
352
+ if (!contrib.length) {
353
+ return { data: { headers: [], rows: [] }, dispose: () => { } };
354
+ }
355
+ const headers = [
356
+ ( localizeWithPath(
357
+ 'vs/workbench/contrib/notebook/browser/notebookExtensionPoint',
358
+ 'Notebook id',
359
+ "ID"
360
+ )),
361
+ ( localizeWithPath(
362
+ 'vs/workbench/contrib/notebook/browser/notebookExtensionPoint',
363
+ 'Notebook name',
364
+ "Name"
365
+ )),
366
+ ];
367
+ const rows = ( contrib
368
+ .sort((a, b) => a.type.localeCompare(b.type))
369
+ .map(notebook => {
370
+ return [
371
+ notebook.type,
372
+ notebook.displayName
373
+ ];
374
+ }));
375
+ return {
376
+ data: {
377
+ headers,
378
+ rows
379
+ },
380
+ dispose: () => { }
381
+ };
382
+ }
383
+ }
384
+ class NotebookRenderersDataRenderer extends Disposable {
385
+ constructor() {
386
+ super(...arguments);
387
+ this.type = 'table';
388
+ }
389
+ shouldRender(manifest) {
390
+ return !!manifest.contributes?.notebookRenderer;
391
+ }
392
+ render(manifest) {
393
+ const contrib = manifest.contributes?.notebookRenderer || [];
394
+ if (!contrib.length) {
395
+ return { data: { headers: [], rows: [] }, dispose: () => { } };
396
+ }
397
+ const headers = [
398
+ ( localizeWithPath(
399
+ 'vs/workbench/contrib/notebook/browser/notebookExtensionPoint',
400
+ 'Notebook renderer name',
401
+ "Name"
402
+ )),
403
+ ( localizeWithPath(
404
+ 'vs/workbench/contrib/notebook/browser/notebookExtensionPoint',
405
+ 'Notebook mimetypes',
406
+ "Mimetypes"
407
+ )),
408
+ ];
409
+ const rows = ( contrib
410
+ .sort((a, b) => a.displayName.localeCompare(b.displayName))
411
+ .map(notebookRenderer => {
412
+ return [
413
+ notebookRenderer.displayName,
414
+ notebookRenderer.mimeTypes.join(',')
415
+ ];
416
+ }));
417
+ return {
418
+ data: {
419
+ headers,
420
+ rows
421
+ },
422
+ dispose: () => { }
423
+ };
424
+ }
425
+ }
426
+ ( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
427
+ id: 'notebooks',
428
+ label: ( localizeWithPath(
429
+ 'vs/workbench/contrib/notebook/browser/notebookExtensionPoint',
430
+ 'notebooks',
431
+ "Notebooks"
432
+ )),
433
+ access: {
434
+ canToggle: false
435
+ },
436
+ renderer: ( new SyncDescriptor(NotebooksDataRenderer)),
437
+ });
438
+ ( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
439
+ id: 'notebookRenderer',
440
+ label: ( localizeWithPath(
441
+ 'vs/workbench/contrib/notebook/browser/notebookExtensionPoint',
442
+ 'notebookRenderer',
443
+ "Notebook Renderers"
444
+ )),
445
+ access: {
446
+ canToggle: false
447
+ },
448
+ renderer: ( new SyncDescriptor(NotebookRenderersDataRenderer)),
449
+ });
338
450
 
339
451
  export { notebookPreloadExtensionPoint, notebookRendererExtensionPoint, notebooksExtensionPoint };
@@ -4,7 +4,7 @@ import { Disposable, combinedDisposable } from 'vscode/vscode/vs/base/common/lif
4
4
  import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
5
5
  import { isEqual } from 'vscode/vscode/vs/base/common/resources';
6
6
  import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
7
- import { AudioCue, IAudioCueService } from 'vscode/vscode/vs/platform/audioCues/browser/audioCueService';
7
+ import { AccessibilitySignal, IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
8
8
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
9
9
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
10
10
  import { CellUri, NotebookCellExecutionState, NotebookExecutionState } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
@@ -14,12 +14,12 @@ import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/noteb
14
14
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
15
15
 
16
16
  let NotebookExecutionStateService = class NotebookExecutionStateService extends Disposable {
17
- constructor(_instantiationService, _logService, _notebookService, _audioCueService) {
17
+ constructor(_instantiationService, _logService, _notebookService, _accessibilitySignalService) {
18
18
  super();
19
19
  this._instantiationService = _instantiationService;
20
20
  this._logService = _logService;
21
21
  this._notebookService = _notebookService;
22
- this._audioCueService = _audioCueService;
22
+ this._accessibilitySignalService = _accessibilitySignalService;
23
23
  this._executions = ( new ResourceMap());
24
24
  this._notebookExecutions = ( new ResourceMap());
25
25
  this._notebookListeners = ( new ResourceMap());
@@ -89,12 +89,12 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
89
89
  if (lastRunSuccess !== undefined) {
90
90
  if (lastRunSuccess) {
91
91
  if (this._executions.size === 0) {
92
- this._audioCueService.playAudioCue(AudioCue.notebookCellCompleted);
92
+ this._accessibilitySignalService.playSignal(AccessibilitySignal.notebookCellCompleted);
93
93
  }
94
94
  this._clearLastFailedCell(notebookUri);
95
95
  }
96
96
  else {
97
- this._audioCueService.playAudioCue(AudioCue.notebookCellFailed);
97
+ this._accessibilitySignalService.playSignal(AccessibilitySignal.notebookCellFailed);
98
98
  this._setLastFailedCell(notebookUri, cellHandle);
99
99
  }
100
100
  }
@@ -235,7 +235,7 @@ NotebookExecutionStateService = ( __decorate([
235
235
  ( __param(0, IInstantiationService)),
236
236
  ( __param(1, ILogService)),
237
237
  ( __param(2, INotebookService)),
238
- ( __param(3, IAudioCueService))
238
+ ( __param(3, IAccessibilitySignalService))
239
239
  ], NotebookExecutionStateService));
240
240
  class NotebookCellExecutionEvent {
241
241
  constructor(notebook, cellHandle, changed) {
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
2
2
  import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
3
3
  import { LinkedMap } from 'vscode/vscode/vs/base/common/map';
4
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
4
+ import { localize2WithPath } from 'vscode/vscode/vs/nls';
5
5
  import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
6
6
  import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
7
7
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
@@ -112,14 +112,11 @@ registerAction2(class extends Action2 {
112
112
  constructor() {
113
113
  super({
114
114
  id: 'notebook.clearNotebookKernelsMRUCache',
115
- title: {
116
- value: ( localizeWithPath(
117
- 'vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl',
118
- 'workbench.notebook.clearNotebookKernelsMRUCache',
119
- "Clear Notebook Kernels MRU Cache"
120
- )),
121
- original: 'Clear Notebook Kernels MRU Cache'
122
- },
115
+ title: ( localize2WithPath(
116
+ 'vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl',
117
+ 'workbench.notebook.clearNotebookKernelsMRUCache',
118
+ "Clear Notebook Kernels MRU Cache"
119
+ )),
123
120
  category: Categories.Developer,
124
121
  f1: true
125
122
  });
@@ -8,8 +8,7 @@ import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/co
8
8
  import { MenuId, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
9
9
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
10
10
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
11
- import { $window } from 'vscode/vscode/vs/base/browser/window';
12
- import { runWhenWindowIdle } from 'vscode/vscode/vs/base/browser/dom';
11
+ import { runWhenWindowIdle, getActiveWindow } from 'vscode/vscode/vs/base/browser/dom';
13
12
 
14
13
  var NotebookKernelService_1;
15
14
  class KernelInfo {
@@ -124,7 +123,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
124
123
  }
125
124
  _persistMementos() {
126
125
  this._persistSoonHandle?.dispose();
127
- this._persistSoonHandle = runWhenWindowIdle($window, () => {
126
+ this._persistSoonHandle = runWhenWindowIdle(getActiveWindow(), () => {
128
127
  this._storageService.store(NotebookKernelService_1._storageNotebookBinding, JSON.stringify(this._notebookBindings), 1 , 1 );
129
128
  }, 100);
130
129
  }