@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,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { localize } from 'vscode/vscode/vs/nls';
3
4
  import { toAction } from 'vscode/vscode/vs/base/common/actions';
4
5
  import { createErrorWithActions } from 'vscode/vscode/vs/base/common/errorMessage';
@@ -15,27 +16,29 @@ import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/c
15
16
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
16
17
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
17
18
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
19
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
18
20
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
19
- import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
21
+ import { Memento } from '@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/common/memento';
20
22
  import { notebooksExtensionPoint, notebookRendererExtensionPoint, notebookPreloadExtensionPoint } from '../notebookExtensionPoint.js';
21
- import { NotebookDiffEditorInput } from '@codingame/monaco-vscode-chat-notebook-common/vscode/vs/workbench/contrib/notebook/common/notebookDiffEditorInput';
23
+ import { NotebookDiffEditorInput } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/common/notebookDiffEditorInput';
22
24
  import { NotebookTextModel } from '../../common/model/notebookTextModel.js';
23
- import { NotebookEditorPriority, NotebookSetting, CellUri, RENDERER_EQUIVALENT_EXTENSIONS, RENDERER_NOT_AVAILABLE, MimeTypeDisplayOrder, ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER, NOTEBOOK_DISPLAY_ORDER } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
24
- import { NotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
25
+ import { NotebookEditorPriority, NotebookSetting, CellUri, NotebookRendererMatch, RENDERER_EQUIVALENT_EXTENSIONS, RENDERER_NOT_AVAILABLE, MimeTypeDisplayOrder, ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER, NOTEBOOK_DISPLAY_ORDER } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
26
+ import { NotebookEditorInput } from '@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
25
27
  import { INotebookEditorModelResolverService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service';
26
28
  import { NotebookOutputRendererInfo, NotebookStaticPreloadInfo } from '../../common/notebookOutputRenderer.js';
27
29
  import { NotebookProviderInfo } from '../../common/notebookProvider.js';
28
- import { SimpleNotebookProviderInfo } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
30
+ import { SimpleNotebookProviderInfo } from '@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/common/notebookService';
29
31
  import { RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
30
32
  import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service';
31
33
  import { isProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
32
34
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
33
- import { InstallRecommendedExtensionAction } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/extensionsActions';
35
+ import { InstallRecommendedExtensionAction } from '@codingame/monaco-vscode-47923ab1-c4c8-58b5-89ac-fa1b998eb5dd-common/vscode/vs/workbench/contrib/extensions/browser/extensionsActions';
34
36
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
35
37
  import { INotebookDocumentService } from 'vscode/vscode/vs/workbench/services/notebook/common/notebookDocumentService.service';
36
- import { MergeEditorInput } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput';
37
- import { streamToBuffer, VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
38
- import { NotebookMultiDiffEditorInput } from '@codingame/monaco-vscode-chat-notebook-common/vscode/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput';
38
+ import { MergeEditorInput } from '@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput';
39
+ import { streamToBuffer, VSBuffer, bufferToStream } from 'vscode/vscode/vs/base/common/buffer';
40
+ import { NotebookMultiDiffEditorInput } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput';
41
+ import { CancellationError } from 'vscode/vscode/vs/base/common/errors';
39
42
 
40
43
  var NotebookProviderInfoStore_1, NotebookService_1;
41
44
  let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposable {
@@ -52,13 +55,13 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
52
55
  this._notebookEditorModelResolverService = _notebookEditorModelResolverService;
53
56
  this.uriIdentService = uriIdentService;
54
57
  this._handled = false;
55
- this._contributedEditors = ( (new Map()));
56
- this._contributedEditorDisposables = this._register(( (new DisposableStore())));
57
- this._memento = ( (new Memento(NotebookProviderInfoStore_1.CUSTOM_EDITORS_STORAGE_ID, storageService)));
58
- const mementoObject = this._memento.getMemento(0 , 1 );
58
+ this._contributedEditors = ( new Map());
59
+ this._contributedEditorDisposables = this._register(( new DisposableStore()));
60
+ this._memento = ( new Memento(NotebookProviderInfoStore_1.CUSTOM_EDITORS_STORAGE_ID, storageService));
61
+ const mementoObject = this._memento.getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
59
62
  this._editorResolverService.bufferChangeEvents(() => {
60
63
  for (const info of (mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] || [])) {
61
- this.add(( (new NotebookProviderInfo(info))), false);
64
+ this.add(( new NotebookProviderInfo(info)), false);
62
65
  }
63
66
  });
64
67
  this._register(extensionService.onDidRegisterExtensions(() => {
@@ -76,9 +79,9 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
76
79
  }
77
80
  _setupHandler(extensions) {
78
81
  this._handled = true;
79
- const builtins = [...( (this._contributedEditors.values()))].filter(info => !info.extension);
82
+ const builtins = [...( this._contributedEditors.values())].filter(info => !info.extension);
80
83
  this._clear();
81
- const builtinProvidersFromCache = ( (new Map()));
84
+ const builtinProvidersFromCache = ( new Map());
82
85
  builtins.forEach(builtin => {
83
86
  builtinProvidersFromCache.set(builtin.id, this.add(builtin));
84
87
  });
@@ -98,22 +101,22 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
98
101
  continue;
99
102
  }
100
103
  }
101
- this.add(( (new NotebookProviderInfo({
104
+ this.add(( new NotebookProviderInfo({
102
105
  extension: extension.description.identifier,
103
106
  id: notebookContribution.type,
104
107
  displayName: notebookContribution.displayName,
105
108
  selectors: notebookContribution.selector || [],
106
109
  priority: this._convertPriority(notebookContribution.priority),
107
110
  providerDisplayName: extension.description.displayName ?? extension.description.identifier.value,
108
- }))));
111
+ })));
109
112
  }
110
113
  }
111
- const mementoObject = this._memento.getMemento(0 , 1 );
112
- mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( (this._contributedEditors.values())));
114
+ const mementoObject = this._memento.getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
115
+ mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( this._contributedEditors.values()));
113
116
  this._memento.saveMemento();
114
117
  }
115
118
  clearEditorCache() {
116
- const mementoObject = this._memento.getMemento(0 , 1 );
119
+ const mementoObject = this._memento.getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
117
120
  mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = [];
118
121
  this._memento.saveMemento();
119
122
  }
@@ -127,7 +130,7 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
127
130
  return RegisteredEditorPriority.option;
128
131
  }
