@codingame/monaco-vscode-notebook-service-override 5.2.0 → 6.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 (53) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +26 -22
  3. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +549 -0
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +133 -0
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +58 -0
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +65 -0
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +6 -5
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +29 -27
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +2 -1
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +2 -1
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +6 -6
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +10 -8
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +27 -18
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +32 -24
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +5 -3
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +2 -1
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +2 -2
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +42 -40
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +77 -57
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +184 -99
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +2 -1
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +2 -2
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +2 -2
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +56 -112
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +31 -0
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +10 -14
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +6 -4
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +3 -2
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +10 -8
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +7 -6
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +6 -4
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +21 -15
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +8 -6
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +6 -5
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +88 -86
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +94 -0
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +73 -0
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +3 -2
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +6 -6
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +7 -6
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +5 -3
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +6 -3
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +44 -17
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +34 -0
  45. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +5 -3
  46. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +67 -53
  47. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +11 -3
  48. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +11 -10
  49. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +3 -2
  50. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +5 -3
  51. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +15 -12
  52. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +4 -2
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -156
@@ -0,0 +1,58 @@
1
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
2
+ import { Range } from 'vscode/vscode/vs/editor/common/core/range';
3
+ import { CodeActionController } from 'vscode/vscode/vs/editor/contrib/codeAction/browser/codeActionController';
4
+ import { CodeActionTriggerSource, CodeActionKind } from 'vscode/vscode/vs/editor/contrib/codeAction/common/types';
5
+ import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
6
+ import { registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
7
+ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
8
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
9
+ import { NotebookCellAction, findTargetCellEditor } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
10
+ import { CodeCellViewModel } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
11
+ import { NOTEBOOK_CELL_FOCUSED, NOTEBOOK_CELL_HAS_ERROR_DIAGNOSTICS, NOTEBOOK_CELL_EDITOR_FOCUSED } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
12
+
13
+ const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions";
14
+ const OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID = 'notebook.cell.openFailureActions';
15
+ registerAction2(class extends NotebookCellAction {
16
+ constructor() {
17
+ super({
18
+ id: OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID,
19
+ title: ( localize2WithPath(_moduleId, 0, "Show Cell Failure Actions")),
20
+ precondition: ( (ContextKeyExpr.and(
21
+ NOTEBOOK_CELL_FOCUSED,
22
+ NOTEBOOK_CELL_HAS_ERROR_DIAGNOSTICS,
23
+ (NOTEBOOK_CELL_EDITOR_FOCUSED.toNegated())
24
+ ))),
25
+ f1: true,
26
+ keybinding: {
27
+ when: ( (ContextKeyExpr.and(
28
+ NOTEBOOK_CELL_FOCUSED,
29
+ NOTEBOOK_CELL_HAS_ERROR_DIAGNOSTICS,
30
+ (NOTEBOOK_CELL_EDITOR_FOCUSED.toNegated())
31
+ ))),
32
+ primary: KeyMod.CtrlCmd | KeyCode.Period,
33
+ weight: KeybindingWeight.WorkbenchContrib
34
+ }
35
+ });
36
+ }
37
+ async runWithContext(accessor, context) {
38
+ if (context.cell instanceof CodeCellViewModel) {
39
+ const error = context.cell.excecutionError.get();
40
+ if (error?.location) {
41
+ const location = Range.lift({
42
+ startLineNumber: error.location.startLineNumber + 1,
43
+ startColumn: error.location.startColumn + 1,
44
+ endLineNumber: error.location.endLineNumber + 1,
45
+ endColumn: error.location.endColumn + 1
46
+ });
47
+ context.notebookEditor.setCellEditorSelection(context.cell, Range.lift(location));
48
+ const editor = findTargetCellEditor(context, context.cell);
49
+ if (editor) {
50
+ const controller = CodeActionController.get(editor);
51
+ controller?.manualTriggerAtCurrentPosition(( localizeWithPath(_moduleId, 1, "No code actions available")), CodeActionTriggerSource.Default, { include: CodeActionKind.QuickFix });
52
+ }
53
+ }
54
+ }
55
+ }
56
+ });
57
+
58
+ export { OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID };
@@ -0,0 +1,65 @@
1
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
+ import 'vscode/vscode/vs/base/common/arrays';
4
+ import 'vscode/vscode/vs/base/common/observableInternal/derived';
5
+ import { autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
6
+ import 'vscode/vscode/vs/base/common/observableInternal/utils';
7
+ import 'vscode/vscode/vs/base/common/cancellation';
8
+ import { localizeWithPath } from 'vscode/vscode/vs/nls';
9
+ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
10
+ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
11
+ import { OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID } from './cellDiagnosticsActions.js';
12
+ import { NotebookStatusBarController } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController';
13
+ import { registerNotebookContribution } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
14
+ import { CodeCellViewModel } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
15
+ import { CellStatusbarAlignment } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
16
+
17
+ const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib";
18
+ let DiagnosticCellStatusBarContrib = class DiagnosticCellStatusBarContrib extends Disposable {
19
+ static { this.id = 'workbench.notebook.statusBar.diagtnostic'; }
20
+ constructor(notebookEditor, instantiationService) {
21
+ super();
22
+ this._register(( (new NotebookStatusBarController(notebookEditor, (vm, cell) => cell instanceof CodeCellViewModel ?
23
+ instantiationService.createInstance(DiagnosticCellStatusBarItem, vm, cell) :
24
+ Disposable.None))));
25
+ }
26
+ };
27
+ DiagnosticCellStatusBarContrib = ( (__decorate([
28
+ ( (__param(1, IInstantiationService)))
29
+ ], DiagnosticCellStatusBarContrib)));
30
+ registerNotebookContribution(DiagnosticCellStatusBarContrib.id, DiagnosticCellStatusBarContrib);
31
+ let DiagnosticCellStatusBarItem = class DiagnosticCellStatusBarItem extends Disposable {
32
+ constructor(_notebookViewModel, cell, keybindingService) {
33
+ super();
34
+ this._notebookViewModel = _notebookViewModel;
35
+ this.cell = cell;
36
+ this.keybindingService = keybindingService;
37
+ this._currentItemIds = [];
38
+ this._register(autorun((reader) => this.updateSparkleItem(reader.readObservable(cell.excecutionError))));
39
+ }
40
+ async updateSparkleItem(error) {
41
+ let item;
42
+ if (error?.location) {
43
+ const keybinding = this.keybindingService.lookupKeybinding(OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID)?.getLabel();
44
+ const tooltip = ( localizeWithPath(_moduleId, 0, "Quick Actions {0}", `(${keybinding})`));
45
+ item = {
46
+ text: `$(sparkle)`,
47
+ tooltip,
48
+ alignment: CellStatusbarAlignment.Left,
49
+ command: OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID,
50
+ priority: Number.MAX_SAFE_INTEGER - 1
51
+ };
52
+ }
53
+ const items = item ? [item] : [];
54
+ this._currentItemIds = this._notebookViewModel.deltaCellStatusBarItems(this._currentItemIds, [{ handle: this.cell.handle, items }]);
55
+ }
56
+ dispose() {
57
+ super.dispose();
58
+ this._notebookViewModel.deltaCellStatusBarItems(this._currentItemIds, [{ handle: this.cell.handle, items: [] }]);
59
+ }
60
+ };
61
+ DiagnosticCellStatusBarItem = ( (__decorate([
62
+ ( (__param(2, IKeybindingService)))
63
+ ], DiagnosticCellStatusBarItem)));
64
+
65
+ export { DiagnosticCellStatusBarContrib };
@@ -10,10 +10,11 @@ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
10
10
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
11
11
  import { CHANGE_CELL_LANGUAGE, DETECT_CELL_LANGUAGE } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
12
12
  import { INotebookCellStatusBarService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService.service';
13
- import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
13
+ import { CellKind, CellStatusbarAlignment } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
14
14
  import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
15
15
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
16
16
  import { ILanguageDetectionService } from 'vscode/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.service';
17
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
17
18
 
18
19
  const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders";
19
20
  let CellStatusBarLanguagePickerProvider = class CellStatusBarLanguagePickerProvider {
@@ -49,7 +50,7 @@ let CellStatusBarLanguagePickerProvider = class CellStatusBarLanguagePickerProvi
49
50
  text: `$(dialog-warning)`,
50
51
  command: { id: 'workbench.extensions.search', arguments: [`@tag:${cell.language}`], title: 'Search Extensions' },
51
52
  tooltip: searchTooltip,
52
- alignment: 2 ,
53
+ alignment: CellStatusbarAlignment.Right,
53
54
  priority: -Number.MAX_SAFE_INTEGER + 1
54
55
  });
55
56
  }
@@ -58,7 +59,7 @@ let CellStatusBarLanguagePickerProvider = class CellStatusBarLanguagePickerProvi
58
59
  text: displayLanguage,
59
60
  command: CHANGE_CELL_LANGUAGE,
60
61
  tooltip: ( localizeWithPath(_moduleId, 1, "Select Cell Language Mode")),
61
- alignment: 2 ,
62
+ alignment: CellStatusbarAlignment.Right,
62
63
  priority: -Number.MAX_SAFE_INTEGER
63
64
  });
