@codingame/monaco-vscode-notebook-service-override 25.1.2 → 26.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 (94) hide show
  1. package/index.js +2 -2
  2. package/package.json +3 -3
  3. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +112 -94
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +95 -96
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +28 -19
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +15 -9
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +22 -17
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +25 -10
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +37 -44
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +211 -115
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +16 -18
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +5 -8
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +57 -49
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +24 -11
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +78 -76
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +14 -15
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +43 -28
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +65 -34
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +19 -16
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +6 -10
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +15 -17
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +28 -16
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +211 -170
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +11 -11
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +158 -156
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +109 -105
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -1
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +28 -22
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +26 -17
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +23 -16
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +72 -40
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +233 -186
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +22 -18
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +239 -151
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +85 -86
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +25 -11
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +13 -10
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +8 -5
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +218 -196
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +258 -255
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +106 -98
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +63 -49
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +55 -64
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +21 -25
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +149 -129
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +286 -0
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +82 -0
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +452 -363
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +44 -61
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +9 -11
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +203 -207
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js +148 -104
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js +19 -11
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/replEditorAccessibleView.js +9 -11
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +9 -6
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +34 -22
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +29 -18
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +70 -52
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +31 -19
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +78 -41
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +37 -27
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +9 -6
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +8 -7
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +214 -119
  67. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +38 -36
  68. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSource.js +24 -25
  69. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.js +2 -6
  70. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +26 -15
  71. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +35 -15
  72. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +468 -258
  73. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
  74. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +113 -0
  75. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +74 -58
  76. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +1 -1
  77. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +7 -10
  78. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookCellMatching.js +72 -16
  79. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.js +70 -51
  80. package/vscode/src/vs/workbench/contrib/replNotebook/browser/repl.contribution.js +195 -149
  81. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorAccessibilityHelp.js +60 -81
  82. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +7 -12
  83. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +104 -66
  84. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +115 -77
  85. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +42 -26
  86. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +19 -12
  87. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +0 -7
  88. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -198
  89. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +0 -8
  90. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +0 -333
  91. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.d.ts +0 -2
  92. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -7
  93. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +0 -13
  94. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -261