129
132
  _registerContributionPoint(notebookProviderInfo) {
130
- const disposables = ( (new DisposableStore()));
133
+ const disposables = ( new DisposableStore());
131
134
  for (const selector of notebookProviderInfo.selectors) {
132
135
  const globPattern = selector.include || selector;
133
136
  const notebookEditorInfo = {
@@ -236,8 +239,8 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
236
239
  return this._contributedEditors.get(viewType);
237
240
  }
238
241
  add(info, saveMemento = true) {
239
- if (( (this._contributedEditors.has(info.id)))) {
240
- throw ( (new Error(`notebook type '${info.id}' ALREADY EXISTS`)));
242
+ if (( this._contributedEditors.has(info.id))) {
243
+ throw ( new Error(`notebook type '${info.id}' ALREADY EXISTS`));
241
244
  }
242
245
  this._contributedEditors.set(info.id, info);
243
246
  let editorRegistration;
@@ -246,13 +249,13 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
246
249
  this._contributedEditorDisposables.add(editorRegistration);
247
250
  }
248
251
  if (saveMemento) {
249
- const mementoObject = this._memento.getMemento(0 , 1 );
250
- mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( (this._contributedEditors.values())));
252
+ const mementoObject = this._memento.getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
253
+ mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( this._contributedEditors.values()));
251
254
  this._memento.saveMemento();
252
255
  }
253
256
  return this._register(toDisposable(() => {
254
- const mementoObject = this._memento.getMemento(0 , 1 );
255
- mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( (this._contributedEditors.values())));
257
+ const mementoObject = this._memento.getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
258
+ mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( this._contributedEditors.values()));
256
259
  this._memento.saveMemento();
257
260
  editorRegistration?.dispose();
258
261
  this._contributedEditors.delete(info.id);
@@ -260,40 +263,38 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
260
263
  }
261
264
  getContributedNotebook(resource) {
262
265
  const result = [];
263
- for (const info of ( (this._contributedEditors.values()))) {
266
+ for (const info of ( this._contributedEditors.values())) {
264
267
  if (info.matches(resource)) {
265
268
  result.push(info);
266
269
  }
267
270
  }
268
271
  if (result.length === 0 && resource.scheme === Schemas.untitled) {
269
- return Array.from(( (this._contributedEditors.values())));
272
+ return Array.from(( this._contributedEditors.values()));
270
273
  }
271
274
  return result;
272
275
  }
273
276
  [Symbol.iterator]() {
274
- return (
275
- (this._contributedEditors.values())
276
- );
277
+ return ( this._contributedEditors.values());
277
278
  }
278
279
  };
279
- NotebookProviderInfoStore = NotebookProviderInfoStore_1 = ( (__decorate([
280
- ( (__param(0, IStorageService))),
281
- ( (__param(1, IExtensionService))),
282
- ( (__param(2, IEditorResolverService))),
283
- ( (__param(3, IConfigurationService))),
284
- ( (__param(4, IAccessibilityService))),
285
- ( (__param(5, IInstantiationService))),
286
- ( (__param(6, IFileService))),
287
- ( (__param(7, INotebookEditorModelResolverService))),
288
- ( (__param(8, IUriIdentityService)))
289
- ], NotebookProviderInfoStore)));
280
+ NotebookProviderInfoStore = NotebookProviderInfoStore_1 = ( __decorate([
281
+ ( __param(0, IStorageService)),
282
+ ( __param(1, IExtensionService)),
283
+ ( __param(2, IEditorResolverService)),
284
+ ( __param(3, IConfigurationService)),
285
+ ( __param(4, IAccessibilityService)),
286
+ ( __param(5, IInstantiationService)),
287
+ ( __param(6, IFileService)),
288
+ ( __param(7, INotebookEditorModelResolverService)),
289
+ ( __param(8, IUriIdentityService))
290
+ ], NotebookProviderInfoStore));
290
291
  let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
291
292
  constructor(storageService) {
292
- this.contributedRenderers = ( (new Map()));
293
- this.preferredMimetype = ( (new Lazy(
294
- () => this.preferredMimetypeMemento.getMemento(1 , 1 )
295
- )));
296
- this.preferredMimetypeMemento = ( (new Memento('workbench.editor.notebook.preferredRenderer2', storageService)));
293
+ this.contributedRenderers = ( new Map());
294
+ this.preferredMimetype = ( new Lazy(
295
+ () => this.preferredMimetypeMemento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE)
296
+ ));
297
+ this.preferredMimetypeMemento = ( new Memento('workbench.editor.notebook.preferredRenderer2', storageService));
297
298
  }
