@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,165 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { Range } from 'vscode/vscode/vs/editor/common/core/range';
4
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
5
- import { debugIconBreakpointForeground } from 'vscode/vscode/vs/workbench/contrib/debug/browser/breakpointEditorContribution';
6
- import { topStackFrameColor, focusedStackFrameColor } from 'vscode/vscode/vs/workbench/contrib/debug/browser/callStackEditorContribution';
7
- import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
8
- import { NotebookOverviewRulerLane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
9
- import { registerNotebookContribution } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
10
- import { runningCellRulerDecorationColor } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorWidget';
11
- import { NotebookCellExecutionState, CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
12
- import { NotebookExecutionType, INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
13
-
14
- let PausedCellDecorationContribution = class PausedCellDecorationContribution extends Disposable {
15
- static { this.id = 'workbench.notebook.debug.pausedCellDecorations'; }
16
- constructor(_notebookEditor, _debugService, _notebookExecutionStateService) {
17
- super();
18
- this._notebookEditor = _notebookEditor;
19
- this._debugService = _debugService;
20
- this._notebookExecutionStateService = _notebookExecutionStateService;
21
- this._currentTopDecorations = [];
22
- this._currentOtherDecorations = [];
23
- this._executingCellDecorations = [];
24
- this._register(_debugService.getModel().onDidChangeCallStack(() => this.updateExecutionDecorations()));
25
- this._register(_debugService.getViewModel().onDidFocusStackFrame(() => this.updateExecutionDecorations()));
26
- this._register(_notebookExecutionStateService.onDidChangeExecution(e => {
27
- if (e.type === NotebookExecutionType.cell && this._notebookEditor.textModel && e.affectsNotebook(this._notebookEditor.textModel.uri)) {
28
- this.updateExecutionDecorations();
29
- }
30
- }));
31
- }
32
- updateExecutionDecorations() {
33
- const exes = this._notebookEditor.textModel ?
34
- this._notebookExecutionStateService.getCellExecutionsByHandleForNotebook(this._notebookEditor.textModel.uri)
35
- : undefined;
36
- const topFrameCellsAndRanges = [];
37
- let focusedFrameCellAndRange = undefined;
38
- const getNotebookCellAndRange = (sf) => {
39
- const parsed = CellUri.parse(sf.source.uri);
40
- if (parsed && ( parsed.notebook.toString()) === this._notebookEditor.textModel?.uri.toString()) {
41
- return { handle: parsed.handle, range: sf.range };
42
- }
43
- return undefined;
44
- };
45
- for (const session of this._debugService.getModel().getSessions()) {
46
- for (const thread of session.getAllThreads()) {
47
- const topFrame = thread.getTopStackFrame();
48
- if (topFrame) {
49
- const notebookCellAndRange = getNotebookCellAndRange(topFrame);
50
- if (notebookCellAndRange) {
51
- topFrameCellsAndRanges.push(notebookCellAndRange);
52
- exes?.delete(notebookCellAndRange.handle);
53
- }
54
- }
55
- }
56
- }
57
- const focusedFrame = this._debugService.getViewModel().focusedStackFrame;
58
- if (focusedFrame && focusedFrame.thread.stopped) {
59
- const thisFocusedFrameCellAndRange = getNotebookCellAndRange(focusedFrame);
60
- if (thisFocusedFrameCellAndRange &&
61
- !( topFrameCellsAndRanges.some(
62
- topFrame => topFrame.handle === thisFocusedFrameCellAndRange?.handle && Range.equalsRange(topFrame.range, thisFocusedFrameCellAndRange?.range)
63
- ))) {
64
- focusedFrameCellAndRange = thisFocusedFrameCellAndRange;
65
- exes?.delete(focusedFrameCellAndRange.handle);
66
- }
67
- }
68
- this.setTopFrameDecoration(topFrameCellsAndRanges);
69
- this.setFocusedFrameDecoration(focusedFrameCellAndRange);
70
- const exeHandles = exes ?
71
- ( Array.from(exes.entries())
72
- .filter(([_, exe]) => exe.state === NotebookCellExecutionState.Executing)
73
- .map(([handle]) => handle))
74
- : [];
75
- this.setExecutingCellDecorations(exeHandles);
76
- }
77
- setTopFrameDecoration(handlesAndRanges) {
78
- const newDecorations = ( handlesAndRanges.map(({ handle, range }) => {
79
- const options = {
80
- overviewRuler: {
81
- color: topStackFrameColor,
82
- includeOutput: false,
83
- modelRanges: [range],
84
- position: NotebookOverviewRulerLane.Full
85
- }
86
- };
87
- return { handle, options };
88
- }));
89
- this._currentTopDecorations = this._notebookEditor.deltaCellDecorations(this._currentTopDecorations, newDecorations);
90
- }
91
- setFocusedFrameDecoration(focusedFrameCellAndRange) {
92
- let newDecorations = [];
93
- if (focusedFrameCellAndRange) {
94
- const options = {
95
- overviewRuler: {
96
- color: focusedStackFrameColor,
97
- includeOutput: false,
98
- modelRanges: [focusedFrameCellAndRange.range],
99
- position: NotebookOverviewRulerLane.Full
100
- }
101
- };
102
- newDecorations = [{ handle: focusedFrameCellAndRange.handle, options }];
103
- }
104
- this._currentOtherDecorations = this._notebookEditor.deltaCellDecorations(this._currentOtherDecorations, newDecorations);
105
- }
106
- setExecutingCellDecorations(handles) {
107
- const newDecorations = ( handles.map(handle => {
108
- const options = {
109
- overviewRuler: {
110
- color: runningCellRulerDecorationColor,
111
- includeOutput: false,
112
- modelRanges: [( new Range(0, 0, 0, 0))],
113
- position: NotebookOverviewRulerLane.Left
114
- }
115
- };
116
- return { handle, options };
117
- }));
118
- this._executingCellDecorations = this._notebookEditor.deltaCellDecorations(this._executingCellDecorations, newDecorations);
119
- }
120
- };
121
- PausedCellDecorationContribution = ( __decorate([
122
- ( __param(1, IDebugService)),
123
- ( __param(2, INotebookExecutionStateService))
124
- ], PausedCellDecorationContribution));
125
- registerNotebookContribution(PausedCellDecorationContribution.id, PausedCellDecorationContribution);
126
- let NotebookBreakpointDecorations = class NotebookBreakpointDecorations extends Disposable {
127
- static { this.id = 'workbench.notebook.debug.notebookBreakpointDecorations'; }
128
- constructor(_notebookEditor, _debugService, _configService) {
129
- super();
130
- this._notebookEditor = _notebookEditor;
131
- this._debugService = _debugService;
132
- this._configService = _configService;
133
- this._currentDecorations = [];
134
- this._register(_debugService.getModel().onDidChangeBreakpoints(() => this.updateDecorations()));
135
- this._register(_configService.onDidChangeConfiguration(e => e.affectsConfiguration('debug.showBreakpointsInOverviewRuler') && this.updateDecorations()));
136
- }
137
- updateDecorations() {
138
- const enabled = this._configService.getValue('debug.showBreakpointsInOverviewRuler');
139
- const newDecorations = enabled ?
140
- ( this._debugService.getModel().getBreakpoints().map(breakpoint => {
141
- const parsed = CellUri.parse(breakpoint.uri);
142
- if (!parsed || ( parsed.notebook.toString()) !== ( this._notebookEditor.textModel.uri.toString())) {
143
- return null;
144
- }
145
- const options = {
146
- overviewRuler: {
147
- color: debugIconBreakpointForeground,
148
- includeOutput: false,
149
- modelRanges: [( new Range(breakpoint.lineNumber, 0, breakpoint.lineNumber, 0))],
150
- position: NotebookOverviewRulerLane.Left
151
- }
152
- };
153
- return { handle: parsed.handle, options };
154
- })).filter(x => !!x)
155
- : [];
156
- this._currentDecorations = this._notebookEditor.deltaCellDecorations(this._currentDecorations, newDecorations);
157
- }
158
- };
159
- NotebookBreakpointDecorations = ( __decorate([
160
- ( __param(1, IDebugService)),
161
- ( __param(2, IConfigurationService))
162
- ], NotebookBreakpointDecorations));
163
- registerNotebookContribution(NotebookBreakpointDecorations.id, NotebookBreakpointDecorations);
164
-
165
- export { NotebookBreakpointDecorations, PausedCellDecorationContribution };
@@ -1,67 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
3
- import { registerEditorContribution } from 'vscode/vscode/vs/editor/browser/editorExtensions';
4
- import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
5
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
6
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
7
- import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
8
- import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
9
- import { EmptyTextEditorHintContribution } from '../../../../codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js';
10
- import { IInlineChatSessionService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService';
11
- import { IInlineChatService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
12
- import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
13
- import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
14
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
15
-
16
- let EmptyCellEditorHintContribution = class EmptyCellEditorHintContribution extends EmptyTextEditorHintContribution {
17
- static { this.CONTRIB_ID = 'notebook.editor.contrib.emptyCellEditorHint'; }
18
- constructor(editor, _editorService, editorGroupsService, commandService, configurationService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService) {
19
- super(editor, editorGroupsService, commandService, configurationService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService);
20
- this._editorService = _editorService;
21
- const activeEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
22
- if (!activeEditor) {
23
- return;
24
- }
25
- this.toDispose.push(activeEditor.onDidChangeActiveCell(() => this.update()));
26
- }
27
- _getOptions() {
28
- return { clickable: false };
29
- }
30
- _shouldRenderHint() {
31
- const shouldRenderHint = super._shouldRenderHint();
32
- if (!shouldRenderHint) {
33
- return false;
34
- }
35
- const model = this.editor.getModel();
36
- if (!model) {
37
- return false;
38
- }
39
- const isNotebookCell = model?.uri.scheme === Schemas.vscodeNotebookCell;
40
- if (!isNotebookCell) {
41
- return false;
42
- }
43
- const activeEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
44
- if (!activeEditor) {
45
- return false;
46
- }
47
- const activeCell = activeEditor.getActiveCell();
48
- if (activeCell?.uri.fragment !== model.uri.fragment) {
49
- return false;
50
- }
51
- return true;
52
- }
53
- };
54
- EmptyCellEditorHintContribution = ( __decorate([
55
- ( __param(1, IEditorService)),
56
- ( __param(2, IEditorGroupsService)),
57
- ( __param(3, ICommandService)),
58
- ( __param(4, IConfigurationService)),
59
- ( __param(5, IKeybindingService)),
60
- ( __param(6, IInlineChatSessionService)),
61
- ( __param(7, IInlineChatService)),
62
- ( __param(8, ITelemetryService)),
63
- ( __param(9, IProductService))
64
- ], EmptyCellEditorHintContribution));
65
- registerEditorContribution(EmptyCellEditorHintContribution.CONTRIB_ID, EmptyCellEditorHintContribution, 0 );
66
-
67
- export { EmptyCellEditorHintContribution };
@@ -1,320 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { Disposable, DisposableStore, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
5
- import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
6
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
7
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
8
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
9
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
10
- import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
11
- import { CENTER_ACTIVE_CELL } from '../navigation/arrow.js';
12
- import { SELECT_KERNEL_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
13
- import { SELECT_NOTEBOOK_INDENTATION_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/editActions';
14
- import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
15
- import { NotebookCellsChangeType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
16
- import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
17
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
18
- import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
19
-
20
- let ImplictKernelSelector = class ImplictKernelSelector {
21
- constructor(notebook, suggested, notebookKernelService, languageFeaturesService, logService) {
22
- const disposables = ( new DisposableStore());
23
- this.dispose = disposables.dispose.bind(disposables);
24
- const selectKernel = () => {
25
- disposables.clear();
26
- notebookKernelService.selectKernelForNotebook(suggested, notebook);
27
- };
28
- disposables.add(notebook.onDidChangeContent(e => {
29
- for (const event of e.rawEvents) {
30
- switch (event.kind) {
31
- case NotebookCellsChangeType.ChangeCellContent:
32
- case NotebookCellsChangeType.ModelChange:
33
- case NotebookCellsChangeType.Move:
34
- case NotebookCellsChangeType.ChangeCellLanguage:
35
- logService.trace('IMPLICIT kernel selection because of change event', event.kind);
36
- selectKernel();
37
- break;
38
- }
39
- }
40
- }));
41
- disposables.add(languageFeaturesService.hoverProvider.register({ scheme: Schemas.vscodeNotebookCell, pattern: notebook.uri.path }, {
42
- provideHover() {
43
- logService.trace('IMPLICIT kernel selection because of hover');
44
- selectKernel();
45
- return undefined;
46
- }
47
- }));
48
- }
49
- };
50
- ImplictKernelSelector = ( __decorate([
51
- ( __param(2, INotebookKernelService)),
52
- ( __param(3, ILanguageFeaturesService)),
53
- ( __param(4, ILogService))
54
- ], ImplictKernelSelector));
55
- let KernelStatus = class KernelStatus extends Disposable {
56
- constructor(_editorService, _statusbarService, _notebookKernelService, _instantiationService) {
57
- super();
58
- this._editorService = _editorService;
59
- this._statusbarService = _statusbarService;
60
- this._notebookKernelService = _notebookKernelService;
61
- this._instantiationService = _instantiationService;
62
- this._editorDisposables = this._register(( new DisposableStore()));
63
- this._kernelInfoElement = this._register(( new DisposableStore()));
64
- this._register(this._editorService.onDidActiveEditorChange(() => this._updateStatusbar()));
65
- }
66
- _updateStatusbar() {
67
- this._editorDisposables.clear();
68
- const activeEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
69
- if (!activeEditor) {
70
- this._kernelInfoElement.clear();
71
- return;
72
- }
73
- const updateStatus = () => {
74
- if (activeEditor.notebookOptions.getDisplayOptions().globalToolbar) {
75
- this._kernelInfoElement.clear();
76
- return;
77
- }
78
- const notebook = activeEditor.textModel;
79
- if (notebook) {
80
- this._showKernelStatus(notebook);
81
- }
82
- else {
83
- this._kernelInfoElement.clear();
84
- }
85
- };
86
- this._editorDisposables.add(this._notebookKernelService.onDidAddKernel(updateStatus));
87
- this._editorDisposables.add(this._notebookKernelService.onDidChangeSelectedNotebooks(updateStatus));
88
- this._editorDisposables.add(this._notebookKernelService.onDidChangeNotebookAffinity(updateStatus));
89
- this._editorDisposables.add(activeEditor.onDidChangeModel(updateStatus));
90
- this._editorDisposables.add(activeEditor.notebookOptions.onDidChangeOptions(updateStatus));
91
- updateStatus();
92
- }
93
- _showKernelStatus(notebook) {
94
- this._kernelInfoElement.clear();
95
- const { selected, suggestions, all } = this._notebookKernelService.getMatchingKernel(notebook);
96
- const suggested = (suggestions.length === 1 ? suggestions[0] : undefined)
97
- ?? (all.length === 1) ? all[0] : undefined;
98
- let isSuggested = false;
99
- if (all.length === 0) {
100
- return;
101
- }
102
- else if (selected || suggested) {
103
- let kernel = selected;
104
- if (!kernel) {
105
- kernel = suggested;
106
- isSuggested = true;
107
- this._kernelInfoElement.add(this._instantiationService.createInstance(ImplictKernelSelector, notebook, kernel));
108
- }
109
- const tooltip = kernel.description ?? kernel.detail ?? kernel.label;
110
- this._kernelInfoElement.add(this._statusbarService.addEntry({
111
- name: ( localizeWithPath(
112
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
113
- 'notebook.info',
114
- "Notebook Kernel Info"
115
- )),
116
- text: `$(notebook-kernel-select) ${kernel.label}`,
117
- ariaLabel: kernel.label,
118
- tooltip: isSuggested ? ( localizeWithPath(
119
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
120
- 'tooltop',
121
- "{0} (suggestion)",
122
- tooltip
123
- )) : tooltip,
124
- command: SELECT_KERNEL_ID,
125
- }, SELECT_KERNEL_ID, 1 , 10));
126
- this._kernelInfoElement.add(kernel.onDidChange(() => this._showKernelStatus(notebook)));
127
- }
128
- else {
129
- this._kernelInfoElement.add(this._statusbarService.addEntry({
130
- name: ( localizeWithPath(
131
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
132
- 'notebook.select',
133
- "Notebook Kernel Selection"
134
- )),
135
- text: ( localizeWithPath(
136
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
137
- 'kernel.select.label',
138
- "Select Kernel"
139
- )),
140
- ariaLabel: ( localizeWithPath(
141
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
142
- 'kernel.select.label',
143
- "Select Kernel"
144
- )),
145
- command: SELECT_KERNEL_ID,
146
- kind: 'prominent'
147
- }, SELECT_KERNEL_ID, 1 , 10));
148
- }
149
- }
150
- };
151
- KernelStatus = ( __decorate([
152
- ( __param(0, IEditorService)),
153
- ( __param(1, IStatusbarService)),
154
- ( __param(2, INotebookKernelService)),
155
- ( __param(3, IInstantiationService))
156
- ], KernelStatus));
157
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(KernelStatus, 3 );
158
- let ActiveCellStatus = class ActiveCellStatus extends Disposable {
159
- constructor(_editorService, _statusbarService) {
160
- super();
161
- this._editorService = _editorService;
162
- this._statusbarService = _statusbarService;
163
- this._itemDisposables = this._register(( new DisposableStore()));
164
- this._accessor = this._register(( new MutableDisposable()));
165
- this._register(this._editorService.onDidActiveEditorChange(() => this._update()));
166
- }
167
- _update() {
168
- this._itemDisposables.clear();
169
- const activeEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
170
- if (activeEditor) {
171
- this._itemDisposables.add(activeEditor.onDidChangeSelection(() => this._show(activeEditor)));
172
- this._itemDisposables.add(activeEditor.onDidChangeActiveCell(() => this._show(activeEditor)));
173
- this._show(activeEditor);
174
- }
175
- else {
176
- this._accessor.clear();
177
- }
178
- }
179
- _show(editor) {
180
- if (!editor.hasModel()) {
181
- this._accessor.clear();
182
- return;
183
- }
184
- const newText = this._getSelectionsText(editor);
185
- if (!newText) {
186
- this._accessor.clear();
187
- return;
188
- }
189
- const entry = {
190
- name: ( localizeWithPath(
191
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
192
- 'notebook.activeCellStatusName',
193
- "Notebook Editor Selections"
194
- )),
195
- text: newText,
196
- ariaLabel: newText,
197
- command: CENTER_ACTIVE_CELL
198
- };
199
- if (!this._accessor.value) {
200
- this._accessor.value = this._statusbarService.addEntry(entry, 'notebook.activeCellStatus', 1 , 100);
201
- }
202
- else {
203
- this._accessor.value.update(entry);
204
- }
205
- }
206
- _getSelectionsText(editor) {
207
- if (!editor.hasModel()) {
208
- return undefined;
209
- }
210
- const activeCell = editor.getActiveCell();
211
- if (!activeCell) {
212
- return undefined;
213
- }
214
- const idxFocused = editor.getCellIndex(activeCell) + 1;
215
- const numSelected = editor.getSelections().reduce((prev, range) => prev + (range.end - range.start), 0);
216
- const totalCells = editor.getLength();
217
- return numSelected > 1 ?
218
- ( localizeWithPath(
219
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
220
- 'notebook.multiActiveCellIndicator',
221
- "Cell {0} ({1} selected)",
222
- idxFocused,
223
- numSelected
224
- )) :
225
- ( localizeWithPath(
226
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
227
- 'notebook.singleActiveCellIndicator',
228
- "Cell {0} of {1}",
229
- idxFocused,
230
- totalCells
231
- ));
232
- }
233
- };
234
- ActiveCellStatus = ( __decorate([
235
- ( __param(0, IEditorService)),
236
- ( __param(1, IStatusbarService))
237
- ], ActiveCellStatus));
238
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ActiveCellStatus, 3 );
239
- let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposable {
240
- static { this.ID = 'selectNotebookIndentation'; }
241
- constructor(_editorService, _statusbarService, _configurationService) {
242
- super();
243
- this._editorService = _editorService;
244
- this._statusbarService = _statusbarService;
245
- this._configurationService = _configurationService;
246
- this._itemDisposables = this._register(( new DisposableStore()));
247
- this._accessor = this._register(( new MutableDisposable()));
248
- this._register(this._editorService.onDidActiveEditorChange(() => this._update()));
249
- this._register(this._configurationService.onDidChangeConfiguration(e => {
250
- if (e.affectsConfiguration('editor') || e.affectsConfiguration('notebook')) {
251
- this._update();
252
- }
253
- }));
254
- }
255
- _update() {
256
- this._itemDisposables.clear();
257
- const activeEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
258
- if (activeEditor) {
259
- this._show(activeEditor);
260
- this._itemDisposables.add(activeEditor.onDidChangeSelection(() => {
261
- this._accessor.clear();
262
- this._show(activeEditor);
263
- }));
264
- }
265
- else {
266
- this._accessor.clear();
267
- }
268
- }
269
- _show(editor) {
270
- if (!editor.hasModel()) {
271
- this._accessor.clear();
272
- return;
273
- }
274
- const cellOptions = editor.getActiveCell()?.textModel?.getOptions();
275
- if (!cellOptions) {
276
- this._accessor.clear();
277
- return;
278
- }
279
- const cellEditorOverridesRaw = editor.notebookOptions.getDisplayOptions().editorOptionsCustomizations;
280
- const indentSize = cellEditorOverridesRaw['editor.indentSize'] ?? cellOptions?.indentSize;
281
- const insertSpaces = cellEditorOverridesRaw['editor.insertSpaces'] ?? cellOptions?.tabSize;
282
- const tabSize = cellEditorOverridesRaw['editor.tabSize'] ?? cellOptions?.insertSpaces;
283
- const width = typeof indentSize === 'number' ? indentSize : tabSize;
284
- const message = insertSpaces ? `Spaces: ${width}` : `Tab Size: ${width}`;
285
- const newText = message;
286
- if (!newText) {
287
- this._accessor.clear();
288
- return;
289
- }
290
- const entry = {
291
- name: ( localizeWithPath(
292
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
293
- 'notebook.indentation',
294
- "Notebook Indentation"
295
- )),
296
- text: newText,
297
- ariaLabel: newText,
298
- tooltip: ( localizeWithPath(
299
- 'vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar',
300
- 'selectNotebookIndentation',
301
- "Select Indentation"
302
- )),
303
- command: SELECT_NOTEBOOK_INDENTATION_ID
304
- };
305
- if (!this._accessor.value) {
306
- this._accessor.value = this._statusbarService.addEntry(entry, 'notebook.status.indentation', 1 , 100.4);
307
- }
308
- else {
309
- this._accessor.value.update(entry);
310
- }
311
- }
312
- };
313
- NotebookIndentationStatus = ( __decorate([
314
- ( __param(0, IEditorService)),
315
- ( __param(1, IStatusbarService)),
316
- ( __param(2, IConfigurationService))
317
- ], NotebookIndentationStatus));
318
- registerWorkbenchContribution2(NotebookIndentationStatus.ID, NotebookIndentationStatus, 3 );
319
-
320
- export { ActiveCellStatus, KernelStatus, NotebookIndentationStatus };
@@ -1,72 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
- import { throttle } from 'vscode/vscode/vs/base/common/decorators';
3
- import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { registerNotebookContribution } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
5
- import { NotebookCellExecutionState } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
6
- import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
7
- import { IUserActivityService } from 'vscode/vscode/vs/workbench/services/userActivity/common/userActivityService';
8
-
9
- let ExecutionEditorProgressController = class ExecutionEditorProgressController extends Disposable {
10
- static { this.id = 'workbench.notebook.executionEditorProgress'; }
11
- constructor(_notebookEditor, _notebookExecutionStateService, _userActivity) {
12
- super();
13
- this._notebookEditor = _notebookEditor;
14
- this._notebookExecutionStateService = _notebookExecutionStateService;
15
- this._userActivity = _userActivity;
16
- this._activityMutex = this._register(( new MutableDisposable()));
17
- this._register(_notebookEditor.onDidScroll(() => this._update()));
18
- this._register(_notebookExecutionStateService.onDidChangeExecution(e => {
19
- if (( e.notebook.toString()) !== this._notebookEditor.textModel?.uri.toString()) {
20
- return;
21
- }
22
- this._update();
23
- }));
24
- this._register(_notebookEditor.onDidChangeModel(() => this._update()));
25
- }
26
- _update() {
27
- if (!this._notebookEditor.hasModel()) {
28
- return;
29
- }
30
- const cellExecutions = this._notebookExecutionStateService.getCellExecutionsForNotebook(this._notebookEditor.textModel?.uri)
31
- .filter(exe => exe.state === NotebookCellExecutionState.Executing);
32
- const notebookExecution = this._notebookExecutionStateService.getExecution(this._notebookEditor.textModel?.uri);
33
- const executionIsVisible = (exe) => {
34
- for (const range of this._notebookEditor.visibleRanges) {
35
- for (const cell of this._notebookEditor.getCellsInRange(range)) {
36
- if (cell.handle === exe.cellHandle) {
37
- const top = this._notebookEditor.getAbsoluteTopOfElement(cell);
38
- if (this._notebookEditor.scrollTop < top + 5) {
39
- return true;
40
- }
41
- }
42
- }
43
- }
44
- return false;
45
- };
46
- const hasAnyExecution = cellExecutions.length || notebookExecution;
47
- if (hasAnyExecution && !this._activityMutex.value) {
48
- this._activityMutex.value = this._userActivity.markActive();
49
- }
50
- else if (!hasAnyExecution && this._activityMutex.value) {
51
- this._activityMutex.clear();
52
- }
53
- const shouldShowEditorProgressbarForCellExecutions = cellExecutions.length && !( cellExecutions.some(executionIsVisible)) && !( cellExecutions.some(e => e.isPaused));
54
- const showEditorProgressBar = !!notebookExecution || shouldShowEditorProgressbarForCellExecutions;
55
- if (showEditorProgressBar) {
56
- this._notebookEditor.showProgress();
57
- }
58
- else {
59
- this._notebookEditor.hideProgress();
60
- }
61
- }
62
- };
63
- ExecutionEditorProgressController.__decorator = ( __decorate([
64
- throttle(100)
65
- ], ExecutionEditorProgressController.prototype, "_update", null));
66
- ExecutionEditorProgressController = ( __decorate([
67
- ( __param(1, INotebookExecutionStateService)),
68
- ( __param(2, IUserActivityService))
69
- ], ExecutionEditorProgressController));
70
- registerNotebookContribution(ExecutionEditorProgressController.id, ExecutionEditorProgressController);
71
-
72
- export { ExecutionEditorProgressController };
@@ -1,6 +0,0 @@
1
- import n from '../../../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
-
3
- var css = ".monaco-workbench .notebookOverlay.notebook-editor.find-hide-transition,.monaco-workbench .notebookOverlay.notebook-editor.find-show-transition{overflow-y:hidden}.monaco-workbench .notebookOverlay.notebook-editor .simple-fr-find-part-wrapper .matchesCount{box-sizing:border-box;overflow:hidden;padding:0 2px;text-align:center;text-overflow:ellipsis;white-space:nowrap}";
4
- n(css,{});
5
-
6
- export { css, css as default };