@@ -15,7 +15,9 @@ import { NotebookExecutionType } from '@codingame/monaco-vscode-api/vscode/vs/wo
15
15
  import { INotebookExecutionStateService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service';
16
16
 
17
17
  let PausedCellDecorationContribution = class PausedCellDecorationContribution extends Disposable {
18
- static { this.id = 'workbench.notebook.debug.pausedCellDecorations'; }
18
+ static {
19
+ this.id = "workbench.notebook.debug.pausedCellDecorations";
20
+ }
19
21
  constructor(_notebookEditor, _debugService, _notebookExecutionStateService) {
20
22
  super();
21
23
  this._notebookEditor = _notebookEditor;
@@ -25,8 +27,12 @@ let PausedCellDecorationContribution = class PausedCellDecorationContribution ex
25
27
  this._currentOtherDecorations = [];
26
28
  this._executingCellDecorations = [];
27
29
  const delayer = this._register(( new Delayer(200)));
28
- this._register(_debugService.getModel().onDidChangeCallStack(() => this.updateExecutionDecorations()));
29
- this._register(_debugService.getViewModel().onDidFocusStackFrame(() => this.updateExecutionDecorations()));
30
+ this._register(
31
+ _debugService.getModel().onDidChangeCallStack(() => this.updateExecutionDecorations())
32
+ );
33
+ this._register(
34
+ _debugService.getViewModel().onDidFocusStackFrame(() => this.updateExecutionDecorations())
35
+ );
30
36
  this._register(_notebookExecutionStateService.onDidChangeExecution(e => {
31
37
  if (e.type === NotebookExecutionType.cell && this._notebookEditor.textModel && e.affectsNotebook(this._notebookEditor.textModel.uri)) {
32
38
  delayer.trigger(() => this.updateExecutionDecorations());
@@ -34,15 +40,16 @@ let PausedCellDecorationContribution = class PausedCellDecorationContribution ex
34
40
  }));
35
41
  }
36
42
  updateExecutionDecorations() {
37
- const exes = this._notebookEditor.textModel ?
38
- this._notebookExecutionStateService.getCellExecutionsByHandleForNotebook(this._notebookEditor.textModel.uri)
39
- : undefined;
43
+ const exes = this._notebookEditor.textModel ? this._notebookExecutionStateService.getCellExecutionsByHandleForNotebook(this._notebookEditor.textModel.uri) : undefined;
40
44
  const topFrameCellsAndRanges = [];
41
45
  let focusedFrameCellAndRange = undefined;
42
- const getNotebookCellAndRange = (sf) => {
46
+ const getNotebookCellAndRange = sf => {
43
47
  const parsed = CellUri.parse(sf.source.uri);
44
48
  if (parsed && ( parsed.notebook.toString()) === this._notebookEditor.textModel?.uri.toString()) {
45
- return { handle: parsed.handle, range: sf.range };
49
+ return {
50
+ handle: parsed.handle,
51
+ range: sf.range
52
+ };
46
53
  }
47
54
  return undefined;
48
55
  };
@@ -61,25 +68,25 @@ let PausedCellDecorationContribution = class PausedCellDecorationContribution ex
61
68
  const focusedFrame = this._debugService.getViewModel().focusedStackFrame;
62
69
  if (focusedFrame && focusedFrame.thread.stopped) {
63
70
  const thisFocusedFrameCellAndRange = getNotebookCellAndRange(focusedFrame);
64
- if (thisFocusedFrameCellAndRange &&
65
- !( topFrameCellsAndRanges.some(
66
- topFrame => topFrame.handle === thisFocusedFrameCellAndRange?.handle && Range.equalsRange(topFrame.range, thisFocusedFrameCellAndRange?.range)
67
- ))) {
71
+ if (thisFocusedFrameCellAndRange && !( topFrameCellsAndRanges.some(
72
+ topFrame => topFrame.handle === thisFocusedFrameCellAndRange?.handle && Range.equalsRange(topFrame.range, thisFocusedFrameCellAndRange?.range)
73
+ ))) {
68
74
  focusedFrameCellAndRange = thisFocusedFrameCellAndRange;
69
75
  exes?.delete(focusedFrameCellAndRange.handle);
70
76
  }
71
77
  }
72
78
  this.setTopFrameDecoration(topFrameCellsAndRanges);
73
79
  this.setFocusedFrameDecoration(focusedFrameCellAndRange);
74
- const exeHandles = exes ?
75
- ( Array.from(exes.entries())
76
- .filter(([_, exe]) => exe.state === NotebookCellExecutionState.Executing)
77
- .map(([handle]) => handle))
78
- : [];
80
+ const exeHandles = exes ? ( Array.from(exes.entries()).filter(([_, exe]) => exe.state === NotebookCellExecutionState.Executing).map(([handle]) => handle)) : [];
79
81
  this.setExecutingCellDecorations(exeHandles);
80
82
  }
81
83
  setTopFrameDecoration(handlesAndRanges) {
82
- const newDecorations = ( handlesAndRanges.map(({ handle, range }) => {
84
+ const newDecorations = ( handlesAndRanges.map((
85
+ {
86
+ handle,
87
+ range
88
+ }
89
+ ) => {
83
90
  const options = {
84
91
  overviewRuler: {
85
92
  color: topStackFrameColor,
@@ -107,9 +114,9 @@ let PausedCellDecorationContribution = class PausedCellDecorationContribution ex
107
114
  }
108
115
  };
109
116
  newDecorations = [{
110
- handle: focusedFrameCellAndRange.handle,
111
- options
112
- }];
117
+ handle: focusedFrameCellAndRange.handle,
118
+ options
119
+ }];
113
120
  }
114
121
  this._currentOtherDecorations = this._notebookEditor.deltaCellDecorations(this._currentOtherDecorations, newDecorations);
115
122
  }
@@ -131,48 +138,49 @@ let PausedCellDecorationContribution = class PausedCellDecorationContribution ex
131
138
  this._executingCellDecorations = this._notebookEditor.deltaCellDecorations(this._executingCellDecorations, newDecorations);
132
139
  }
133
140
  };
134
- PausedCellDecorationContribution = ( __decorate([
135
- ( __param(1, IDebugService)),
136
- ( __param(2, INotebookExecutionStateService))
137
- ], PausedCellDecorationContribution));
141
+ PausedCellDecorationContribution = ( __decorate([( __param(1, IDebugService)), ( __param(2, INotebookExecutionStateService))], PausedCellDecorationContribution));
138
142
  registerNotebookContribution(PausedCellDecorationContribution.id, PausedCellDecorationContribution);
139
143
  let NotebookBreakpointDecorations = class NotebookBreakpointDecorations extends Disposable {
140
- static { this.id = 'workbench.notebook.debug.notebookBreakpointDecorations'; }
144
+ static {
145
+ this.id = "workbench.notebook.debug.notebookBreakpointDecorations";
146
+ }
141
147
  constructor(_notebookEditor, _debugService, _configService) {
142
148
  super();
143
149
  this._notebookEditor = _notebookEditor;
144
150
  this._debugService = _debugService;
145
151
  this._configService = _configService;
146
152
  this._currentDecorations = [];
147
- this._register(_debugService.getModel().onDidChangeBreakpoints(() => this.updateDecorations()));
148
- this._register(_configService.onDidChangeConfiguration(e => e.affectsConfiguration('debug.showBreakpointsInOverviewRuler') && this.updateDecorations()));
153
+ this._register(
154
+ _debugService.getModel().onDidChangeBreakpoints(() => this.updateDecorations())
155
+ );
156
+ this._register(_configService.onDidChangeConfiguration(
157
+ e => e.affectsConfiguration("debug.showBreakpointsInOverviewRuler") && this.updateDecorations()
158
+ ));
149
159
  }
150
160
  updateDecorations() {
151
- const enabled = this._configService.getValue('debug.showBreakpointsInOverviewRuler');
152
- const newDecorations = enabled ?
153
- ( this._debugService.getModel().getBreakpoints().map(breakpoint => {
154
- const parsed = CellUri.parse(breakpoint.uri);
155
- if (!parsed || ( parsed.notebook.toString()) !== ( this._notebookEditor.textModel.uri.toString())) {
156
- return null;
161
+ const enabled = this._configService.getValue("debug.showBreakpointsInOverviewRuler");
162
+ const newDecorations = enabled ? ( this._debugService.getModel().getBreakpoints().map(breakpoint => {
163
+ const parsed = CellUri.parse(breakpoint.uri);
164
+ if (!parsed || ( parsed.notebook.toString()) !== ( this._notebookEditor.textModel.uri.toString())) {
165
+ return null;
166
+ }
167
+ const options = {
168
+ overviewRuler: {
169
+ color: debugIconBreakpointForeground,
170
+ includeOutput: false,
171
+ modelRanges: [( new Range(breakpoint.lineNumber, 0, breakpoint.lineNumber, 0))],
172
+ position: NotebookOverviewRulerLane.Left
157
173
  }
158
- const options = {
159
- overviewRuler: {
160
- color: debugIconBreakpointForeground,
161
- includeOutput: false,
162
- modelRanges: [( new Range(breakpoint.lineNumber, 0, breakpoint.lineNumber, 0))],
163
- position: NotebookOverviewRulerLane.Left
164
- }
165
- };
166
- return { handle: parsed.handle, options };
167
- })).filter(x => !!x)
168
- : [];
174
+ };
175
+ return {
176
+ handle: parsed.handle,
177
+ options
178
+ };
179
+ })).filter(x => !!x) : [];
169
180
  this._currentDecorations = this._notebookEditor.deltaCellDecorations(this._currentDecorations, newDecorations);
170
181
  }
171
182
  };
172
- NotebookBreakpointDecorations = ( __decorate([
173
- ( __param(1, IDebugService)),
174
- ( __param(2, IConfigurationService))
175
- ], NotebookBreakpointDecorations));
183
+ NotebookBreakpointDecorations = ( __decorate([( __param(1, IDebugService)), ( __param(2, IConfigurationService))], NotebookBreakpointDecorations));
176
184
  registerNotebookContribution(NotebookBreakpointDecorations.id, NotebookBreakpointDecorations);
177
185
 
178
186
  export { NotebookBreakpointDecorations, PausedCellDecorationContribution };
@@ -11,9 +11,24 @@ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench
11
11
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
12
12
 
13
13
  let EmptyCellEditorHintContribution = class EmptyCellEditorHintContribution extends EmptyTextEditorHintContribution {
14
- static { this.CONTRIB_ID = 'notebook.editor.contrib.emptyCellEditorHint'; }
15
- constructor(editor, _editorService, configurationService, inlineChatSessionService, chatAgentService, instantiationService) {
16
- super(editor, configurationService, inlineChatSessionService, chatAgentService, instantiationService);
14
+ static {
15
+ this.CONTRIB_ID = "notebook.editor.contrib.emptyCellEditorHint";
16
+ }
17
+ constructor(
18
+ editor,
19
+ _editorService,
20
+ configurationService,
21
+ inlineChatSessionService,
22
+ chatAgentService,
23
+ instantiationService
24
+ ) {
25
+ super(
26
+ editor,
27
+ configurationService,
28
+ inlineChatSessionService,
29
+ chatAgentService,
30
+ instantiationService
31
+ );
17
32
  this._editorService = _editorService;
18
33
  const activeEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
19
34
  if (!activeEditor) {
@@ -45,13 +60,11 @@ let EmptyCellEditorHintContribution = class EmptyCellEditorHintContribution exte
45
60
  return true;
46
61
  }
47
62
  };
48
- EmptyCellEditorHintContribution = ( __decorate([
49
- ( __param(1, IEditorService)),
50
- ( __param(2, IConfigurationService)),
51
- ( __param(3, IInlineChatSessionService)),
52
- ( __param(4, IChatAgentService)),
53
- ( __param(5, IInstantiationService))
54
- ], EmptyCellEditorHintContribution));
55
- registerEditorContribution(EmptyCellEditorHintContribution.CONTRIB_ID, EmptyCellEditorHintContribution, EditorContributionInstantiation.Eager);
63
+ EmptyCellEditorHintContribution = ( __decorate([( __param(1, IEditorService)), ( __param(2, IConfigurationService)), ( __param(3, IInlineChatSessionService)), ( __param(4, IChatAgentService)), ( __param(5, IInstantiationService))], EmptyCellEditorHintContribution));
64
+ registerEditorContribution(
65
+ EmptyCellEditorHintContribution.CONTRIB_ID,
66
+ EmptyCellEditorHintContribution,
67
+ EditorContributionInstantiation.Eager
68
+ );
56
69
 
57
70
  export { EmptyCellEditorHintContribution };
@@ -21,7 +21,13 @@ import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/wor
21
21
  import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
22
22
 
23
23
  let ImplictKernelSelector = class ImplictKernelSelector {
24
- constructor(notebook, suggested, notebookKernelService, languageFeaturesService, logService) {
24
+ constructor(
25
+ notebook,
26
+ suggested,
27
+ notebookKernelService,
28
+ languageFeaturesService,
29
+ logService
30
+ ) {
25
31
  const disposables = ( new DisposableStore());
26
32
  this.dispose = disposables.dispose.bind(disposables);
27
33
  const selectKernel = () => {
@@ -31,32 +37,36 @@ let ImplictKernelSelector = class ImplictKernelSelector {
31
37
  disposables.add(notebook.onDidChangeContent(e => {
32
38
  for (const event of e.rawEvents) {
33
39
  switch (event.kind) {
34
- case NotebookCellsChangeType.ChangeCellContent:
35
- case NotebookCellsChangeType.ModelChange:
36
- case NotebookCellsChangeType.Move:
37
- case NotebookCellsChangeType.ChangeCellLanguage:
38
- logService.trace('IMPLICIT kernel selection because of change event', event.kind);
39
- selectKernel();
40
- break;
40
+ case NotebookCellsChangeType.ChangeCellContent:
41
+ case NotebookCellsChangeType.ModelChange:
42
+ case NotebookCellsChangeType.Move:
43
+ case NotebookCellsChangeType.ChangeCellLanguage:
44
+ logService.trace("IMPLICIT kernel selection because of change event", event.kind);
45
+ selectKernel();
46
+ break;
41
47
  }
42
48
  }
43
49
  }));
44
- disposables.add(languageFeaturesService.hoverProvider.register({ scheme: Schemas.vscodeNotebookCell, pattern: notebook.uri.path }, {
50
+ disposables.add(languageFeaturesService.hoverProvider.register({
51
+ scheme: Schemas.vscodeNotebookCell,
52
+ pattern: notebook.uri.path
53
+ }, {
45
54
  provideHover() {
46
- logService.trace('IMPLICIT kernel selection because of hover');
55
+ logService.trace("IMPLICIT kernel selection because of hover");
47
56
  selectKernel();
48
57
  return undefined;
49
58
  }
50
59
  }));
51
60
  }
52
61
  };
53
- ImplictKernelSelector = ( __decorate([
54
- ( __param(2, INotebookKernelService)),
55
- ( __param(3, ILanguageFeaturesService)),
56
- ( __param(4, ILogService))
57
- ], ImplictKernelSelector));
62
+ ImplictKernelSelector = ( __decorate([( __param(2, INotebookKernelService)), ( __param(3, ILanguageFeaturesService)), ( __param(4, ILogService))], ImplictKernelSelector));
58
63
  let KernelStatus = class KernelStatus extends Disposable {
59
- constructor(_editorService, _statusbarService, _notebookKernelService, _instantiationService) {
64
+ constructor(
65
+ _editorService,
66
+ _statusbarService,
67
+ _notebookKernelService,
68
+ _instantiationService
69
+ ) {
60
70
  super();
61
71
  this._editorService = _editorService;
62
72
  this._statusbarService = _statusbarService;
@@ -82,8 +92,7 @@ let KernelStatus = class KernelStatus extends Disposable {
82
92
  const notebook = activeEditor.textModel;
83
93
  if (notebook) {
84
94
  this._showKernelStatus(notebook);
85
- }
86
- else {
95
+ } else {
87
96
  this._kernelInfoElement.clear();
88
97
  }
89
98
  };
@@ -96,47 +105,45 @@ let KernelStatus = class KernelStatus extends Disposable {
96
105
  }
97
106
  _showKernelStatus(notebook) {
98
107
  this._kernelInfoElement.clear();
99
- const { selected, suggestions, all } = this._notebookKernelService.getMatchingKernel(notebook);
100
- const suggested = (suggestions.length === 1 ? suggestions[0] : undefined)
101
- ?? (all.length === 1) ? all[0] : undefined;
108
+ const {
109
+ selected,
110
+ suggestions,
111
+ all
112
+ } = this._notebookKernelService.getMatchingKernel(notebook);
113
+ const suggested = (suggestions.length === 1 ? suggestions[0] : undefined) ?? (all.length === 1) ? all[0] : undefined;
102
114
  let isSuggested = false;
103
115
  if (all.length === 0) {
104
116
  return;
105
- }
106
- else if (selected || suggested) {
117
+ } else if (selected || suggested) {
107
118
  let kernel = selected;
108
119
  if (!kernel) {
109
120
  kernel = suggested;
110
121
  isSuggested = true;
111
- this._kernelInfoElement.add(this._instantiationService.createInstance(ImplictKernelSelector, notebook, kernel));
122
+ this._kernelInfoElement.add(
123
+ this._instantiationService.createInstance(ImplictKernelSelector, notebook, kernel)
124
+ );
112
125
  }
113
126
  const tooltip = kernel.description ?? kernel.detail ?? kernel.label;
114
127
  this._kernelInfoElement.add(this._statusbarService.addEntry({
115
- name: ( localize(9260, "Notebook Kernel Info")),
128
+ name: ( localize(9580, "Notebook Kernel Info")),
116
129
  text: `$(notebook-kernel-select) ${kernel.label}`,
117
130
  ariaLabel: kernel.label,
118
- tooltip: isSuggested ? ( localize(9261, "{0} (suggestion)", tooltip)) : tooltip,
119
- command: SELECT_KERNEL_ID,
131
+ tooltip: isSuggested ? ( localize(9581, "{0} (suggestion)", tooltip)) : tooltip,
132
+ command: SELECT_KERNEL_ID
120
133
  }, SELECT_KERNEL_ID, StatusbarAlignment.RIGHT, 10));
121
134
  this._kernelInfoElement.add(kernel.onDidChange(() => this._showKernelStatus(notebook)));
122
- }
123
- else {
135
+ } else {
124
136
  this._kernelInfoElement.add(this._statusbarService.addEntry({
125
- name: ( localize(9262, "Notebook Kernel Selection")),
126
- text: ( localize(9263, "Select Kernel")),
127
- ariaLabel: ( localize(9263, "Select Kernel")),
137
+ name: ( localize(9582, "Notebook Kernel Selection")),
138
+ text: ( localize(9583, "Select Kernel")),
139
+ ariaLabel: ( localize(9583, "Select Kernel")),
128
140
  command: SELECT_KERNEL_ID,
129
- kind: 'prominent'
141
+ kind: "prominent"
130
142
  }, SELECT_KERNEL_ID, StatusbarAlignment.RIGHT, 10));
131
143
  }
132
144
  }
133
145
  };
134
- KernelStatus = ( __decorate([
135
- ( __param(0, IEditorService)),
136
- ( __param(1, IStatusbarService)),
137
- ( __param(2, INotebookKernelService)),
138
- ( __param(3, IInstantiationService))
139
- ], KernelStatus));
146
+ KernelStatus = ( __decorate([( __param(0, IEditorService)), ( __param(1, IStatusbarService)), ( __param(2, INotebookKernelService)), ( __param(3, IInstantiationService))], KernelStatus));
140
147
  let ActiveCellStatus = class ActiveCellStatus extends Disposable {
141
148
  constructor(_editorService, _statusbarService) {
142
149
  super();
@@ -154,8 +161,7 @@ let ActiveCellStatus = class ActiveCellStatus extends Disposable {
154
161
  this._itemDisposables.add(activeEditor.onDidChangeSelection(() => this._show(activeEditor)));
155
162
  this._itemDisposables.add(activeEditor.onDidChangeActiveCell(() => this._show(activeEditor)));
156
163
  this._show(activeEditor);
157
- }
158
- else {
164
+ } else {
159
165
  this._accessor.clear();
160
166
  }
161
167
  }
@@ -170,15 +176,14 @@ let ActiveCellStatus = class ActiveCellStatus extends Disposable {
170
176
  return;
171
177
  }
172
178
  const entry = {
173
- name: ( localize(9264, "Notebook Editor Selections")),
179
+ name: ( localize(9584, "Notebook Editor Selections")),
174
180
  text: newText,
175
181
  ariaLabel: newText,
176
182
  command: CENTER_ACTIVE_CELL
177
183
  };
178
184
  if (!this._accessor.value) {
179
- this._accessor.value = this._statusbarService.addEntry(entry, 'notebook.activeCellStatus', StatusbarAlignment.RIGHT, 100);
180
- }
181
- else {
185
+ this._accessor.value = this._statusbarService.addEntry(entry, "notebook.activeCellStatus", StatusbarAlignment.RIGHT, 100);
186
+ } else {
182
187
  this._accessor.value.update(entry);
183
188
  }
184
189
  }
@@ -193,17 +198,14 @@ let ActiveCellStatus = class ActiveCellStatus extends Disposable {
193
198
  const idxFocused = editor.getCellIndex(activeCell) + 1;
194
199
  const numSelected = editor.getSelections().reduce((prev, range) => prev + (range.end - range.start), 0);
195
200
  const totalCells = editor.getLength();
196
- return numSelected > 1 ?
197
- ( localize(9265, "Cell {0} ({1} selected)", idxFocused, numSelected)) :
198
- ( localize(9266, "Cell {0} of {1}", idxFocused, totalCells));
201
+ return numSelected > 1 ? ( localize(9585, "Cell {0} ({1} selected)", idxFocused, numSelected)) : ( localize(9586, "Cell {0} of {1}", idxFocused, totalCells));
199
202
  }
200
203
  };
201
- ActiveCellStatus = ( __decorate([
202
- ( __param(0, IEditorService)),
203
- ( __param(1, IStatusbarService))
204
- ], ActiveCellStatus));
204
+ ActiveCellStatus = ( __decorate([( __param(0, IEditorService)), ( __param(1, IStatusbarService))], ActiveCellStatus));
205
205
  let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposable {
206
- static { this.ID = 'selectNotebookIndentation'; }
206
+ static {
207
+ this.ID = "selectNotebookIndentation";
208
+ }
207
209
  constructor(_editorService, _statusbarService, _configurationService) {
208
210
  super();
209
211
  this._editorService = _editorService;
@@ -213,7 +215,7 @@ let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposab
213
215
  this._accessor = this._register(( new MutableDisposable()));
214
216
  this._register(this._editorService.onDidActiveEditorChange(() => this._update()));
215
217
  this._register(this._configurationService.onDidChangeConfiguration(e => {
216
- if (e.affectsConfiguration('editor') || e.affectsConfiguration('notebook')) {
218
+ if (e.affectsConfiguration("editor") || e.affectsConfiguration("notebook")) {
217
219
  this._update();
218
220
  }
219
221
  }));
@@ -228,8 +230,7 @@ let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposab
228
230
  this._accessor.clear();
229
231
  this._show(activeEditor);
230
232
  }));
231
- }
232
- else {
233
+ } else {
233
234
  this._accessor.clear();
234
235
  }
235
236
  }
@@ -244,10 +245,10 @@ let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposab
244
245
  return;
245
246
  }
246
247
  const cellEditorOverridesRaw = editor.notebookOptions.getDisplayOptions().editorOptionsCustomizations;
247
- const indentSize = cellEditorOverridesRaw?.['editor.indentSize'] ?? cellOptions?.indentSize;
248
- const insertSpaces = cellEditorOverridesRaw?.['editor.insertSpaces'] ?? cellOptions?.insertSpaces;
249
- const tabSize = cellEditorOverridesRaw?.['editor.tabSize'] ?? cellOptions?.tabSize;
250
- const width = typeof indentSize === 'number' ? indentSize : tabSize;
248
+ const indentSize = cellEditorOverridesRaw?.["editor.indentSize"] ?? cellOptions?.indentSize;
249
+ const insertSpaces = cellEditorOverridesRaw?.["editor.insertSpaces"] ?? cellOptions?.insertSpaces;
250
+ const tabSize = cellEditorOverridesRaw?.["editor.tabSize"] ?? cellOptions?.tabSize;
251
+ const width = typeof indentSize === "number" ? indentSize : tabSize;
251
252
  const message = insertSpaces ? `Spaces: ${width}` : `Tab Size: ${width}`;
252
253
  const newText = message;
253
254
  if (!newText) {
@@ -255,34 +256,33 @@ let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposab
255
256
  return;
256
257
  }
257
258
  const entry = {
258
- name: ( localize(9267, "Notebook Indentation")),
259
+ name: ( localize(9587, "Notebook Indentation")),
259
260
  text: newText,
260
261
  ariaLabel: newText,
261
- tooltip: ( localize(9268, "Select Indentation")),
262
+ tooltip: ( localize(9588, "Select Indentation")),
262
263
  command: SELECT_NOTEBOOK_INDENTATION_ID
263
264
  };
264
265
  if (!this._accessor.value) {
265
- this._accessor.value = this._statusbarService.addEntry(entry, 'notebook.status.indentation', StatusbarAlignment.RIGHT, 100.4);
266
- }
267
- else {
266
+ this._accessor.value = this._statusbarService.addEntry(entry, "notebook.status.indentation", StatusbarAlignment.RIGHT, 100.4);
267
+ } else {
268
268
  this._accessor.value.update(entry);
269
269
  }
270
270
  }
271
271
  };
272
- NotebookIndentationStatus = ( __decorate([
273
- ( __param(0, IEditorService)),
274
- ( __param(1, IStatusbarService)),
275
- ( __param(2, IConfigurationService))
276
- ], NotebookIndentationStatus));
272
+ NotebookIndentationStatus = ( __decorate([( __param(0, IEditorService)), ( __param(1, IStatusbarService)), ( __param(2, IConfigurationService))], NotebookIndentationStatus));
277
273
  let NotebookEditorStatusContribution = class NotebookEditorStatusContribution extends Disposable {
278
- static { this.ID = 'notebook.contrib.editorStatus'; }
274
+ static {
275
+ this.ID = "notebook.contrib.editorStatus";
276
+ }
279
277
  constructor(editorGroupService) {
280
278
  super();
281
279
  this.editorGroupService = editorGroupService;
282
280
  for (const part of editorGroupService.parts) {
283
281
  this.createNotebookStatus(part);
284
282
  }
285
- this._register(editorGroupService.onDidCreateAuxiliaryEditorPart(part => this.createNotebookStatus(part)));
283
+ this._register(
284
+ editorGroupService.onDidCreateAuxiliaryEditorPart(part => this.createNotebookStatus(part))
285
+ );
286
286
  }
287
287
  createNotebookStatus(part) {
288
288
  const disposables = ( new DisposableStore());
@@ -293,7 +293,9 @@ let NotebookEditorStatusContribution = class NotebookEditorStatusContribution ex
293
293
  disposables.add(scopedInstantiationService.createInstance(NotebookIndentationStatus));
294
294
  }
295
295
  };
296
- NotebookEditorStatusContribution = ( __decorate([
297
- ( __param(0, IEditorGroupsService))
298
- ], NotebookEditorStatusContribution));
299
- registerWorkbenchContribution2(NotebookEditorStatusContribution.ID, NotebookEditorStatusContribution, WorkbenchPhase.AfterRestored);
296
+ NotebookEditorStatusContribution = ( __decorate([( __param(0, IEditorGroupsService))], NotebookEditorStatusContribution));
297
+ registerWorkbenchContribution2(
298
+ NotebookEditorStatusContribution.ID,
299
+ NotebookEditorStatusContribution,
300
+ WorkbenchPhase.AfterRestored
301
+ );
@@ -8,7 +8,9 @@ import { INotebookExecutionStateService } from '@codingame/monaco-vscode-api/vsc
8
8
  import { IUserActivityService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userActivity/common/userActivityService.service';
9
9
 
10
10
  let ExecutionEditorProgressController = class ExecutionEditorProgressController extends Disposable {
11
- static { this.id = 'workbench.notebook.executionEditorProgress'; }
11
+ static {
12
+ this.id = "workbench.notebook.executionEditorProgress";
13
+ }
12
14
  constructor(_notebookEditor, _notebookExecutionStateService, _userActivity) {
13
15
  super();
14
16
  this._notebookEditor = _notebookEditor;
@@ -28,10 +30,9 @@ let ExecutionEditorProgressController = class ExecutionEditorProgressController
28
30
  if (!this._notebookEditor.hasModel()) {
29
31
  return;
30
32
  }
31
- const cellExecutions = this._notebookExecutionStateService.getCellExecutionsForNotebook(this._notebookEditor.textModel?.uri)
32
- .filter(exe => exe.state === NotebookCellExecutionState.Executing);
33
+ const cellExecutions = this._notebookExecutionStateService.getCellExecutionsForNotebook(this._notebookEditor.textModel?.uri).filter(exe => exe.state === NotebookCellExecutionState.Executing);
33
34
  const notebookExecution = this._notebookExecutionStateService.getExecution(this._notebookEditor.textModel?.uri);
34
- const executionIsVisible = (exe) => {
35
+ const executionIsVisible = exe => {
35
36
  for (const range of this._notebookEditor.visibleRanges) {
36
37
  for (const cell of this._notebookEditor.getCellsInRange(range)) {
37
38
  if (cell.handle === exe.cellHandle) {
@@ -47,27 +48,25 @@ let ExecutionEditorProgressController = class ExecutionEditorProgressController
47
48
  const hasAnyExecution = cellExecutions.length || notebookExecution;
48
49
  if (hasAnyExecution && !this._activityMutex.value) {
49
50
  this._activityMutex.value = this._userActivity.markActive();
50
- }
51
- else if (!hasAnyExecution && this._activityMutex.value) {
51
+ } else if (!hasAnyExecution && this._activityMutex.value) {
52
52
  this._activityMutex.clear();
53
53
  }
54
54
  const shouldShowEditorProgressbarForCellExecutions = cellExecutions.length && !( cellExecutions.some(executionIsVisible)) && !( cellExecutions.some(e => e.isPaused));
55
55
  const showEditorProgressBar = !!notebookExecution || shouldShowEditorProgressbarForCellExecutions;
56
56
  if (showEditorProgressBar) {
57
57
  this._notebookEditor.showProgress();
58
- }
59
- else {
58
+ } else {
60
59
  this._notebookEditor.hideProgress();
61
60
  }
62
61
  }
63
62
  };
64
- ExecutionEditorProgressController.__decorator = ( __decorate([
65
- throttle(100)
66
- ], ExecutionEditorProgressController.prototype, "_update", null));
67
- ExecutionEditorProgressController = ( __decorate([
68
- ( __param(1, INotebookExecutionStateService)),
69
- ( __param(2, IUserActivityService))
70
- ], ExecutionEditorProgressController));
63
+ ExecutionEditorProgressController.__decorator = ( __decorate(
64
+ [throttle(100)],
65
+ ExecutionEditorProgressController.prototype,
66
+ "_update",
67
+ null
68
+ ));
69
+ ExecutionEditorProgressController = ( __decorate([( __param(1, INotebookExecutionStateService)), ( __param(2, IUserActivityService))], ExecutionEditorProgressController));
71
70
  registerNotebookContribution(ExecutionEditorProgressController.id, ExecutionEditorProgressController);
72
71
 
73
72
  export { ExecutionEditorProgressController };