64
65
  return {
@@ -131,7 +132,7 @@ let CellStatusBarLanguageDetectionProvider = class CellStatusBarLanguageDetectio
131
132
  text: '$(lightbulb-autofix)',
132
133
  command: DETECT_CELL_LANGUAGE,
133
134
  tooltip,
134
- alignment: 2 ,
135
+ alignment: CellStatusbarAlignment.Right,
135
136
  priority: -Number.MAX_SAFE_INTEGER + 1
136
137
  });
137
138
  }
@@ -162,4 +163,4 @@ BuiltinCellStatusBarProviders = ( (__decorate([
162
163
  ( (__param(0, IInstantiationService))),
163
164
  ( (__param(1, INotebookCellStatusBarService)))
164
165
  ], BuiltinCellStatusBarProviders)));
165
- ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(BuiltinCellStatusBarProviders, 3 );
166
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(BuiltinCellStatusBarProviders, LifecyclePhase.Restored);
@@ -1,26 +1,28 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
3
3
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
4
+ import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
5
5
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
6
6
  import { NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE, NOTEBOOK_OUTPUT_FOCUSED } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
7
7
  import { getNotebookEditorFromEditorPane, expandCellRangesWithHiddenCells, cellRangeToViewCells } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
8
8
  import { CopyAction, PasteAction, CutAction } from 'vscode/vscode/vs/editor/contrib/clipboard/browser/clipboard';
