@codingame/monaco-vscode-notebook-service-override 4.0.0 → 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 (77) hide show
  1. package/notebook.js +12 -12
  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 -10
  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 -391
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +0 -109
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +0 -173
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +0 -544
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +0 -106
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +0 -67
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +0 -165
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +0 -67
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +0 -320
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +0 -72
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +0 -168
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +0 -209
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +0 -84
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +0 -82
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +0 -67
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +0 -101
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +0 -393
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +0 -5
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +0 -97
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +0 -120
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +0 -60
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +0 -150
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +0 -656
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +0 -77
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +0 -517
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +0 -159
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +0 -56
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +0 -94
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +0 -51
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -652
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +0 -721
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -351
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +0 -315
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +0 -199
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -47
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1297
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -284
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -563
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -115
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +0 -313
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -911
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -395
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -185
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +0 -1187
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -159
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +0 -451
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +0 -192
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +0 -106
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +0 -510
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +0 -130
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +0 -341
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +0 -111
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +0 -28
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +0 -65
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +0 -641
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +0 -200
  67. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +0 -90
  68. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +0 -1002
  69. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -103
  70. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +0 -203
  71. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +0 -80
  72. package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -98
  73. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +0 -89
  74. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +0 -386
  75. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +0 -408
  76. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +0 -144
  77. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +0 -129