298
299
  clear() {
299
300
  this.contributedRenderers.clear();
@@ -302,10 +303,10 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
302
303
  return this.contributedRenderers.get(rendererId);
303
304
  }
304
305
  getAll() {
305
- return Array.from(( (this.contributedRenderers.values())));
306
+ return Array.from(( this.contributedRenderers.values()));
306
307
  }
307
308
  add(info) {
308
- if (( (this.contributedRenderers.has(info.id)))) {
309
+ if (( this.contributedRenderers.has(info.id))) {
309
310
  return;
310
311
  }
311
312
  this.contributedRenderers.set(info.id, info);
@@ -322,44 +323,49 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
322
323
  this.preferredMimetypeMemento.saveMemento();
323
324
  }
324
325
  findBestRenderers(notebookProviderInfo, mimeType, kernelProvides) {
326
+ let ReuseOrder;
327
+ (function (ReuseOrder) {
328
+ ReuseOrder[ReuseOrder["PreviouslySelected"] = 256] = "PreviouslySelected";
329
+ ReuseOrder[ReuseOrder["SameExtensionAsNotebook"] = 512] = "SameExtensionAsNotebook";
330
+ ReuseOrder[ReuseOrder["OtherRenderer"] = 768] = "OtherRenderer";
331
+ ReuseOrder[ReuseOrder["BuiltIn"] = 1024] = "BuiltIn";
332
+ })(ReuseOrder || (ReuseOrder = {}));
325
333
  const preferred = notebookProviderInfo && this.preferredMimetype.value[notebookProviderInfo.id]?.[mimeType];
326
334
  const notebookExtId = notebookProviderInfo?.extension?.value;
327
335
  const notebookId = notebookProviderInfo?.id;
328
- const renderers = ( (Array.from(( (this.contributedRenderers.values())))
336
+ const renderers = ( Array.from(( this.contributedRenderers.values()))
329
337
  .map(renderer => {
330
338
  const ownScore = kernelProvides === undefined
331
339
  ? renderer.matchesWithoutKernel(mimeType)
332
340
  : renderer.matches(mimeType, kernelProvides);
333
- if (ownScore === 3 ) {
341
+ if (ownScore === NotebookRendererMatch.Never) {
334
342
  return undefined;
335
343
  }
336
344
  const rendererExtId = renderer.extensionId.value;
337
345
  const reuseScore = preferred === renderer.id
338
- ? 256
346
+ ? ReuseOrder.PreviouslySelected
339
347
  : rendererExtId === notebookExtId || RENDERER_EQUIVALENT_EXTENSIONS.get(rendererExtId)?.has(notebookId)
340
- ? 512
341
- : renderer.isBuiltin ? 1024 : 768 ;
348
+ ? ReuseOrder.SameExtensionAsNotebook
349
+ : renderer.isBuiltin ? ReuseOrder.BuiltIn : ReuseOrder.OtherRenderer;
342
350
  return {
343
351
  ordered: { mimeType, rendererId: renderer.id, isTrusted: true },
344
352
  score: reuseScore | ownScore,
345
353
  };
346
- }))).filter(isDefined);
354
+ })).filter(isDefined);
347
355
  if (renderers.length === 0) {
348
356
  return [{ mimeType, rendererId: RENDERER_NOT_AVAILABLE, isTrusted: true }];
349
357
  }
350
- return (
351
- (renderers.sort((a, b) => a.score - b.score).map(r => r.ordered))
352
- );
358
+ return ( renderers.sort((a, b) => a.score - b.score).map(r => r.ordered));
353
359
  }
