@codingame/monaco-vscode-notebook-service-override 11.1.2 → 12.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 (157) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +64 -1
  3. package/package.json +47 -15
  4. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +1 -1
  5. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.d.ts +38 -0
  6. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +43 -41
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.d.ts +1 -0
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +109 -130
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.d.ts +25 -0
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +13 -11
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.d.ts +3 -0
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +72 -19
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.d.ts +7 -0
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +23 -17
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.d.ts +14 -0
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +4 -3
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.d.ts +1 -0
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +30 -28
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.d.ts +18 -0
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.js +76 -0
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.d.ts +21 -0
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +61 -58
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.d.ts +1 -0
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +5 -3
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.d.ts +1 -0
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +4 -2
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.d.ts +28 -0
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +8 -7
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.d.ts +20 -0
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +10 -9
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.d.ts +1 -0
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +52 -50
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.d.ts +13 -0
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +3 -2
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +1 -1
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.d.ts +1 -0
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +28 -28
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.d.ts +10 -0
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +51 -50
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.d.ts +10 -0
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +21 -18
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.d.ts +1 -0
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +4 -2
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.d.ts +11 -0
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +3 -2
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.d.ts +1 -0
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +6 -5
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.d.ts +69 -0
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +460 -382
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.d.ts +1 -0
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +124 -0
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.d.ts +1 -0
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +87 -145
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.d.ts +2 -0
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -0
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.d.ts +27 -0
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +16 -15
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.d.ts +38 -0
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +8 -7
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.d.ts +34 -0
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +9 -8
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.d.ts +53 -0
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +40 -36
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts +112 -0
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +115 -116
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.d.ts +8 -0
  67. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +4 -3
  68. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.d.ts +32 -0
  69. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +111 -117
  70. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.d.ts +17 -0
  71. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +11 -9
  72. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.d.ts +1 -0
  73. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +5 -4
  74. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.d.ts +1 -0
  75. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +7 -6
  76. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.d.ts +1 -0
  77. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +1 -0
  78. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +9 -0
  79. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +113 -198
  80. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +8 -0
  81. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +25 -23
  82. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.d.ts +3 -0
  83. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +115 -145
  84. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.d.ts +3 -0
  85. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +76 -147
  86. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +13 -0
  87. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +45 -77
  88. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.d.ts +1 -0
  89. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +30 -35
  90. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.d.ts +27 -0
  91. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +19 -18
  92. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.d.ts +30 -0
  93. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +59 -52
  94. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.d.ts +1 -0
  95. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +11 -21
  96. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.d.ts +1 -0
  97. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +69 -113
  98. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.d.ts +14 -0
  99. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +194 -184
  100. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.d.ts +10 -0
  101. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +51 -51
  102. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.d.ts +12 -0
  103. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +14 -36
  104. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.d.ts +48 -0
  105. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +57 -56
  106. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.d.ts +16 -0
  107. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +1 -0
  108. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.d.ts +43 -0
  109. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +29 -11
  110. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.d.ts +30 -0
  111. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +17 -16
  112. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.d.ts +46 -0
  113. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +14 -8
  114. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.d.ts +25 -0
  115. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +21 -19
  116. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.d.ts +57 -0
  117. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +7 -4
  118. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.d.ts +20 -0
  119. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +30 -26
  120. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.d.ts +13 -0
  121. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +6 -5
  122. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.d.ts +23 -0
  123. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +2 -1
  124. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.d.ts +134 -0
  125. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +164 -121
  126. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.d.ts +14 -0
  127. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +2 -1
  128. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.d.ts +21 -0
  129. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +37 -0
  130. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.d.ts +56 -0
  131. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +6 -3
  132. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.d.ts +101 -0
  133. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +131 -55
  134. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.d.ts +29 -0
  135. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +4 -3
  136. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +48 -0
  137. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +12 -10
  138. package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.d.ts +38 -0
  139. package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +1 -0
  140. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.d.ts +50 -0
  141. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +75 -1
  142. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.d.ts +1 -0
  143. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.js +2 -1
  144. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.d.ts +31 -0
  145. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +2 -1
  146. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.d.ts +78 -0
  147. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +45 -42
  148. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.d.ts +96 -0
  149. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +57 -54
  150. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.d.ts +74 -0
  151. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +6 -3
  152. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.d.ts +53 -0
  153. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +2 -1
  154. package/worker.js +2 -1
  155. package/workers/notebook.worker.d.ts +1 -0
  156. package/notebook.js +0 -50
  157. package/workers/notebook.worker.js +0 -1