@@ -1,159 +0,0 @@
1
- import { Disposable, DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
2
- import { localize2WithPath } from 'vscode/vscode/vs/nls';
3
- import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
4
- import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
5
- import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
6
- import { registerNotebookContribution } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
7
- import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
8
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
9
-
10
- class TroubleshootController extends Disposable {
11
- static { this.id = 'workbench.notebook.troubleshoot'; }
12
- constructor(_notebookEditor) {
13
- super();
14
- this._notebookEditor = _notebookEditor;
15
- this._localStore = this._register(( new DisposableStore()));
16
- this._cellStateListeners = [];
17
- this._enabled = false;
18
- this._cellStatusItems = [];
19
- this._register(this._notebookEditor.onDidChangeModel(() => {
20
- this._update();
21
- }));
22
- this._update();
23
- }
24
- toggle() {
25
- this._enabled = !this._enabled;
26
- this._update();
27
- }
28
- _update() {
29
- this._localStore.clear();
30
- this._cellStateListeners.forEach(listener => listener.dispose());
31
- if (!this._notebookEditor.hasModel()) {
32
- return;
33
- }
34
- this._updateListener();
35
- }
36
- _log(cell, e) {
37
- if (this._enabled) {
38
- const oldHeight = this._notebookEditor.getViewHeight(cell);
39
- console.log(`cell#${cell.handle}`, e, `${oldHeight} -> ${cell.layoutInfo.totalHeight}`);
40
- }
41
- }
42
- _updateListener() {
43
- if (!this._notebookEditor.hasModel()) {
44
- return;
45
- }
46
- for (let i = 0; i < this._notebookEditor.getLength(); i++) {
47
- const cell = this._notebookEditor.cellAt(i);
48
- this._cellStateListeners.push(cell.onDidChangeLayout(e => {
49
- this._log(cell, e);
50
- }));
51
- }
52
- this._localStore.add(this._notebookEditor.onDidChangeViewCells(e => {
53
- [...e.splices].reverse().forEach(splice => {
54
- const [start, deleted, newCells] = splice;
55
- const deletedCells = this._cellStateListeners.splice(start, deleted, ...( newCells.map(cell => {
56
- return cell.onDidChangeLayout((e) => {
57
- this._log(cell, e);
58
- });
59
- })));
60
- dispose(deletedCells);
61
- });
62
- }));
63
- const vm = this._notebookEditor.getViewModel();
64
- let items = [];
65
- if (this._enabled) {
66
- items = this._getItemsForCells();
67
- }
68
- this._cellStatusItems = vm.deltaCellStatusBarItems(this._cellStatusItems, items);
69
- }
70
- _getItemsForCells() {
71
- const items = [];
72
- for (let i = 0; i < this._notebookEditor.getLength(); i++) {
73
- items.push({
74
- handle: i,
75
- items: [
76
- {
77
- text: `index: ${i}`,
78
- alignment: 1 ,
79
- priority: Number.MAX_SAFE_INTEGER
80
- }
81
- ]
82
- });
83
- }
84
- return items;
85
- }
86
- dispose() {
87
- dispose(this._cellStateListeners);
88
- super.dispose();
89
- }
90
- }
91
- registerNotebookContribution(TroubleshootController.id, TroubleshootController);
92
- registerAction2(class extends Action2 {
93
- constructor() {
94
- super({
95
- id: 'notebook.toggleLayoutTroubleshoot',
96
- title: ( localize2WithPath(
97
- 'vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout',
98
- 'workbench.notebook.toggleLayoutTroubleshoot',
99
- "Toggle Layout Troubleshoot"
100
- )),
101
- category: Categories.Developer,
102
- f1: true
103
- });
104
- }
105
- async run(accessor) {
106
- const editorService = accessor.get(IEditorService);
107
- const editor = getNotebookEditorFromEditorPane(editorService.activeEditorPane);
108
- if (!editor) {
109
- return;
110
- }
111
- const controller = editor.getContribution(TroubleshootController.id);
112
- controller?.toggle();
113
- }
114
- });
115
- registerAction2(class extends Action2 {
116
- constructor() {
117
- super({
118
- id: 'notebook.inspectLayout',
119
- title: ( localize2WithPath(
120
- 'vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout',
121
- 'workbench.notebook.inspectLayout',
122
- "Inspect Notebook Layout"
123
- )),
124
- category: Categories.Developer,
125
- f1: true
126
- });
127
- }
128
- async run(accessor) {
129
- const editorService = accessor.get(IEditorService);
130
- const editor = getNotebookEditorFromEditorPane(editorService.activeEditorPane);
131
- if (!editor || !editor.hasModel()) {
132
- return;
133
- }
134
- for (let i = 0; i < editor.getLength(); i++) {
135
- const cell = editor.cellAt(i);
136
- console.log(`cell#${cell.handle}`, cell.layoutInfo);
137
- }
138
- }
139
- });
140
- registerAction2(class extends Action2 {
141
- constructor() {
142
- super({
143
- id: 'notebook.clearNotebookEdtitorTypeCache',
144
- title: ( localize2WithPath(
145
- 'vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout',
146
- 'workbench.notebook.clearNotebookEdtitorTypeCache',
147
- "Clear Notebook Editor Type Cache"
148
- )),
149
- category: Categories.Developer,
150
- f1: true
151
- });
152
- }
153
- async run(accessor) {
154
- const notebookService = accessor.get(INotebookService);
155
- notebookService.clearEditorCache();
156
- }
157
- });
158
-
159
- export { TroubleshootController };
@@ -1,56 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
4
- import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
5
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
6
- import { getNotebookEditorFromEditorPane, CellEditState } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
7
- import { UndoCommand, RedoCommand } from 'vscode/vscode/vs/editor/browser/editorExtensions';
8
-
9
- let NotebookUndoRedoContribution = class NotebookUndoRedoContribution extends Disposable {
10
- static { this.ID = 'workbench.contrib.notebookUndoRedo'; }
11
- constructor(_editorService) {
12
- super();
13
- this._editorService = _editorService;
14
- const PRIORITY = 105;
15
- this._register(UndoCommand.addImplementation(PRIORITY, 'notebook-undo-redo', () => {
16
- const editor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
17
- const viewModel = editor?.getViewModel();
18
- if (editor && editor.hasModel() && viewModel) {
19
- return viewModel.undo().then(cellResources => {
20
- if (cellResources?.length) {
21
- for (let i = 0; i < editor.getLength(); i++) {
22
- const cell = editor.cellAt(i);
23
- if (cell.cellKind === CellKind.Markup && cellResources.find(resource => resource.fragment === cell.model.uri.fragment)) {
24
- cell.updateEditState(CellEditState.Editing, 'undo');
25
- }
26
- }
27
- editor?.setOptions({ cellOptions: { resource: cellResources[0] }, preserveFocus: true });
28
- }
29
- });
30
- }
31
- return false;
32
- }));
33
- this._register(RedoCommand.addImplementation(PRIORITY, 'notebook-undo-redo', () => {
34
- const editor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
35
- const viewModel = editor?.getViewModel();
36
- if (editor && editor.hasModel() && viewModel) {
37
- return viewModel.redo().then(cellResources => {
38
- if (cellResources?.length) {
39
- for (let i = 0; i < editor.getLength(); i++) {
40
- const cell = editor.cellAt(i);
41
- if (cell.cellKind === CellKind.Markup && cellResources.find(resource => resource.fragment === cell.model.uri.fragment)) {
42
- cell.updateEditState(CellEditState.Editing, 'redo');
43
- }
44
- }
45
- editor?.setOptions({ cellOptions: { resource: cellResources[0] }, preserveFocus: true });
46
- }
47
- });
48
- }
49
- return false;
50
- }));
51
- }
52
- };
53
- NotebookUndoRedoContribution = ( __decorate([
54
- ( __param(0, IEditorService))
55
- ], NotebookUndoRedoContribution));
56
- registerWorkbenchContribution2(NotebookUndoRedoContribution.ID, NotebookUndoRedoContribution, 2 );
@@ -1,94 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
- import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
3
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
5
- import { CellEditState } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
6
- import { registerNotebookContribution } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
7
- import { outputDisplayLimit } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
8
- import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
9
- import { cellRangesToIndexes } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookRange';
10
- import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
11
-
12
- let NotebookViewportContribution = class NotebookViewportContribution extends Disposable {
13
- static { this.id = 'workbench.notebook.viewportWarmup'; }
14
- constructor(_notebookEditor, _notebookService, accessibilityService) {
15
- super();
16
- this._notebookEditor = _notebookEditor;
17
- this._notebookService = _notebookService;
18
- this._warmupDocument = null;
19
- this._warmupViewport = ( new RunOnceScheduler(() => this._warmupViewportNow(), 200));
20
- this._register(this._warmupViewport);
21
- this._register(this._notebookEditor.onDidScroll(() => {
22
- this._warmupViewport.schedule();
23
- }));
24
- this._warmupDocument = ( new RunOnceScheduler(() => this._warmupDocumentNow(), 200));
25
- this._register(this._warmupDocument);
26
- this._register(this._notebookEditor.onDidAttachViewModel(() => {
27
- if (this._notebookEditor.hasModel()) {
28
- this._warmupDocument?.schedule();
29
- }
30
- }));
31
- if (this._notebookEditor.hasModel()) {
32
- this._warmupDocument?.schedule();
33
- }
34
- }
35
- _warmupDocumentNow() {
36
- if (this._notebookEditor.hasModel()) {
37
- for (let i = 0; i < this._notebookEditor.getLength(); i++) {
38
- const cell = this._notebookEditor.cellAt(i);
39
- if (cell?.cellKind === CellKind.Markup && cell?.getEditState() === CellEditState.Preview && !cell.isInputCollapsed) ;
40
- else if (cell?.cellKind === CellKind.Code) {
41
- this._warmupCodeCell(cell);
42
- }
43
- }
44
- }
45
- }
46
- _warmupViewportNow() {
47
- if (this._notebookEditor.isDisposed) {
48
- return;
49
- }
50
- if (!this._notebookEditor.hasModel()) {
51
- return;
52
- }
53
- const visibleRanges = this._notebookEditor.getVisibleRangesPlusViewportAboveAndBelow();
54
- cellRangesToIndexes(visibleRanges).forEach(index => {
55
- const cell = this._notebookEditor.cellAt(index);
56
- if (cell?.cellKind === CellKind.Markup && cell?.getEditState() === CellEditState.Preview && !cell.isInputCollapsed) {
57
- this._notebookEditor.createMarkupPreview(cell);
58
- }
59
- else if (cell?.cellKind === CellKind.Code) {
60
- this._warmupCodeCell(cell);
61
- }
62
- });
63
- }
64
- _warmupCodeCell(viewCell) {
65
- if (viewCell.isOutputCollapsed) {
66
- return;
67
- }
68
- const outputs = viewCell.outputsViewModels;
69
- for (const output of outputs.slice(0, outputDisplayLimit)) {
70
- const [mimeTypes, pick] = output.resolveMimeTypes(this._notebookEditor.textModel, undefined);
71
- if (!mimeTypes.find(mimeType => mimeType.isTrusted) || mimeTypes.length === 0) {
72
- continue;
73
- }
74
- const pickedMimeTypeRenderer = mimeTypes[pick];
75
- if (!pickedMimeTypeRenderer) {
76
- return;
77
- }
78
- if (!this._notebookEditor.hasModel()) {
79
- return;
80
- }
81
- const renderer = this._notebookService.getRendererInfo(pickedMimeTypeRenderer.rendererId);
82
- if (!renderer) {
83
- return;
84
- }
85
- const result = { type: 1 , renderer, source: output, mimeType: pickedMimeTypeRenderer.mimeType };
86
- this._notebookEditor.createOutput(viewCell, result, 0, true);
87
- }
88
- }
89
- };
90
- NotebookViewportContribution = ( __decorate([
91
- ( __param(1, INotebookService)),
92
- ( __param(2, IAccessibilityService))
93
- ], NotebookViewportContribution));
94
- registerNotebookContribution(NotebookViewportContribution.id, NotebookViewportContribution);
@@ -1,51 +0,0 @@
1
- import { isRelativePattern } from 'vscode/vscode/vs/base/common/glob';
2
- import { URI } from 'vscode/vscode/vs/base/common/uri';
3
- import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
4
- import { isDocumentExcludePattern } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
5
- import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
6
- import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
7
-
8
- CommandsRegistry.registerCommand('_resolveNotebookContentProvider', (accessor) => {
9
- const notebookService = accessor.get(INotebookService);
10
- const contentProviders = notebookService.getContributedNotebookTypes();
11
- return ( contentProviders.map(provider => {
12
- const filenamePatterns = ( provider.selectors.map(selector => {
13
- if (typeof selector === 'string') {
14
- return selector;
15
- }
16
- if (isRelativePattern(selector)) {
17
- return selector;
18
- }
19
- if (isDocumentExcludePattern(selector)) {
20
- return {
21
- include: selector.include,
22
- exclude: selector.exclude
23
- };
24
- }
25
- return null;
26
- })).filter(pattern => pattern !== null);
27
- return {
28
- viewType: provider.id,
29
- displayName: provider.displayName,
30
- filenamePattern: filenamePatterns,
31
- options: {
32
- transientCellMetadata: provider.options.transientCellMetadata,
33
- transientDocumentMetadata: provider.options.transientDocumentMetadata,
34
- transientOutputs: provider.options.transientOutputs
35
- }
36
- };
37
- }));
38
- });
39
- CommandsRegistry.registerCommand('_resolveNotebookKernels', async (accessor, args) => {
40
- const notebookKernelService = accessor.get(INotebookKernelService);
41
- const uri = URI.revive(args.uri);
42
- const kernels = notebookKernelService.getMatchingKernel({ uri, viewType: args.viewType });
43
- return ( kernels.all.map(provider => ({
44
- id: provider.id,
45
- label: provider.label,
46
- description: provider.description,
47
- detail: provider.detail,
48
- isPreferred: false,
49
- preloads: provider.preloadUris,
50
- })));
51
- });