9
9
  import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService.service';
10
10
  import { cloneNotebookCellTextModel } from 'vscode/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
11
- import { SelectionStateType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
11
+ import { SelectionStateType, CellEditType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
12
12
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
13
13
  import { isNative } from 'vscode/vscode/vs/base/common/platform';
14
14
  import { registerAction2, MenuId, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
15
- import { NotebookCellAction, NotebookAction, NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT, NOTEBOOK_OUTPUT_WEBVIEW_ACTION_WEIGHT } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
15
+ import { NotebookCellAction, CellOverflowToolbarGroups, NotebookAction, NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT, NOTEBOOK_OUTPUT_WEBVIEW_ACTION_WEIGHT } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
16
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
16
17
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
17
18
  import { InputFocusedContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
19
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
18
20
  import { UndoCommand, RedoCommand } from 'vscode/vscode/vs/editor/browser/editorExtensions';
19
21
  import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
20
22
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
21
23
  import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
22
24
  import { showWindowLogActionId } from 'vscode/vscode/vs/workbench/services/log/common/logConstants';
23
- import { getWindow, getActiveElement, isAncestor } from 'vscode/vscode/vs/base/browser/dom';
25
+ import { getWindow, getActiveElement, isHTMLElement, isAncestor } from 'vscode/vscode/vs/base/browser/dom';
24
26
 
25
27
  const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard";
26
28
  let _logging = false;
@@ -109,7 +111,7 @@ function runPasteCells(editor, activeCell, pasteCells) {
109
111
  const newFocusIndex = typeof currCellIndex === 'number' ? currCellIndex + 1 : 0;
110
112
  textModel.applyEdits([
111
113
  {
112
- editType: 1 ,
114
+ editType: CellEditType.Replace,
113
115
  index: newFocusIndex,
114
116
  count: 0,
115
117
  cells: ( (pasteCells.items.map(cell => cloneNotebookCellTextModel(cell))))
@@ -126,7 +128,7 @@ function runPasteCells(editor, activeCell, pasteCells) {
126
128
  }
127
129
  textModel.applyEdits([
128
130
  {
129
- editType: 1 ,
131
+ editType: CellEditType.Replace,
130
132
  index: 0,
131
133
  count: 0,
132
134
  cells: ( (pasteCells.items.map(cell => cloneNotebookCellTextModel(cell))))
@@ -187,7 +189,7 @@ function runCutCells(accessor, editor, targetCell) {
187
189
  selection => (selection.end <= targetCellIndex ? selection : { start: selection.start - 1, end: selection.end - 1 })
188
190
  )));
189
191
  textModel.applyEdits([
190
- { editType: 1 , index: targetCellIndex, count: 1, cells: [] }
192
+ { editType: CellEditType.Replace, index: targetCellIndex, count: 1, cells: [] }
191
193
  ], true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: selections }, () => ({ kind: SelectionStateType.Index, focus: newFocus, selections: newSelections }), undefined, true);
192
194
  notebookService.setToCopy([targetCell.model], false);
193
195
  return true;
@@ -203,7 +205,7 @@ function runCutCells(accessor, editor, targetCell) {
203
205
  selection => (selection.end <= focus.start ? selection : { start: selection.start - 1, end: selection.end - 1 })
204
206
  )));
205
207
  textModel.applyEdits([
206
- { editType: 1 , index: focus.start, count: 1, cells: [] }
208
+ { editType: CellEditType.Replace, index: focus.start, count: 1, cells: [] }
207
209
  ], true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: selections }, () => ({ kind: SelectionStateType.Index, focus: newFocus, selections: newSelections }), undefined, true);
208
210
  notebookService.setToCopy([targetCell.model], false);
209
211
  return true;
@@ -215,7 +217,7 @@ function runCutCells(accessor, editor, targetCell) {
215
217
  }
216
218
  clipboardService.writeText(( (selectedCells.map(cell => cell.getText()))).join('\n'));
217
219
  const edits = ( (selectionRanges.map(
218
- range => ({ editType: 1 , index: range.start, count: range.end - range.start, cells: [] })
220
+ range => ({ editType: CellEditType.Replace, index: range.start, count: range.end - range.start, cells: [] })
219
221
  )));
220
222
  const firstSelectIndex = selectionRanges[0].start;
221
223
  const newFocusedCellIndex = firstSelectIndex < textModel.cells.length - 1
@@ -288,7 +290,7 @@ let NotebookClipboardContribution = class NotebookClipboardContribution extends
288
290
  runCopyAction(accessor) {
289
291
  const loggerService = accessor.get(ILogService);
290
292
  const activeElement = getActiveElement();
291
- if (activeElement instanceof HTMLElement && ['input', 'textarea'].indexOf(activeElement.tagName.toLowerCase()) >= 0) {
293
+ if (isHTMLElement(activeElement) && ['input', 'textarea'].indexOf(activeElement.tagName.toLowerCase()) >= 0) {
292
294
  _log(loggerService, '[NotebookEditor] focus is on input or textarea element, bypass');
293
295
  return false;
294
296
  }
@@ -339,7 +341,7 @@ let NotebookClipboardContribution = class NotebookClipboardContribution extends
339
341
  NotebookClipboardContribution = ( (__decorate([
340
342
  ( (__param(0, IEditorService)))
341
343
  ], NotebookClipboardContribution)));
342
- registerWorkbenchContribution2(NotebookClipboardContribution.ID, NotebookClipboardContribution, 2 );
344
+ registerWorkbenchContribution2(NotebookClipboardContribution.ID, NotebookClipboardContribution, WorkbenchPhase.BlockRestore);
343
345
  const COPY_CELL_COMMAND_ID = 'notebook.cell.copy';
344
346
  const CUT_CELL_COMMAND_ID = 'notebook.cell.cut';
345
347
  const PASTE_CELL_COMMAND_ID = 'notebook.cell.paste';
@@ -352,14 +354,14 @@ registerAction2(class extends NotebookCellAction {
352
354
  menu: {
353
355
  id: MenuId.NotebookCellTitle,
354
356
  when: NOTEBOOK_EDITOR_FOCUSED,
355
- group: "1_copy" ,
357
+ group: CellOverflowToolbarGroups.Copy,
356
358
  order: 2,
357
359
  },
358
360
  keybinding: isNative ? undefined : {
359
- primary: 2048 | 33 ,
360
- win: { primary: 2048 | 33 , secondary: [2048 | 19 ] },
361
+ primary: KeyMod.CtrlCmd | KeyCode.KeyC,
362
+ win: { primary: KeyMod.CtrlCmd | KeyCode.KeyC, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },
361
363
  when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey)))),
362
- weight: 200
364
+ weight: KeybindingWeight.WorkbenchContrib
363
365
  }
364
366
  });
365
367
  }
@@ -375,14 +377,14 @@ registerAction2(class extends NotebookCellAction {
375
377
  menu: {
376
378
  id: MenuId.NotebookCellTitle,
377
379
  when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE))),
378
- group: "1_copy" ,
380
+ group: CellOverflowToolbarGroups.Copy,
379
381
  order: 1,
380
382
  },
381
383
  keybinding: isNative ? undefined : {
382
384
  when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey)))),