@@ -1,38 +1,38 @@
1
+
1
2
  import { localize2, localize } from 'vscode/vscode/vs/nls';
2
3
  import { Action2, MenuId, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
3
4
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
4
5
  import { NotebookOutlineContext } from '../contrib/outline/notebookOutline.js';
5
- import { FoldingController } from '@codingame/monaco-vscode-chat-interactive-notebook-search-common/vscode/vs/workbench/contrib/notebook/browser/controller/foldingController';
6
- import { executeIcon } from '@codingame/monaco-vscode-chat-interactive-notebook-search-common/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
6
+ import { FoldingController } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/foldingController';
7
+ import { CellEditState, CellFoldingState } from '@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
8
+ import { executeIcon } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
7
9
  import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
10
+ import { OutlineTarget } from '@codingame/monaco-vscode-d6e33d82-c101-549d-a885-0807ab3e0cfb-common/vscode/vs/workbench/services/outline/browser/outline';
11
+ import { CellToolbarOrder, CELL_TITLE_CELL_GROUP_ID } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
12
+ import { executeSectionCondition } from './executeActions.js';
8
13
 
9
14
  class NotebookRunSingleCellInSection extends Action2 {
10
15
  constructor() {
11
16
  super({
12
17
  id: 'notebook.section.runSingleCell',
13
18
  title: {
14
- ...( localize2(8058, "Run Cell")),
15
- mnemonicTitle: ( localize(8059, "&&Run Cell")),
19
+ ...( localize2(7526, "Run Cell")),
20
+ mnemonicTitle: ( localize(7527, "&&Run Cell")),
16
21
  },
17
- shortTitle: ( localize(8058, "Run Cell")),
22
+ shortTitle: ( localize(7526, "Run Cell")),
18
23
  icon: executeIcon,
19
24
  menu: [
20
25
  {
21
26
  id: MenuId.NotebookOutlineActionMenu,
22
27
  group: 'inline',
23
28
  order: 1,
24
- when: ( (ContextKeyExpr.and(
25
- (NotebookOutlineContext.CellKind.isEqualTo(CellKind.Code)),
26
- (NotebookOutlineContext.OutlineElementTarget.isEqualTo(1 )),
27
- (NotebookOutlineContext.CellHasChildren.toNegated()),
28
- (NotebookOutlineContext.CellHasHeader.toNegated())
29
- )))
29
+ when: ( ContextKeyExpr.and(( NotebookOutlineContext.CellKind.isEqualTo(CellKind.Code)), ( NotebookOutlineContext.OutlineElementTarget.isEqualTo(OutlineTarget.OutlinePane)), ( NotebookOutlineContext.CellHasChildren.toNegated()), ( NotebookOutlineContext.CellHasHeader.toNegated())))
30
30
  }
31
31
  ]
32
32
  });
33
33
  }
34
34
  async run(_accessor, context) {
35
- if (!checkSectionContext(context)) {
35
+ if (!checkOutlineEntryContext(context)) {
36
36
  return;
37
37
  }
38
38
  context.notebookEditor.executeNotebookCells([context.outlineEntry.cell]);
@@ -43,10 +43,11 @@ class NotebookRunCellsInSection extends Action2 {
43
43
  super({
44
44
  id: 'notebook.section.runCells',
45
45
  title: {
46
- ...( localize2(8060, "Run Cells In Section")),
47
- mnemonicTitle: ( localize(8061, "&&Run Cells In Section")),
46
+ ...( localize2(7528, "Run Cells In Section")),
47
+ mnemonicTitle: ( localize(7529, "&&Run Cells In Section")),
48
48
  },
49
- shortTitle: ( localize(8060, "Run Cells In Section")),
49
+ shortTitle: ( localize(7528, "Run Cells In Section")),
50
+ icon: executeIcon,
50
51
  menu: [
51
52
  {
52
53
  id: MenuId.NotebookStickyScrollContext,
@@ -57,30 +58,45 @@ class NotebookRunCellsInSection extends Action2 {
57
58
  id: MenuId.NotebookOutlineActionMenu,
58
59
  group: 'inline',
59
60
  order: 1,
60
- when: ( (ContextKeyExpr.and(
61
- (NotebookOutlineContext.CellKind.isEqualTo(CellKind.Markup)),
62
- (NotebookOutlineContext.OutlineElementTarget.isEqualTo(1 )),
63
- NotebookOutlineContext.CellHasChildren,
64
- NotebookOutlineContext.CellHasHeader
65
- )))
61
+ when: ( ContextKeyExpr.and(( NotebookOutlineContext.CellKind.isEqualTo(CellKind.Markup)), ( NotebookOutlineContext.OutlineElementTarget.isEqualTo(OutlineTarget.OutlinePane)), NotebookOutlineContext.CellHasChildren, NotebookOutlineContext.CellHasHeader))
62
+ },
63
+ {
64
+ id: MenuId.NotebookCellTitle,
65
+ order: CellToolbarOrder.RunSection,
66
+ group: CELL_TITLE_CELL_GROUP_ID,
67
+ when: executeSectionCondition
66
68
  }
67
69
  ]
68
70
  });
69
71
  }
70
72
  async run(_accessor, context) {
71
- if (!checkSectionContext(context)) {
73
+ let cell;
74
+ if (checkOutlineEntryContext(context)) {
75
+ cell = context.outlineEntry.cell;
76
+ }
77
+ else if (checkNotebookCellContext(context)) {
78
+ cell = context.cell;
79
+ }
80
+ else {
72
81
  return;
73
82
  }
74
- const cell = context.outlineEntry.cell;
75
- const idx = context.notebookEditor.getViewModel()?.getCellIndex(cell);
76
- if (idx === undefined) {
83
+ if (cell.getEditState() === CellEditState.Editing) {
84
+ const foldingController = context.notebookEditor.getContribution(FoldingController.id);
85
+ foldingController.recompute();
86
+ }
87
+ const cellIdx = context.notebookEditor.getViewModel()?.getCellIndex(cell);
88
+ if (cellIdx === undefined) {
77
89
  return;
78
90
  }
79
- const length = context.notebookEditor.getViewModel()?.getFoldedLength(idx);
91
+ const sectionIdx = context.notebookEditor.getViewModel()?.getFoldingStartIndex(cellIdx);
92
+ if (sectionIdx === undefined) {
93
+ return;
94
+ }
95
+ const length = context.notebookEditor.getViewModel()?.getFoldedLength(sectionIdx);
80
96
  if (length === undefined) {
81
97
  return;
82
98
  }
83
- const cells = context.notebookEditor.getCellsInRange({ start: idx, end: idx + length + 1 });
99
+ const cells = context.notebookEditor.getCellsInRange({ start: sectionIdx, end: sectionIdx + length + 1 });
84
100
  context.notebookEditor.executeNotebookCells(cells);
85
101
  }
86
102
  }
@@ -89,28 +105,22 @@ class NotebookFoldSection extends Action2 {
89
105
  super({
90
106
  id: 'notebook.section.foldSection',
91
107
  title: {
92
- ...( localize2(8062, "Fold Section")),
93
- mnemonicTitle: ( localize(8063, "&&Fold Section")),
108
+ ...( localize2(7530, "Fold Section")),
109
+ mnemonicTitle: ( localize(7531, "&&Fold Section")),
94
110
  },
95
- shortTitle: ( localize(8062, "Fold Section")),
111
+ shortTitle: ( localize(7530, "Fold Section")),
96
112
  menu: [
97
113
  {
98
114
  id: MenuId.NotebookOutlineActionMenu,
99
115
  group: 'notebookFolding',
100
116
  order: 2,
101
- when: ( (ContextKeyExpr.and(
102
- (NotebookOutlineContext.CellKind.isEqualTo(CellKind.Markup)),
103
- (NotebookOutlineContext.OutlineElementTarget.isEqualTo(1 )),
104
- NotebookOutlineContext.CellHasChildren,
105
- NotebookOutlineContext.CellHasHeader,
106
- (NotebookOutlineContext.CellFoldingState.isEqualTo(1 ))
107
- )))
117
+ when: ( ContextKeyExpr.and(( NotebookOutlineContext.CellKind.isEqualTo(CellKind.Markup)), ( NotebookOutlineContext.OutlineElementTarget.isEqualTo(OutlineTarget.OutlinePane)), NotebookOutlineContext.CellHasChildren, NotebookOutlineContext.CellHasHeader, ( NotebookOutlineContext.CellFoldingState.isEqualTo(CellFoldingState.Expanded))))
108
118
  }
109
119
  ]
110
120
  });
111
121
  }
112
122
  async run(_accessor, context) {
113
- if (!checkSectionContext(context)) {
123
+ if (!checkOutlineEntryContext(context)) {
114
124
  return;
115
125
  }
116
126
  this.toggleFoldRange(context.outlineEntry, context.notebookEditor);
@@ -119,7 +129,7 @@ class NotebookFoldSection extends Action2 {
119
129
  const foldingController = notebookEditor.getContribution(FoldingController.id);
120
130
  const index = entry.index;
121
131
  const headerLevel = entry.level;
122
- const newFoldingState = 2 ;
132
+ const newFoldingState = CellFoldingState.Collapsed;
123
133
  foldingController.setFoldingStateDown(index, newFoldingState, headerLevel);
124
134
  }
125
135
  }
@@ -128,28 +138,22 @@ class NotebookExpandSection extends Action2 {
128
138
  super({
129
139
  id: 'notebook.section.expandSection',
130
140
  title: {
131
- ...( localize2(8064, "Expand Section")),
132
- mnemonicTitle: ( localize(8065, "&&Expand Section")),
141
+ ...( localize2(7532, "Expand Section")),
142
+ mnemonicTitle: ( localize(7533, "&&Expand Section")),
133
143
  },
134
- shortTitle: ( localize(8064, "Expand Section")),
144
+ shortTitle: ( localize(7532, "Expand Section")),
135
145
  menu: [
136
146
  {
137
147
  id: MenuId.NotebookOutlineActionMenu,
138
148
  group: 'notebookFolding',
139
149
  order: 2,
140
- when: ( (ContextKeyExpr.and(
141
- (NotebookOutlineContext.CellKind.isEqualTo(CellKind.Markup)),
142
- (NotebookOutlineContext.OutlineElementTarget.isEqualTo(1 )),
143
- NotebookOutlineContext.CellHasChildren,
144
- NotebookOutlineContext.CellHasHeader,
145
- (NotebookOutlineContext.CellFoldingState.isEqualTo(2 ))
146
- )))
150
+ when: ( ContextKeyExpr.and(( NotebookOutlineContext.CellKind.isEqualTo(CellKind.Markup)), ( NotebookOutlineContext.OutlineElementTarget.isEqualTo(OutlineTarget.OutlinePane)), NotebookOutlineContext.CellHasChildren, NotebookOutlineContext.CellHasHeader, ( NotebookOutlineContext.CellFoldingState.isEqualTo(CellFoldingState.Collapsed))))
147
151
  }
148
152
  ]
149
153
  });
150
154
  }
151
155
  async run(_accessor, context) {
152
- if (!checkSectionContext(context)) {
156
+ if (!checkOutlineEntryContext(context)) {
153
157
  return;
154
158
  }
155
159
  this.toggleFoldRange(context.outlineEntry, context.notebookEditor);
@@ -158,13 +162,16 @@ class NotebookExpandSection extends Action2 {
158
162
  const foldingController = notebookEditor.getContribution(FoldingController.id);
159
163
  const index = entry.index;
160
164
  const headerLevel = entry.level;
161
- const newFoldingState = 1 ;
165
+ const newFoldingState = CellFoldingState.Expanded;
162
166
  foldingController.setFoldingStateDown(index, newFoldingState, headerLevel);
163
167
  }
164
168
  }
165
- function checkSectionContext(context) {
169
+ function checkOutlineEntryContext(context) {
166
170
  return !!(context && context.notebookEditor && context.outlineEntry);
167
171
  }
172
+ function checkNotebookCellContext(context) {
173
+ return !!(context && context.notebookEditor && context.cell);
174
+ }
168
175
  registerAction2(NotebookRunSingleCellInSection);
169
176
  registerAction2(NotebookRunCellsInSection);
170
177
  registerAction2(NotebookFoldSection);
@@ -1,50 +1,40 @@
1
+
1
2
  import { localize2 } from 'vscode/vscode/vs/nls';
2
3
  import { registerAction2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
3
4
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
4
5
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
5
- import { KERNEL_HAS_VARIABLE_PROVIDER } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
6
+ import { KERNEL_HAS_VARIABLE_PROVIDER } from '@codingame/monaco-vscode-4a36e358-d94d-55e0-86ee-3bcd543d9d3f-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
6
7
  import { NOTEBOOK_VARIABLE_VIEW_ENABLED } from '../contrib/notebookVariables/notebookVariableContextKeys.js';
7
- import { variablesViewIcon } from '@codingame/monaco-vscode-chat-interactive-notebook-search-common/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
8
- import { NotebookAction } from '@codingame/monaco-vscode-chat-interactive-notebook-search-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
8
+ import { variablesViewIcon } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
9
+ import { NotebookAction } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
9
10
 
10
11
  const OPEN_VARIABLES_VIEW_COMMAND_ID = 'notebook.openVariablesView';
11
12
  registerAction2(class OpenVariablesViewAction extends NotebookAction {
12
13
  constructor() {
13
14
  super({
14
15
  id: OPEN_VARIABLES_VIEW_COMMAND_ID,
15
- title: ( localize2(8110, "Variables")),
16
+ title: ( localize2(7534, "Variables")),
16
17
  icon: variablesViewIcon,
17
18
  menu: [
18
19
  {
19
20
  id: MenuId.InteractiveToolbar,
20
21
  group: 'navigation',
21
- when: ( (ContextKeyExpr.and(
22
- KERNEL_HAS_VARIABLE_PROVIDER,
23
- (ContextKeyExpr.notEquals('jupyter.kernel.isjupyter', true)),
24
- NOTEBOOK_VARIABLE_VIEW_ENABLED
25
- )))
22
+ when: ( ContextKeyExpr.and(KERNEL_HAS_VARIABLE_PROVIDER, (
23
+ ContextKeyExpr.notEquals('jupyter.kernel.isjupyter', true)), NOTEBOOK_VARIABLE_VIEW_ENABLED))
26
24
  },
27
25
  {
28
26
  id: MenuId.EditorTitle,
29
27
  order: -1,
30
28
  group: 'navigation',
31
- when: ( (ContextKeyExpr.and(
32
- KERNEL_HAS_VARIABLE_PROVIDER,
33
- (ContextKeyExpr.notEquals('jupyter.kernel.isjupyter', true)),
34
- (ContextKeyExpr.notEquals('config.notebook.globalToolbar', true)),
35
- NOTEBOOK_VARIABLE_VIEW_ENABLED
36
- )))
29
+ when: ( ContextKeyExpr.and(KERNEL_HAS_VARIABLE_PROVIDER, (
30
+ ContextKeyExpr.notEquals('jupyter.kernel.isjupyter', true)), ( ContextKeyExpr.notEquals('config.notebook.globalToolbar', true)), NOTEBOOK_VARIABLE_VIEW_ENABLED))
37
31
  },
38
32
  {
39
33
  id: MenuId.NotebookToolbar,
40
34
  order: -1,
41
35
  group: 'navigation',
42
- when: ( (ContextKeyExpr.and(
43
- KERNEL_HAS_VARIABLE_PROVIDER,
44
- (ContextKeyExpr.notEquals('jupyter.kernel.isjupyter', true)),
45
- (ContextKeyExpr.equals('config.notebook.globalToolbar', true)),
46
- NOTEBOOK_VARIABLE_VIEW_ENABLED
47
- )))
36
+ when: ( ContextKeyExpr.and(KERNEL_HAS_VARIABLE_PROVIDER, (
37
+ ContextKeyExpr.notEquals('jupyter.kernel.isjupyter', true)), ( ContextKeyExpr.equals('config.notebook.globalToolbar', true)), NOTEBOOK_VARIABLE_VIEW_ENABLED))
48
38
  }
49
39
  ]
50
40
  });