354
360
  };
355
- NotebookOutputRendererInfoStore = ( (__decorate([
356
- ( (__param(0, IStorageService)))
357
- ], NotebookOutputRendererInfoStore)));
361
+ NotebookOutputRendererInfoStore = ( __decorate([
362
+ ( __param(0, IStorageService))
363
+ ], NotebookOutputRendererInfoStore));
358
364
  class ModelData {
359
365
  get uri() { return this.model.uri; }
360
366
  constructor(model, onWillDispose) {
361
367
  this.model = model;
362
- this._modelEventListeners = ( (new DisposableStore()));
368
+ this._modelEventListeners = ( new DisposableStore());
363
369
  this._modelEventListeners.add(model.onWillDispose(() => onWillDispose(model)));
364
370
  }
365
371
  getCellIndex(cellUri) {
@@ -386,26 +392,26 @@ let NotebookService = class NotebookService extends Disposable {
386
392
  this._instantiationService = _instantiationService;
387
393
  this._storageService = _storageService;
388
394
  this._notebookDocumentService = _notebookDocumentService;
389
- this._notebookProviders = ( (new Map()));
395
+ this._notebookProviders = ( new Map());
390
396
  this._notebookProviderInfoStore = undefined;
391
397
  this._notebookRenderersInfoStore = this._instantiationService.createInstance(NotebookOutputRendererInfoStore);
392
- this._onDidChangeOutputRenderers = this._register(( (new Emitter())));
398
+ this._onDidChangeOutputRenderers = this._register(( new Emitter()));
393
399
  this.onDidChangeOutputRenderers = this._onDidChangeOutputRenderers.event;
394
- this._notebookStaticPreloadInfoStore = ( (new Set()));
395
- this._models = ( (new ResourceMap()));
396
- this._onWillAddNotebookDocument = this._register(( (new Emitter())));
397
- this._onDidAddNotebookDocument = this._register(( (new Emitter())));
398
- this._onWillRemoveNotebookDocument = this._register(( (new Emitter())));
399
- this._onDidRemoveNotebookDocument = this._register(( (new Emitter())));
400
+ this._notebookStaticPreloadInfoStore = ( new Set());
401
+ this._models = ( new ResourceMap());
402
+ this._onWillAddNotebookDocument = this._register(( new Emitter()));
403
+ this._onDidAddNotebookDocument = this._register(( new Emitter()));
404
+ this._onWillRemoveNotebookDocument = this._register(( new Emitter()));
405
+ this._onDidRemoveNotebookDocument = this._register(( new Emitter()));
400
406
  this.onWillAddNotebookDocument = this._onWillAddNotebookDocument.event;
401
407
  this.onDidAddNotebookDocument = this._onDidAddNotebookDocument.event;
402
408
  this.onDidRemoveNotebookDocument = this._onDidRemoveNotebookDocument.event;
403
409
  this.onWillRemoveNotebookDocument = this._onWillRemoveNotebookDocument.event;
404
- this._onAddViewType = this._register(( (new Emitter())));
410
+ this._onAddViewType = this._register(( new Emitter()));
405
411
  this.onAddViewType = this._onAddViewType.event;
406
- this._onWillRemoveViewType = this._register(( (new Emitter())));
412
+ this._onWillRemoveViewType = this._register(( new Emitter()));
407
413
  this.onWillRemoveViewType = this._onWillRemoveViewType.event;
408
- this._onDidChangeEditorTypes = this._register(( (new Emitter())));
414
+ this._onDidChangeEditorTypes = this._register(( new Emitter()));
409
415
  this.onDidChangeEditorTypes = this._onDidChangeEditorTypes.event;
410
416
  this._lastClipboardIsCopy = true;
411
417
  notebookRendererExtensionPoint.setHandler((renderers) => {
@@ -421,7 +427,7 @@ let NotebookService = class NotebookService extends Disposable {
421
427
  extension.collector.error(`Notebook renderer does not specify id-property`);
422
428
  continue;
423
429
  }
424
- this._notebookRenderersInfoStore.add(( (new NotebookOutputRendererInfo({
430
+ this._notebookRenderersInfoStore.add(( new NotebookOutputRendererInfo({
425
431
  id,
426
432
  extension: extension.description,
427
433
  entrypoint: notebookContribution.entrypoint,
@@ -430,7 +436,7 @@ let NotebookService = class NotebookService extends Disposable {
430
436
  dependencies: notebookContribution.dependencies,
431
437
  optionalDependencies: notebookContribution.optionalDependencies,
432
438
  requiresMessaging: notebookContribution.requiresMessaging,
433
- }))));
439
+ })));
434
440
  }
435
441
  }
436
442
  this._onDidChangeOutputRenderers.fire();
@@ -451,22 +457,22 @@ let NotebookService = class NotebookService extends Disposable {
451
457
  extension.collector.error(`Notebook preload does not specify type-property`);
452
458
  continue;
453
459
  }
454
- this._notebookStaticPreloadInfoStore.add(( (new NotebookStaticPreloadInfo({
460
+ this._notebookStaticPreloadInfoStore.add(( new NotebookStaticPreloadInfo({
455
461
  type,
456
462
  extension: extension.description,
457
463
  entrypoint: notebookContribution.entrypoint,
458
464
  localResourceRoots: notebookContribution.localResourceRoots ?? [],
459
- }))));
465
+ })));
460
466
  }
461
467
  }
462
468
  });