383
- primary: 2048 | 54 ,
384
- win: { primary: 2048 | 54 , secondary: [1024 | 20 ] },
385
- weight: 200
385
+ primary: KeyMod.CtrlCmd | KeyCode.KeyX,
386
+ win: { primary: KeyMod.CtrlCmd | KeyCode.KeyX, secondary: [KeyMod.Shift | KeyCode.Delete] },
387
+ weight: KeybindingWeight.WorkbenchContrib
386
388
  }
387
389
  });
388
390
  }
@@ -398,15 +400,15 @@ registerAction2(class extends NotebookAction {
398
400
  menu: {
399
401
  id: MenuId.NotebookCellTitle,
400
402
  when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE))),
401
- group: "1_copy" ,
403
+ group: CellOverflowToolbarGroups.Copy,
402
404
  order: 3,
403
405
  },
404
406
  keybinding: isNative ? undefined : {
405
407
  when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey)))),
406
- primary: 2048 | 52 ,
407
- win: { primary: 2048 | 52 , secondary: [1024 | 19 ] },
408
- linux: { primary: 2048 | 52 , secondary: [1024 | 19 ] },
409
- weight: 100
408
+ primary: KeyMod.CtrlCmd | KeyCode.KeyV,
409
+ win: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },
410
+ linux: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },
411
+ weight: KeybindingWeight.EditorContrib
410
412
  }
411
413
  });
412
414
  }
@@ -429,7 +431,7 @@ registerAction2(class extends NotebookCellAction {
429
431
  title: ( localizeWithPath(_moduleId, 3, "Paste Cell Above")),
430
432
  keybinding: {
431
433
  when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey)))),
432
- primary: 2048 | 1024 | 52 ,
434
+ primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyV,
433
435
  weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
434
436
  },
435
437
  });
@@ -454,7 +456,7 @@ registerAction2(class extends NotebookCellAction {
454
456
  const newFocusIndex = currCellIndex;
455
457
  textModel.applyEdits([
456
458
  {
457
- editType: 1 ,
459
+ editType: CellEditType.Replace,
458
460
  index: currCellIndex,
459
461
  count: 0,
460
462
  cells: ( (pasteCells.items.map(cell => cloneNotebookCellTextModel(cell))))
@@ -489,7 +491,7 @@ registerAction2(class extends NotebookCellAction {
489
491
  id: 'notebook.cell.output.selectAll',
490
492
  title: ( localizeWithPath(_moduleId, 5, "Select All")),
491
493
  keybinding: {
492
- primary: 2048 | 31 ,
494
+ primary: KeyMod.CtrlCmd | KeyCode.KeyA,
493
495
  when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_FOCUSED))),
494
496
  weight: NOTEBOOK_OUTPUT_WEBVIEW_ACTION_WEIGHT
495
497
  }
@@ -10,6 +10,7 @@ import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/cont
10
10
  import { NotebookCellsChangeType, CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
11
11
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
12
12
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
13
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
13
14
 
14
15
  let NotebookBreakpoints = class NotebookBreakpoints extends Disposable {
15
16
  constructor(_debugService, _notebookService, _editorService) {
@@ -103,4 +104,4 @@ NotebookBreakpoints = ( __decorate([
103
104
  ( __param(1, INotebookService)),
104
105
  ( __param(2, IEditorService))
105
106
  ], NotebookBreakpoints));
106
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(NotebookBreakpoints, 3 );
107
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(NotebookBreakpoints, LifecyclePhase.Restored);
@@ -8,6 +8,7 @@ import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/d
8
8
  import { CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
9
9
  import { CellExecutionUpdateType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionService';
10
10
  import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service';
11
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
11
12
 
12
13
  let NotebookCellPausing = class NotebookCellPausing extends Disposable {
13
14
  constructor(_debugService, _notebookExecutionStateService) {
@@ -64,4 +65,4 @@ NotebookCellPausing = ( __decorate([
64
65
  ( __param(0, IDebugService)),
65
66
  ( __param(1, INotebookExecutionStateService))
66
67
  ], NotebookCellPausing));
67
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(NotebookCellPausing, 3 );
68
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(NotebookCellPausing, LifecyclePhase.Restored);
@@ -1,23 +1,23 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
3
- import { registerEditorContribution } from 'vscode/vscode/vs/editor/browser/editorExtensions';
3
+ import { registerEditorContribution, EditorContributionInstantiation } from 'vscode/vscode/vs/editor/browser/editorExtensions';
4
4
  import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
5
5
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
6
6
  import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
7
7
  import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
8
8
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
9
9
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
10
+ import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
10
11
  import { EmptyTextEditorHintContribution } from '../../../../codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js';
11
12
  import { IInlineChatSessionService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service';
12
- import { IInlineChatService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat.service';
13
13
  import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
14
14
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
15
15
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
16
16
 
17
17
  let EmptyCellEditorHintContribution = class EmptyCellEditorHintContribution extends EmptyTextEditorHintContribution {
18
18
  static { this.CONTRIB_ID = 'notebook.editor.contrib.emptyCellEditorHint'; }
19
- constructor(editor, _editorService, editorGroupsService, commandService, configurationService, hoverService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService) {
20
- super(editor, editorGroupsService, commandService, configurationService, hoverService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService);
19
+ constructor(editor, _editorService, editorGroupsService, commandService, configurationService, hoverService, keybindingService, inlineChatSessionService, chatAgentService, telemetryService, productService) {
20
+ super(editor, editorGroupsService, commandService, configurationService, hoverService, keybindingService, inlineChatSessionService, chatAgentService, telemetryService, productService);
21
21
  this._editorService = _editorService;
22
22
  const activeEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
23
23
  if (!activeEditor) {
@@ -60,10 +60,10 @@ EmptyCellEditorHintContribution = ( __decorate([
60
60
  ( __param(5, IHoverService)),
61
61
  ( __param(6, IKeybindingService)),
62
62
  ( __param(7, IInlineChatSessionService)),
63
- ( __param(8, IInlineChatService)),
63
+ ( __param(8, IChatAgentService)),
64
64
  ( __param(9, ITelemetryService)),
65
65
  ( __param(10, IProductService))
66
66
  ], EmptyCellEditorHintContribution));
67
- registerEditorContribution(EmptyCellEditorHintContribution.CONTRIB_ID, EmptyCellEditorHintContribution, 0 );
67
+ registerEditorContribution(EmptyCellEditorHintContribution.CONTRIB_ID, EmptyCellEditorHintContribution, EditorContributionInstantiation.Eager);
68
68
 
69
69
  export { EmptyCellEditorHintContribution };
@@ -7,7 +7,7 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
7
7
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
8
8
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
9
9
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
10
- import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
10
+ import { Extensions, registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
11
11
  import { CENTER_ACTIVE_CELL } from '../navigation/arrow.js';
12
12
  import { SELECT_KERNEL_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
13
13
  import { SELECT_NOTEBOOK_INDENTATION_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/editActions';
@@ -15,6 +15,8 @@ import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/cont
15
15
  import { NotebookCellsChangeType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
16
16
  import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
17
17
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
18
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
19
+ import { StatusbarAlignment } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
18
20
  import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
19
21
 
20
22
  const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar";
@@ -114,7 +116,7 @@ let KernelStatus = class KernelStatus extends Disposable {
114
116
  ariaLabel: kernel.label,
115
117
  tooltip: isSuggested ? ( localizeWithPath(_moduleId, 1, "{0} (suggestion)", tooltip)) : tooltip,
116
118
  command: SELECT_KERNEL_ID,
117
- }, SELECT_KERNEL_ID, 1 , 10));
119
+ }, SELECT_KERNEL_ID, StatusbarAlignment.RIGHT, 10));
118
120
  this._kernelInfoElement.add(kernel.onDidChange(() => this._showKernelStatus(notebook)));
119
121
  }
120
122
  else {
@@ -124,7 +126,7 @@ let KernelStatus = class KernelStatus extends Disposable {
124
126
  ariaLabel: ( localizeWithPath(_moduleId, 3, "Select Kernel")),
125
127
  command: SELECT_KERNEL_ID,
126
128
  kind: 'prominent'
127
- }, SELECT_KERNEL_ID, 1 , 10));
129
+ }, SELECT_KERNEL_ID, StatusbarAlignment.RIGHT, 10));
128
130
  }
129
131
  }
130
132
  };
@@ -134,7 +136,7 @@ KernelStatus = ( (__decorate([
134
136
  ( (__param(2, INotebookKernelService))),
135
137
  ( (__param(3, IInstantiationService)))
136
138
  ], KernelStatus)));
137
- ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(KernelStatus, 3 );
139
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(KernelStatus, LifecyclePhase.Restored);
138
140
  let ActiveCellStatus = class ActiveCellStatus extends Disposable {
139
141
  constructor(_editorService, _statusbarService) {
140
142
  super();
@@ -173,7 +175,7 @@ let ActiveCellStatus = class ActiveCellStatus extends Disposable {
173
175
  command: CENTER_ACTIVE_CELL
174
176
  };
175
177
  if (!this._accessor.value) {
176
- this._accessor.value = this._statusbarService.addEntry(entry, 'notebook.activeCellStatus', 1 , 100);
178
+ this._accessor.value = this._statusbarService.addEntry(entry, 'notebook.activeCellStatus', StatusbarAlignment.RIGHT, 100);
177
179
  }
178
180
  else {
179
181
  this._accessor.value.update(entry);
@@ -199,7 +201,7 @@ ActiveCellStatus = ( (__decorate([
199
201
  ( (__param(0, IEditorService))),
200
202
  ( (__param(1, IStatusbarService)))
201
203
  ], ActiveCellStatus)));
202
- ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(ActiveCellStatus, 3 );
204
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(ActiveCellStatus, LifecyclePhase.Restored);
203
205
  let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposable {
204
206
  static { this.ID = 'selectNotebookIndentation'; }
205
207
  constructor(_editorService, _statusbarService, _configurationService) {
@@ -259,7 +261,7 @@ let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposab
259
261
  command: SELECT_NOTEBOOK_INDENTATION_ID
260
262
  };
261
263
  if (!this._accessor.value) {
262
- this._accessor.value = this._statusbarService.addEntry(entry, 'notebook.status.indentation', 1 , 100.4);
264
+ this._accessor.value = this._statusbarService.addEntry(entry, 'notebook.status.indentation', StatusbarAlignment.RIGHT, 100.4);
263
265
  }
264
266
  else {
265
267
  this._accessor.value.update(entry);
@@ -271,6 +273,6 @@ NotebookIndentationStatus = ( (__decorate([
271
273
  ( (__param(1, IStatusbarService))),
272
274
  ( (__param(2, IConfigurationService)))
273
275
  ], NotebookIndentationStatus)));
274
- registerWorkbenchContribution2(NotebookIndentationStatus.ID, NotebookIndentationStatus, 3 );
276
+ registerWorkbenchContribution2(NotebookIndentationStatus.ID, NotebookIndentationStatus, WorkbenchPhase.AfterRestored);
275
277
 
276
278
  export { ActiveCellStatus, KernelStatus, NotebookIndentationStatus };
@@ -1,18 +1,22 @@
1
1
  import './media/notebookFind.css.js';
2
+ import { KeyCode, KeyMod } from 'vscode/vscode/vs/base/common/keyCodes';
2
3
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
3
4
  import { isEqual } from 'vscode/vscode/vs/base/common/resources';
4
5
  import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
5
6
  import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
6
- import { getSelectionSearchString, StartFindAction, StartFindReplaceAction } from 'vscode/vscode/vs/editor/contrib/find/browser/findController';
7
+ import { getSelectionSearchString, StartFindAction, FindStartFocusAction, StartFindReplaceAction } from 'vscode/vscode/vs/editor/contrib/find/browser/findController';
7
8
  import { localize2WithPath } from 'vscode/vscode/vs/nls';
8
9
  import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
9
10
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
11
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
10
12
  import { NotebookFindContrib } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget';
11
13
  import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
12
14
  import { registerNotebookContribution } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
13
15
  import { CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
14
16
  import { NOTEBOOK_EDITOR_FOCUSED, KEYBINDING_CONTEXT_NOTEBOOK_FIND_WIDGET_FOCUSED, NOTEBOOK_IS_ACTIVE_EDITOR, INTERACTIVE_WINDOW_IS_ACTIVE_EDITOR } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
15
17
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
18
+ import { EditorOption } from 'vscode/vscode/vs/editor/common/config/editorOptions';
19
+ import { NotebookMultiCellAction } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
16
20
 
17
21
  const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/find/notebookFind";
18
22
  registerNotebookContribution(NotebookFindContrib.id, NotebookFindContrib);
@@ -23,8 +27,8 @@ registerAction2(class extends Action2 {
23
27
  title: ( localize2WithPath(_moduleId, 0, 'Hide Find in Notebook')),
24
28
  keybinding: {
25
29
  when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, KEYBINDING_CONTEXT_NOTEBOOK_FIND_WIDGET_FOCUSED))),
26
- primary: 9 ,
27
- weight: 200
30
+ primary: KeyCode.Escape,
31
+ weight: KeybindingWeight.WorkbenchContrib
28
32
  }
29
33
  });
30
34
  }
@@ -39,7 +43,7 @@ registerAction2(class extends Action2 {
39
43
  editor.focus();
40
44
  }
41
45
  });
42
- registerAction2(class extends Action2 {
46
+ registerAction2(class extends NotebookMultiCellAction {
43
47
  constructor() {
44
48
  super({
45
49
  id: 'notebook.find',
@@ -50,19 +54,24 @@ registerAction2(class extends Action2 {
50
54
  (ContextKeyExpr.or(NOTEBOOK_IS_ACTIVE_EDITOR, INTERACTIVE_WINDOW_IS_ACTIVE_EDITOR)),
51
55
  (EditorContextKeys.focus.toNegated())
52
56
  ))),
53
- primary: 36 | 2048 ,
54
- weight: 200
57
+ primary: KeyCode.KeyF | KeyMod.CtrlCmd,
58
+ weight: KeybindingWeight.WorkbenchContrib
55
59
  }
56
60
  });
57
61
  }
58
- async run(accessor) {
62
+ async runWithContext(accessor, context) {
59
63
  const editorService = accessor.get(IEditorService);
60
64
  const editor = getNotebookEditorFromEditorPane(editorService.activeEditorPane);
61
65
  if (!editor) {
62
66
  return;
63
67
  }
64
68
  const controller = editor.getContribution(NotebookFindContrib.id);
65
- controller.show();
69
+ if (context.selectedCells.length > 1) {
70
+ controller.show(undefined, { searchInRanges: true, selectedRanges: editor.getSelections() });
71
+ }
72
+ else {
73
+ controller.show(undefined, { searchInRanges: false, selectedRanges: [] });
74
+ }
66
75
  }
67
76
  });
68
77
  function notebookContainsTextModel(uri, textModel) {
@@ -115,13 +124,13 @@ StartFindAction.addImplementation(100, (accessor, codeEditor, args) => {
115
124
  const controller = editor.getContribution(NotebookFindContrib.id);
116
125
  const searchStringOptions = getSearchStringOptions(codeEditor, {
117
126
  forceRevealReplace: false,
118
- seedSearchStringFromSelection: codeEditor.getOption(41 ).seedSearchStringFromSelection !== 'never' ? 'single' : 'none',
119
- seedSearchStringFromNonEmptySelection: codeEditor.getOption(41 ).seedSearchStringFromSelection === 'selection',
120
- seedSearchStringFromGlobalClipboard: codeEditor.getOption(41 ).globalFindClipboard,
121
- shouldFocus: 1 ,
127
+ seedSearchStringFromSelection: codeEditor.getOption(EditorOption.find).seedSearchStringFromSelection !== 'never' ? 'single' : 'none',
128
+ seedSearchStringFromNonEmptySelection: codeEditor.getOption(EditorOption.find).seedSearchStringFromSelection === 'selection',
129
+ seedSearchStringFromGlobalClipboard: codeEditor.getOption(EditorOption.find).globalFindClipboard,
130
+ shouldFocus: FindStartFocusAction.FocusFindInput,
122
131
  shouldAnimate: true,
123
132
  updateSearchScope: false,
124
- loop: codeEditor.getOption(41 ).loop
133
+ loop: codeEditor.getOption(EditorOption.find).loop
125
134
  });
126
135
  let options = undefined;
127
136
  const uri = codeEditor.getModel().uri;
@@ -149,13 +158,13 @@ StartFindReplaceAction.addImplementation(100, (accessor, codeEditor, args) => {
149
158
  const controller = editor.getContribution(NotebookFindContrib.id);
150
159
  const searchStringOptions = getSearchStringOptions(codeEditor, {
151
160
  forceRevealReplace: false,
152
- seedSearchStringFromSelection: codeEditor.getOption(41 ).seedSearchStringFromSelection !== 'never' ? 'single' : 'none',
153
- seedSearchStringFromNonEmptySelection: codeEditor.getOption(41 ).seedSearchStringFromSelection === 'selection',
154
- seedSearchStringFromGlobalClipboard: codeEditor.getOption(41 ).globalFindClipboard,
155
- shouldFocus: 1 ,
161
+ seedSearchStringFromSelection: codeEditor.getOption(EditorOption.find).seedSearchStringFromSelection !== 'never' ? 'single' : 'none',
162
+ seedSearchStringFromNonEmptySelection: codeEditor.getOption(EditorOption.find).seedSearchStringFromSelection === 'selection',
163
+ seedSearchStringFromGlobalClipboard: codeEditor.getOption(EditorOption.find).globalFindClipboard,
164
+ shouldFocus: FindStartFocusAction.FocusFindInput,
156
165
  shouldAnimate: true,
157
166
  updateSearchScope: false,
158
- loop: codeEditor.getOption(41 ).loop
167
+ loop: codeEditor.getOption(EditorOption.find).loop
159
168
  });
160
169
  if (controller) {
161
170
  controller.replace(searchStringOptions?.searchString);