463
469
  const updateOrder = () => {
464
- this._displayOrder = ( (new MimeTypeDisplayOrder(
470
+ this._displayOrder = ( new MimeTypeDisplayOrder(
465
471
  this._configurationService.getValue(NotebookSetting.displayOrder) || [],
466
472
  this._accessibilityService.isScreenReaderOptimized()
467
473
  ? ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER
468
474
  : NOTEBOOK_DISPLAY_ORDER
469
- )));
475
+ ));
470
476
  };
471
477
  updateOrder();
472
478
  this._register(this._configurationService.onDidChangeConfiguration(e => {
@@ -477,17 +483,15 @@ let NotebookService = class NotebookService extends Disposable {
477
483
  this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(() => {
478
484
  updateOrder();
479
485
  }));
480
- this._memento = ( (new Memento(NotebookService_1._storageNotebookViewTypeProvider, this._storageService)));
481
- this._viewTypeCache = this._memento.getMemento(1 , 1 );
486
+ this._memento = ( new Memento(NotebookService_1._storageNotebookViewTypeProvider, this._storageService));
487
+ this._viewTypeCache = this._memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE);
482
488
  }
483
489
  getEditorTypes() {
484
- return (
485
- ([...this.notebookProviderInfoStore].map(info => ({
486
- id: info.id,
487
- displayName: info.displayName,
488
- providerDisplayName: info.providerDisplayName
489
- })))
490
- );
490
+ return ( [...this.notebookProviderInfoStore].map(info => ({
491
+ id: info.id,
492
+ displayName: info.displayName,
493
+ providerDisplayName: info.providerDisplayName
494
+ })));
491
495
  }
492
496
  clearEditorCache() {
493
497
  this.notebookProviderInfoStore.clearEditorCache();
@@ -497,24 +501,22 @@ let NotebookService = class NotebookService extends Disposable {
497
501
  this._extensionService.activateByEvent(`onNotebook:*`);
498
502
  }
499
503
  async canResolve(viewType) {
500
- if (( (this._notebookProviders.has(viewType)))) {
504
+ if (( this._notebookProviders.has(viewType))) {
501
505
  return true;
502
506
  }
503
507
  await this._extensionService.whenInstalledExtensionsRegistered();
504
508
  await this._extensionService.activateByEvent(`onNotebookSerializer:${viewType}`);
505
- return (
506
- (this._notebookProviders.has(viewType))
507
- );
509
+ return ( this._notebookProviders.has(viewType));
508
510
  }
509
511
  registerContributedNotebookType(viewType, data) {
510
- const info = ( (new NotebookProviderInfo({
512
+ const info = ( new NotebookProviderInfo({
511
513
  extension: data.extension,
512
514
  id: viewType,
513
515
  displayName: data.displayName,
514
516
  providerDisplayName: data.providerDisplayName,
515
517
  priority: data.priority || RegisteredEditorPriority.default,
516
518
  selectors: []
517
- })));
519
+ }));
518
520
  info.update({ selectors: data.filenamePattern });
519
521
  const reg = this.notebookProviderInfoStore.add(info);
520
522
  this._onDidChangeEditorTypes.fire();
@@ -524,8 +526,8 @@ let NotebookService = class NotebookService extends Disposable {
524
526
  });
525
527
  }
526
528
  _registerProviderData(viewType, data) {
527
- if (( (this._notebookProviders.has(viewType)))) {
528
- throw ( (new Error(`notebook provider for viewtype '${viewType}' already exists`)));
529
+ if (( this._notebookProviders.has(viewType))) {
530
+ throw ( new Error(`notebook provider for viewtype '${viewType}' already exists`));
529
531
  }
530
532
  this._notebookProviders.set(viewType, data);
531
533
  this._onAddViewType.fire(viewType);
@@ -538,7 +540,7 @@ let NotebookService = class NotebookService extends Disposable {
538
540
  this.notebookProviderInfoStore.get(viewType)?.update({ options: serializer.options });
539
541
  this._viewTypeCache[viewType] = extensionData.id.value;
540
542
  this._persistMementos();
541
- return this._registerProviderData(viewType, ( (new SimpleNotebookProviderInfo(viewType, serializer, extensionData))));
543
+ return this._registerProviderData(viewType, ( new SimpleNotebookProviderInfo(viewType, serializer, extensionData)));
542
544
  }
543
545
  async withNotebookDataProvider(viewType) {
544
546
  const selected = this.notebookProviderInfoStore.get(viewType);
@@ -546,7 +548,7 @@ let NotebookService = class NotebookService extends Disposable {
546
548
  const knownProvider = this.getViewTypeProvider(viewType);
547
549
  const actions = knownProvider ? [
548
550
  toAction({
549
- id: 'workbench.notebook.action.installMissingViewType', label: ( localize(3292, "Install extension for '{0}'", viewType)), run: async () => {
551
+ id: 'workbench.notebook.action.installMissingViewType', label: ( localize(7748, "Install extension for '{0}'", viewType)), run: async () => {
550
552
  await this._instantiationService.createInstance(InstallRecommendedExtensionAction, knownProvider).run();
551
553
  }
552
554
  })
@@ -556,7 +558,7 @@ let NotebookService = class NotebookService extends Disposable {
556
558
  await this.canResolve(selected.id);
557
559
  const result = this._notebookProviders.get(selected.id);
558
560
  if (!result) {
559
- throw ( (new Error(`NO provider registered for view type: '${selected.id}'`)));
561
+ throw ( new Error(`NO provider registered for view type: '${selected.id}'`));
560
562
  }
561
563
  return result;
562
564
  }
@@ -597,17 +599,17 @@ let NotebookService = class NotebookService extends Disposable {
597
599
  }
598
600
  }
599
601
  async createNotebookTextModel(viewType, uri, stream) {
600
- if (( (this._models.has(uri)))) {
601
- throw ( (new Error(`notebook for ${uri} already exists`)));
602
+ if (( this._models.has(uri))) {
603
+ throw ( new Error(`notebook for ${uri} already exists`));
602
604
  }
603
605
  const info = await this.withNotebookDataProvider(viewType);
604
606
  if (!(info instanceof SimpleNotebookProviderInfo)) {
605
- throw ( (new Error('CANNOT open file notebook with this provider')));
607
+ throw ( new Error('CANNOT open file notebook with this provider'));
606
608
  }
607
609
  const bytes = stream ? await streamToBuffer(stream) : VSBuffer.fromByteArray([]);
608
610
  const data = await info.serializer.dataToNotebook(bytes);
609
611
  const notebookModel = this._instantiationService.createInstance(NotebookTextModel, info.viewType, uri, data.cells, data.metadata, info.serializer.options);
610
- const modelData = ( (new ModelData(notebookModel, this._onWillDisposeDocument.bind(this))));
612
+ const modelData = ( new ModelData(notebookModel, this._onWillDisposeDocument.bind(this)));
611
613
  this._models.set(uri, modelData);
612
614
  this._notebookDocumentService.addNotebookDocument(modelData);
613
615
  this._onWillAddNotebookDocument.fire(notebookModel);
@@ -615,18 +617,51 @@ let NotebookService = class NotebookService extends Disposable {
615
617
  this._postDocumentOpenActivation(info.viewType);
616
618
  return notebookModel;
617
619
  }
620
+ async createNotebookTextDocumentSnapshot(uri, context, token) {
621
+ const model = this.getNotebookTextModel(uri);
622
+ if (!model) {
623
+ throw ( new Error(`notebook for ${uri} doesn't exist`));
624
+ }
625
+ const info = await this.withNotebookDataProvider(model.viewType);
626
+ if (!(info instanceof SimpleNotebookProviderInfo)) {
627
+ throw ( new Error('CANNOT open file notebook with this provider'));
628
+ }
629
+ const serializer = info.serializer;
630
+ const outputSizeLimit = this._configurationService.getValue(NotebookSetting.outputBackupSizeLimit) * 1024;
631
+ const data = model.createSnapshot({ context: context, outputSizeLimit: outputSizeLimit, transientOptions: serializer.options });
632
+ const indentAmount = model.metadata.indentAmount;
633
+ if (typeof indentAmount === 'string' && indentAmount) {
634
+ data.metadata.indentAmount = indentAmount;
635
+ }
636
+ const bytes = await serializer.notebookToData(data);
637
+ if (token.isCancellationRequested) {
638
+ throw ( new CancellationError());
639
+ }
640
+ return bufferToStream(bytes);
641
+ }
642
+ async restoreNotebookTextModelFromSnapshot(uri, viewType, snapshot) {
643
+ const model = this.getNotebookTextModel(uri);
644
+ if (!model) {
645
+ throw ( new Error(`notebook for ${uri} doesn't exist`));
646
+ }
647
+ const info = await this.withNotebookDataProvider(model.viewType);
648
+ if (!(info instanceof SimpleNotebookProviderInfo)) {
649
+ throw ( new Error('CANNOT open file notebook with this provider'));
650
+ }
651
+ const serializer = info.serializer;
652
+ const bytes = await streamToBuffer(snapshot);
653
+ const data = await info.serializer.dataToNotebook(bytes);
654
+ model.restoreSnapshot(data, serializer.options);
655
+ return model;
656
+ }
618
657
  getNotebookTextModel(uri) {
619
658
  return this._models.get(uri)?.model;
620
659
  }
621
660
  getNotebookTextModels() {
622
- return (
623
- (Iterable.map( (this._models.values()), data => data.model))
624
- );
661
+ return ( Iterable.map(( this._models.values()), data => data.model));
625
662
  }
626
663
  listNotebookDocuments() {
627
- return (
628
- ([...this._models].map(e => e[1].model))
629
- );
664
+ return ( [...this._models].map(e => e[1].model));
630
665
  }
631
666
  _onWillDisposeDocument(model) {
632
667
  const modelData = this._models.get(model.uri);
@@ -639,7 +674,7 @@ let NotebookService = class NotebookService extends Disposable {
639
674
  }
640
675
  }
641
676
  getOutputMimeTypeInfo(textModel, kernelProvides, output) {
642
- const sorted = this._displayOrder.sort(( (new Set( (output.outputs.map(op => op.mime))))));
677
+ const sorted = this._displayOrder.sort(( new Set(( output.outputs.map(op => op.mime)))));
643
678
  const notebookProviderInfo = this.notebookProviderInfoStore.get(textModel.viewType);
644
679
  return sorted
645
680
  .flatMap(mimeType => this._notebookRenderersInfoStore.findBestRenderers(notebookProviderInfo, mimeType, kernelProvides))
@@ -651,6 +686,14 @@ let NotebookService = class NotebookService extends Disposable {
651
686
  }
652
687
  return [...this.notebookProviderInfoStore];
653
688
  }
689
+ hasSupportedNotebooks(resource) {
690
+ const contribution = this.notebookProviderInfoStore.getContributedNotebook(resource);
691
+ if (!contribution.length) {
692
+ return false;
693
+ }
694
+ return ( contribution.some(info => info.matches(resource) &&
695
+ (info.priority === RegisteredEditorPriority.default || info.priority === RegisteredEditorPriority.exclusive)));
696
+ }
654
697
  getContributedNotebookType(viewType) {
655
698
  return this.notebookProviderInfoStore.get(viewType);
656
699
  }
@@ -674,13 +717,13 @@ let NotebookService = class NotebookService extends Disposable {
674
717
  return undefined;
675
718
  }
676
719
  };
677
- NotebookService = NotebookService_1 = ( (__decorate([
678
- ( (__param(0, IExtensionService))),
679
- ( (__param(1, IConfigurationService))),
680
- ( (__param(2, IAccessibilityService))),
681
- ( (__param(3, IInstantiationService))),
682
- ( (__param(4, IStorageService))),
683
- ( (__param(5, INotebookDocumentService)))
684
- ], NotebookService)));
720
+ NotebookService = NotebookService_1 = ( __decorate([
721
+ ( __param(0, IExtensionService)),
722
+ ( __param(1, IConfigurationService)),
723
+ ( __param(2, IAccessibilityService)),
724
+ ( __param(3, IInstantiationService)),
725
+ ( __param(4, IStorageService)),
726
+ ( __param(5, INotebookDocumentService))
727
+ ], NotebookService));
685
728
 
686
729
  export { NotebookOutputRendererInfoStore, NotebookProviderInfoStore, NotebookService };
@@ -0,0 +1,14 @@
1
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { URI } from "vscode/vscode/vs/base/common/uri";
3
+ import { INotebookDiffResult } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
4
+ import { INotebookService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
5
+ import { INotebookEditorWorkerService } from "vscode/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service";
6
+ import { IModelService } from "vscode/vscode/vs/editor/common/services/model";
7
+ export declare class NotebookEditorWorkerServiceImpl extends Disposable implements INotebookEditorWorkerService {
8
+ readonly _serviceBrand: undefined;
9
+ private readonly _workerManager;
10
+ constructor(notebookService: INotebookService, modelService: IModelService);
11
+ canComputeDiff(original: URI, modified: URI): boolean;
12
+ computeDiff(original: URI, modified: URI): Promise<INotebookDiffResult>;
13
+ canPromptRecommendation(model: URI): Promise<boolean>;
14
+ }
@@ -1,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { Disposable, DisposableStore, toDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
3
4
  import { createWebWorker } from 'vscode/vscode/vs/base/browser/defaultWorkerFactory';
4
5
  import { CellUri, NotebookCellsChangeType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
@@ -0,0 +1,21 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { IOutlineModelService } from "vscode/vscode/vs/editor/contrib/documentSymbols/browser/outlineModel";
3
+ import { ICellViewModel } from "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
4
+ import { OutlineEntry } from "@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry";
5
+ import { INotebookExecutionStateService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service";
6
+ import { ITextModelService } from "vscode/vscode/vs/editor/common/services/resolverService";
7
+ import { INotebookOutlineEntryFactory } from "@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.service";
8
+ export declare enum NotebookOutlineConstants {
9
+ NonHeaderOutlineLevel = 7
10
+ }
11
+ export declare class NotebookOutlineEntryFactory implements INotebookOutlineEntryFactory {
12
+ private readonly executionStateService;
13
+ private readonly outlineModelService;
14
+ private readonly textModelService;
15
+ readonly _serviceBrand: undefined;
16
+ private cellOutlineEntryCache;
17
+ private readonly cachedMarkdownOutlineEntries;
18
+ constructor(executionStateService: INotebookExecutionStateService, outlineModelService: IOutlineModelService, textModelService: ITextModelService);
19
+ getOutlineEntries(cell: ICellViewModel, index: number): OutlineEntry[];
20
+ cacheSymbols(cell: ICellViewModel, cancelToken: CancellationToken): Promise<void>;
21
+ }