@codingame/monaco-vscode-api 37.1.0 → 37.2.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 (313) hide show
  1. package/missing-services.js +6 -26
  2. package/package.json +8 -8
  3. package/services.d.ts +1 -1
  4. package/services.js +3 -3
  5. package/tools.d.ts +4 -0
  6. package/tools.js +24 -1
  7. package/vscode/src/vs/platform/product/common/product.js +1 -1
  8. package/vscode/src/vs/platform/webWorker/browser/webWorkerServiceImpl.js +2 -2
  9. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.d.ts +63 -0
  10. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +305 -0
  11. package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +2 -2
  12. package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +1 -2
  13. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  14. package/vscode/src/vs/workbench/browser/media/code-icon.svg +1 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.d.ts +1 -0
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +2 -1
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +2 -2
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service.d.ts +1 -1
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.d.ts +30 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.js +39 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service.d.ts +1 -1
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.service.d.ts +1 -1
  23. package/vscode/src/vs/workbench/contrib/chat/browser/chat.d.ts +1 -1
  24. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service.d.ts +1 -1
  25. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.d.ts +1 -1
  26. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.service.d.ts +1 -1
  27. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.service.d.ts +1 -1
  28. package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.d.ts +1 -0
  29. package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.js +29 -0
  30. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.d.ts +2 -2
  31. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.service.d.ts +1 -1
  32. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.d.ts +1 -1
  33. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.d.ts +2 -2
  34. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.service.d.ts +1 -1
  35. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.d.ts +1 -1
  36. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service.d.ts +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.d.ts +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginSource.d.ts +1 -1
  39. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatParserTypes.d.ts +1 -1
  40. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.d.ts +3 -0
  41. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.js +7 -0
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.d.ts +3 -3
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service.d.ts +1 -1
  44. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.d.ts +1 -1
  45. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.d.ts +1 -1
  46. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.d.ts +1 -1
  47. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.service.d.ts +1 -1
  48. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service.d.ts +1 -1
  49. package/vscode/src/vs/workbench/contrib/notebook/common/notebookService.service.d.ts +1 -1
  50. package/vscode/src/vs/workbench/contrib/search/browser/AISearch/aiSearchModel.d.ts +1 -1
  51. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModel.d.ts +1 -1
  52. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModelBase.d.ts +1 -1
  53. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/folderMatch.d.ts +1 -1
  54. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/searchTreeCommon.d.ts +1 -1
  55. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +4 -3
  56. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.d.ts +34 -0
  57. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.js +72 -0
  58. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.d.ts +44 -0
  59. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.js +96 -0
  60. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css +1148 -0
  61. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.d.ts +81 -0
  62. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.js +97 -0
  63. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.d.ts +32 -0
  64. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +45 -0
  65. package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.d.ts +0 -7
  66. package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.js +0 -92
  67. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.d.ts +0 -12
  68. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +0 -64
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.d.ts +0 -262
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +0 -865
  71. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +0 -57
  72. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +0 -311
  73. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.d.ts +0 -15
  74. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -80
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +0 -2
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +0 -57
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -231
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1850
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -109
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -85
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +0 -140
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +0 -186
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.d.ts +0 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.js +0 -5
  85. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.d.ts +0 -46
  86. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.js +0 -17
  87. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +0 -253
  88. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +0 -20
  89. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +0 -34
  90. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +0 -194
  91. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -87
  92. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -69
  93. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +0 -300
  94. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +0 -272
  95. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -25
  96. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -178
  97. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -78
  98. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -51
  99. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
  100. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
  101. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -67
  102. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -294
  103. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -212
  104. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -955
  105. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
  106. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
  107. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +0 -65
  108. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +0 -697
  109. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.d.ts +0 -150
  110. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.js +0 -142
  111. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
  112. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -77
  113. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
  114. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
  115. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
  116. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
  117. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +0 -92
  118. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +0 -335
  119. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -235
  120. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1673
  121. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -202
  122. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -872
  123. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.d.ts +0 -35
  124. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.js +0 -289
  125. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.d.ts +0 -72
  126. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +0 -600
  127. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +0 -36
  128. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +0 -239
  129. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +0 -22
  130. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +0 -143
  131. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +0 -24
  132. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +0 -298
  133. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +0 -25
  134. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +0 -177
  135. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +0 -73
  136. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +0 -577
  137. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +0 -11
  138. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +0 -90
  139. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +0 -16
  140. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +0 -130
  141. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +0 -12
  142. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +0 -53
  143. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +0 -5
  144. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +0 -12
  145. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +0 -10
  146. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +0 -92
  147. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +0 -38
  148. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +0 -518
  149. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +0 -6
  150. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +0 -231
  151. package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.d.ts +0 -20
  152. package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.js +0 -17
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.d.ts +0 -6
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +0 -283
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.d.ts +0 -91
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +0 -340
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.d.ts +0 -17
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +0 -272
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css +0 -686
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css +0 -348
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css +0 -8
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css +0 -92
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css +0 -119
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css +0 -79
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css +0 -61
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditController.css +0 -55
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditorOverlay.css +0 -63
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css +0 -79
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css +0 -63
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css +0 -92
  171. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css +0 -79
  172. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css +0 -24
  173. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css +0 -61
  174. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css +0 -102
  175. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.d.ts +0 -27
  176. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +0 -131
  177. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.d.ts +0 -18
  178. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.js +0 -92
  179. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.d.ts +0 -105
  180. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +0 -673
  181. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.d.ts +0 -9
  182. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +0 -37
  183. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.d.ts +0 -354
  184. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2926
  185. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.d.ts +0 -29
  186. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +0 -36
  187. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.d.ts +0 -1
  188. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +0 -19
  189. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.d.ts +0 -200
  190. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +0 -591
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.d.ts +0 -56
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +0 -30
  193. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.d.ts +0 -99
  194. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +0 -131
  195. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.d.ts +0 -30
  196. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +0 -115
  197. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.d.ts +0 -28
  198. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +0 -158
  199. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.d.ts +0 -40
  200. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +0 -183
  201. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.d.ts +0 -10
  202. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +0 -66
  203. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.d.ts +0 -52
  204. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +0 -429
  205. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.d.ts +0 -6
  206. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +0 -108
  207. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.d.ts +0 -36
  208. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +0 -221
  209. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.d.ts +0 -17
  210. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +0 -142
  211. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.d.ts +0 -5
  212. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +0 -23
  213. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.d.ts +0 -18
  214. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +0 -104
  215. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.d.ts +0 -92
  216. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +0 -762
  217. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.d.ts +0 -15
  218. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +0 -58
  219. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.d.ts +0 -36
  220. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +0 -357
  221. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.d.ts +0 -6
  222. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +0 -32
  223. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.d.ts +0 -47
  224. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +0 -260
  225. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.d.ts +0 -9
  226. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.js +0 -10
  227. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.d.ts +0 -10
  228. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +0 -24
  229. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.d.ts +0 -182
  230. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +0 -796
  231. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.d.ts +0 -13
  232. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +0 -79
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.d.ts +0 -30
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +0 -126
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.d.ts +0 -6
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +0 -32
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.d.ts +0 -8
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +0 -50
  239. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.d.ts +0 -18
  240. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +0 -119
  241. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.d.ts +0 -57
  242. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +0 -443
  243. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.d.ts +0 -20
  244. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +0 -56
  245. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.d.ts +0 -24
  246. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.js +0 -121
  247. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.d.ts +0 -152
  248. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +0 -1288
  249. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.d.ts +0 -59
  250. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +0 -287
  251. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.d.ts +0 -117
  252. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.js +0 -6
  253. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.d.ts +0 -222
  254. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +0 -1840
  255. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.d.ts +0 -63
  256. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +0 -449
  257. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.d.ts +0 -432
  258. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.d.ts +0 -18
  259. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +0 -2546
  260. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.d.ts +0 -8
  261. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +0 -105
  262. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.d.ts +0 -137
  263. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +0 -646
  264. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.d.ts +0 -21
  265. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +0 -101
  266. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.d.ts +0 -13
  267. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.js +0 -111
  268. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.d.ts +0 -30
  269. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +0 -65
  270. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.d.ts +0 -13
  271. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +0 -49
  272. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.d.ts +0 -89
  273. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +0 -472
  274. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.d.ts +0 -11
  275. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +0 -34
  276. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.d.ts +0 -33
  277. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +0 -275
  278. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.d.ts +0 -69
  279. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +0 -269
  280. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.d.ts +0 -125
  281. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +0 -958
  282. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.d.ts +0 -9
  283. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +0 -11
  284. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.d.ts +0 -20
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.js +0 -101
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.d.ts +0 -65
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +0 -458
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.d.ts +0 -80
  289. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +0 -708
  290. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.d.ts +0 -37
  291. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +0 -193
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.d.ts +0 -7
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.js +0 -62
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.d.ts +0 -108
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +0 -717
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.d.ts +0 -23
  297. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +0 -183
  298. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.d.ts +0 -11
  299. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +0 -134
  300. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.d.ts +0 -20
  301. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +0 -135
  302. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.d.ts +0 -27
  303. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +0 -213
  304. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.d.ts +0 -27
  305. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +0 -104
  306. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.d.ts +0 -115
  307. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +0 -480
  308. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.d.ts +0 -87
  309. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +0 -352
  310. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.d.ts +0 -81
  311. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.js +0 -9
  312. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.d.ts +0 -10
  313. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +0 -19
@@ -1,958 +0,0 @@
1
-
2
- import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
3
- import { groupBy } from '../../../../../base/common/collections.js';
4
- import { onUnexpectedError } from '../../../../../base/common/errors.js';
5
- import { Emitter } from '../../../../../base/common/event.js';
6
- import { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';
7
- import { clamp } from '../../../../../base/common/numbers.js';
8
- import { singleLetterHash } from '../../../../../base/common/strings.js';
9
- import { ResourceTextEdit } from '../../../../../editor/browser/services/bulkEditService.js';
10
- import { IBulkEditService } from '../../../../../editor/browser/services/bulkEditService.service.js';
11
- import { Range } from '../../../../../editor/common/core/range.js';
12
- import { TrackedRangeStickiness } from '../../../../../editor/common/model.js';
13
- import { SingleModelEditStackElement, MultiModelEditStackElement } from '../../../../../editor/common/model/editStack.js';
14
- import { IntervalTree, IntervalNode } from '../../../../../editor/common/model/intervalTree.js';
15
- import { ModelDecorationOptions } from '../../../../../editor/common/model/textModel.js';
16
- import { ITextModelService } from '../../../../../editor/common/services/resolverService.service.js';
17
- import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
18
- import { IUndoRedoService } from '../../../../../platform/undoRedo/common/undoRedo.service.js';
19
- import { CellFindMatchModel } from '../contrib/find/findModel.js';
20
- import { CellFoldingState, isNotebookCellDecoration, CellEditState } from '../notebookBrowser.js';
21
- import { NotebookMetadataChangedEvent } from '../notebookViewEvents.js';
22
- import { NotebookCellSelectionCollection } from './cellSelectionCollection.js';
23
- import { CodeCellViewModel } from './codeCellViewModel.js';
24
- import { MarkupCellViewModel } from './markupCellViewModel.js';
25
- import { NotebookCellsChangeType, CellKind, SelectionStateType, NotebookFindScopeType } from '../../common/notebookCommon.js';
26
- import { NotebookExecutionType } from '../../common/notebookExecutionStateService.js';
27
- import { INotebookExecutionStateService } from '../../common/notebookExecutionStateService.service.js';
28
- import { cellRangesToIndexes, cellIndexesToRanges, reduceCellRanges } from '../../common/notebookRange.js';
29
-
30
- const invalidFunc = () => {
31
- throw ( new Error(`Invalid change accessor`));
32
- };
33
- class DecorationsTree {
34
- constructor() {
35
- this._decorationsTree = ( new IntervalTree());
36
- }
37
- intervalSearch(
38
- start,
39
- end,
40
- filterOwnerId,
41
- filterOutValidation,
42
- filterFontDecorations,
43
- cachedVersionId,
44
- onlyMarginDecorations = false
45
- ) {
46
- const r1 = this._decorationsTree.intervalSearch(
47
- start,
48
- end,
49
- filterOwnerId,
50
- filterOutValidation,
51
- filterFontDecorations,
52
- cachedVersionId,
53
- onlyMarginDecorations
54
- );
55
- return r1;
56
- }
57
- search(
58
- filterOwnerId,
59
- filterOutValidation,
60
- filterFontDecorations,
61
- overviewRulerOnly,
62
- cachedVersionId,
63
- onlyMarginDecorations
64
- ) {
65
- return this._decorationsTree.search(
66
- filterOwnerId,
67
- filterOutValidation,
68
- filterFontDecorations,
69
- cachedVersionId,
70
- onlyMarginDecorations
71
- );
72
- }
73
- collectNodesFromOwner(ownerId) {
74
- const r1 = this._decorationsTree.collectNodesFromOwner(ownerId);
75
- return r1;
76
- }
77
- collectNodesPostOrder() {
78
- const r1 = this._decorationsTree.collectNodesPostOrder();
79
- return r1;
80
- }
81
- insert(node) {
82
- this._decorationsTree.insert(node);
83
- }
84
- delete(node) {
85
- this._decorationsTree.delete(node);
86
- }
87
- resolveNode(node, cachedVersionId) {
88
- this._decorationsTree.resolveNode(node, cachedVersionId);
89
- }
90
- acceptReplace(offset, length, textLength, forceMoveMarkers) {
91
- this._decorationsTree.acceptReplace(offset, length, textLength, forceMoveMarkers);
92
- }
93
- }
94
- const TRACKED_RANGE_OPTIONS = [ModelDecorationOptions.register({
95
- description: "notebook-view-model-tracked-range-always-grows-when-typing-at-edges",
96
- stickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges
97
- }), ModelDecorationOptions.register({
98
- description: "notebook-view-model-tracked-range-never-grows-when-typing-at-edges",
99
- stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
100
- }), ModelDecorationOptions.register({
101
- description: "notebook-view-model-tracked-range-grows-only-when-typing-before",
102
- stickiness: TrackedRangeStickiness.GrowsOnlyWhenTypingBefore
103
- }), ModelDecorationOptions.register({
104
- description: "notebook-view-model-tracked-range-grows-only-when-typing-after",
105
- stickiness: TrackedRangeStickiness.GrowsOnlyWhenTypingAfter
106
- })];
107
- function _normalizeOptions(options) {
108
- if (options instanceof ModelDecorationOptions) {
109
- return options;
110
- }
111
- return ModelDecorationOptions.createDynamic(options);
112
- }
113
- let MODEL_ID = 0;
114
- let NotebookViewModel = class NotebookViewModel extends Disposable {
115
- get options() {
116
- return this._options;
117
- }
118
- get onDidChangeOptions() {
119
- return this._onDidChangeOptions.event;
120
- }
121
- get viewCells() {
122
- return this._viewCells;
123
- }
124
- get length() {
125
- return this._viewCells.length;
126
- }
127
- get notebookDocument() {
128
- return this._notebook;
129
- }
130
- get uri() {
131
- return this._notebook.uri;
132
- }
133
- get metadata() {
134
- return this._notebook.metadata;
135
- }
136
- get isRepl() {
137
- return this.viewType === "repl";
138
- }
139
- get onDidChangeViewCells() {
140
- return this._onDidChangeViewCells.event;
141
- }
142
- get lastNotebookEditResource() {
143
- if (this._lastNotebookEditResource.length) {
144
- return this._lastNotebookEditResource[this._lastNotebookEditResource.length - 1];
145
- }
146
- return null;
147
- }
148
- get layoutInfo() {
149
- return this._layoutInfo;
150
- }
151
- get onDidChangeSelection() {
152
- return this._onDidChangeSelection.event;
153
- }
154
- get selectionHandles() {
155
- const handlesSet = ( new Set());
156
- const handles = [];
157
- ( cellRangesToIndexes(this._selectionCollection.selections).map(index => index < this.length ? this.cellAt(index) : undefined)).forEach(cell => {
158
- if (cell && !( handlesSet.has(cell.handle))) {
159
- handlesSet.add(cell.handle);
160
- handles.push(cell.handle);
161
- }
162
- });
163
- return handles;
164
- }
165
- set selectionHandles(selectionHandles) {
166
- const indexes = ( selectionHandles.map(handle => this._viewCells.findIndex(cell => cell.handle === handle)));
167
- this._selectionCollection.setSelections(cellIndexesToRanges(indexes), true, "model");
168
- }
169
- get focused() {
170
- return this._focused;
171
- }
172
- constructor(
173
- viewType,
174
- _notebook,
175
- _viewContext,
176
- _layoutInfo,
177
- _options,
178
- _instantiationService,
179
- _bulkEditService,
180
- _undoService,
181
- _textModelService,
182
- notebookExecutionStateService
183
- ) {
184
- super();
185
- this.viewType = viewType;
186
- this._notebook = _notebook;
187
- this._viewContext = _viewContext;
188
- this._layoutInfo = _layoutInfo;
189
- this._options = _options;
190
- this._instantiationService = _instantiationService;
191
- this._bulkEditService = _bulkEditService;
192
- this._undoService = _undoService;
193
- this._textModelService = _textModelService;
194
- this.notebookExecutionStateService = notebookExecutionStateService;
195
- this._localStore = this._register(( new DisposableStore()));
196
- this._handleToViewCellMapping = ( new Map());
197
- this._onDidChangeOptions = this._register(( new Emitter()));
198
- this._viewCells = [];
199
- this._onDidChangeViewCells = this._register(( new Emitter()));
200
- this._lastNotebookEditResource = [];
201
- this._onDidChangeSelection = this._register(( new Emitter()));
202
- this._selectionCollection = this._register(( new NotebookCellSelectionCollection()));
203
- this._decorationsTree = ( new DecorationsTree());
204
- this._decorations = Object.create(null);
205
- this._lastDecorationId = 0;
206
- this._foldingRanges = null;
207
- this._onDidFoldingStateChanged = this._register(( new Emitter()));
208
- this.onDidFoldingStateChanged = this._onDidFoldingStateChanged.event;
209
- this._hiddenRanges = [];
210
- this._focused = true;
211
- this._decorationIdToCellMap = ( new Map());
212
- this._statusBarItemIdToCellMap = ( new Map());
213
- this._lastOverviewRulerDecorationId = 0;
214
- this._overviewRulerDecorations = ( new Map());
215
- MODEL_ID++;
216
- this.id = "$notebookViewModel" + MODEL_ID;
217
- this._instanceId = singleLetterHash(MODEL_ID);
218
- const compute = (changes, synchronous) => {
219
- const diffs = ( changes.map(splice => {
220
- return [splice[0], splice[1], ( splice[2].map(cell => {
221
- return createCellViewModel(this._instantiationService, this, cell, this._viewContext);
222
- }))];
223
- }));
224
- diffs.reverse().forEach(diff => {
225
- const deletedCells = this._viewCells.splice(diff[0], diff[1], ...diff[2]);
226
- this._decorationsTree.acceptReplace(diff[0], diff[1], diff[2].length, true);
227
- deletedCells.forEach(cell => {
228
- this._handleToViewCellMapping.delete(cell.handle);
229
- this._localStore.delete(cell);
230
- });
231
- diff[2].forEach(cell => {
232
- this._handleToViewCellMapping.set(cell.handle, cell);
233
- this._localStore.add(cell);
234
- });
235
- });
236
- const selectionHandles = this.selectionHandles;
237
- this._onDidChangeViewCells.fire({
238
- synchronous: synchronous,
239
- splices: diffs
240
- });
241
- let endSelectionHandles = [];
242
- if (selectionHandles.length) {
243
- const primaryHandle = selectionHandles[0];
244
- const primarySelectionIndex = this._viewCells.indexOf(this.getCellByHandle(primaryHandle));
245
- endSelectionHandles = [primaryHandle];
246
- let delta = 0;
247
- for (let i = 0; i < diffs.length; i++) {
248
- const diff = diffs[0];
249
- if (diff[0] + diff[1] <= primarySelectionIndex) {
250
- delta += diff[2].length - diff[1];
251
- continue;
252
- }
253
- if (diff[0] > primarySelectionIndex) {
254
- endSelectionHandles = [primaryHandle];
255
- break;
256
- }
257
- if (diff[0] + diff[1] > primarySelectionIndex) {
258
- endSelectionHandles = [this._viewCells[diff[0] + delta].handle];
259
- break;
260
- }
261
- }
262
- }
263
- const selectionIndexes = ( endSelectionHandles.map(handle => this._viewCells.findIndex(cell => cell.handle === handle)));
264
- this._selectionCollection.setState(
265
- cellIndexesToRanges([selectionIndexes[0]])[0],
266
- cellIndexesToRanges(selectionIndexes),
267
- true,
268
- "model"
269
- );
270
- };
271
- this._register(this._notebook.onDidChangeContent(e => {
272
- for (let i = 0; i < e.rawEvents.length; i++) {
273
- const change = e.rawEvents[i];
274
- let changes = [];
275
- const synchronous = e.synchronous ?? true;
276
- if (change.kind === NotebookCellsChangeType.ModelChange || change.kind === NotebookCellsChangeType.Initialize) {
277
- changes = change.changes;
278
- compute(changes, synchronous);
279
- continue;
280
- } else if (change.kind === NotebookCellsChangeType.Move) {
281
- compute([[change.index, change.length, []]], synchronous);
282
- compute([[change.newIdx, 0, change.cells]], synchronous);
283
- } else {
284
- continue;
285
- }
286
- }
287
- }));
288
- this._register(this._notebook.onDidChangeContent(contentChanges => {
289
- contentChanges.rawEvents.forEach(e => {
290
- if (e.kind === NotebookCellsChangeType.ChangeDocumentMetadata) {
291
- this._viewContext.eventDispatcher.emit([( new NotebookMetadataChangedEvent(this._notebook.metadata))]);
292
- }
293
- });
294
- if (contentChanges.endSelectionState) {
295
- this.updateSelectionsState(contentChanges.endSelectionState);
296
- }
297
- }));
298
- this._register(this._viewContext.eventDispatcher.onDidChangeLayout(e => {
299
- this._layoutInfo = e.value;
300
- this._viewCells.forEach(cell => {
301
- if (cell.cellKind === CellKind.Markup) {
302
- if (e.source.width || e.source.fontInfo) {
303
- cell.layoutChange({
304
- outerWidth: e.value.width,
305
- font: e.value.fontInfo
306
- });
307
- }
308
- } else {
309
- if (e.source.width !== undefined) {
310
- cell.layoutChange({
311
- outerWidth: e.value.width,
312
- font: e.value.fontInfo
313
- });
314
- }
315
- }
316
- });
317
- }));
318
- this._register(this._viewContext.notebookOptions.onDidChangeOptions(e => {
319
- for (let i = 0; i < this.length; i++) {
320
- const cell = this._viewCells[i];
321
- cell.updateOptions(e);
322
- }
323
- }));
324
- this._register(notebookExecutionStateService.onDidChangeExecution(e => {
325
- if (e.type !== NotebookExecutionType.cell) {
326
- return;
327
- }
328
- const cell = this.getCellByHandle(e.cellHandle);
329
- if (cell instanceof CodeCellViewModel) {
330
- cell.updateExecutionState(e);
331
- }
332
- }));
333
- this._register(this._selectionCollection.onDidChangeSelection(e => {
334
- this._onDidChangeSelection.fire(e);
335
- }));
336
- const viewCellCount = this.isRepl ? this._notebook.cells.length - 1 : this._notebook.cells.length;
337
- for (let i = 0; i < viewCellCount; i++) {
338
- this._viewCells.push(createCellViewModel(
339
- this._instantiationService,
340
- this,
341
- this._notebook.cells[i],
342
- this._viewContext
343
- ));
344
- }
345
- this._viewCells.forEach(cell => {
346
- this._handleToViewCellMapping.set(cell.handle, cell);
347
- });
348
- }
349
- updateOptions(newOptions) {
350
- this._options = {
351
- ...this._options,
352
- ...newOptions
353
- };
354
- this._viewCells.forEach(cell => cell.updateOptions({
355
- readonly: this._options.isReadOnly
356
- }));
357
- this._onDidChangeOptions.fire();
358
- }
359
- getFocus() {
360
- return this._selectionCollection.focus;
361
- }
362
- getSelections() {
363
- return this._selectionCollection.selections;
364
- }
365
- getMostRecentlyExecutedCell() {
366
- const handle = this.notebookExecutionStateService.getLastCompletedCellForNotebook(this._notebook.uri);
367
- return handle !== undefined ? this.getCellByHandle(handle) : undefined;
368
- }
369
- setEditorFocus(focused) {
370
- this._focused = focused;
371
- }
372
- validateRange(cellRange) {
373
- if (!cellRange) {
374
- return null;
375
- }
376
- const start = clamp(cellRange.start, 0, this.length);
377
- const end = clamp(cellRange.end, 0, this.length);
378
- if (start <= end) {
379
- return {
380
- start,
381
- end
382
- };
383
- } else {
384
- return {
385
- start: end,
386
- end: start
387
- };
388
- }
389
- }
390
- updateSelectionsState(state, source = "model") {
391
- if (this._focused || source === "model") {
392
- if (state.kind === SelectionStateType.Handle) {
393
- const primaryIndex = state.primary !== null ? this.getCellIndexByHandle(state.primary) : null;
394
- const primarySelection = primaryIndex !== null ? this.validateRange({
395
- start: primaryIndex,
396
- end: primaryIndex + 1
397
- }) : null;
398
- const selections = ( cellIndexesToRanges(( state.selections.map(sel => this.getCellIndexByHandle(sel)))).map(range => this.validateRange(range))).filter(range => range !== null);
399
- this._selectionCollection.setState(primarySelection, reduceCellRanges(selections), true, source);
400
- } else {
401
- const primarySelection = this.validateRange(state.focus);
402
- const selections = ( state.selections.map(range => this.validateRange(range))).filter(range => range !== null);
403
- this._selectionCollection.setState(primarySelection, reduceCellRanges(selections), true, source);
404
- }
405
- }
406
- }
407
- getFoldingStartIndex(index) {
408
- if (!this._foldingRanges) {
409
- return -1;
410
- }
411
- const range = this._foldingRanges.findRange(index + 1);
412
- const startIndex = this._foldingRanges.getStartLineNumber(range) - 1;
413
- return startIndex;
414
- }
415
- getFoldingState(index) {
416
- if (!this._foldingRanges) {
417
- return CellFoldingState.None;
418
- }
419
- const range = this._foldingRanges.findRange(index + 1);
420
- const startIndex = this._foldingRanges.getStartLineNumber(range) - 1;
421
- if (startIndex !== index) {
422
- return CellFoldingState.None;
423
- }
424
- return this._foldingRanges.isCollapsed(range) ? CellFoldingState.Collapsed : CellFoldingState.Expanded;
425
- }
426
- getFoldedLength(index) {
427
- if (!this._foldingRanges) {
428
- return 0;
429
- }
430
- const range = this._foldingRanges.findRange(index + 1);
431
- const startIndex = this._foldingRanges.getStartLineNumber(range) - 1;
432
- const endIndex = this._foldingRanges.getEndLineNumber(range) - 1;
433
- return endIndex - startIndex;
434
- }
435
- updateFoldingRanges(ranges) {
436
- this._foldingRanges = ranges;
437
- let updateHiddenAreas = false;
438
- const newHiddenAreas = [];
439
- let i = 0;
440
- let k = 0;
441
- let lastCollapsedStart = Number.MAX_VALUE;
442
- let lastCollapsedEnd = -1;
443
- for (; i < ranges.length; i++) {
444
- if (!ranges.isCollapsed(i)) {
445
- continue;
446
- }
447
- const startLineNumber = ranges.getStartLineNumber(i) + 1;
448
- const endLineNumber = ranges.getEndLineNumber(i);
449
- if (lastCollapsedStart <= startLineNumber && endLineNumber <= lastCollapsedEnd) {
450
- continue;
451
- }
452
- if (!updateHiddenAreas && k < this._hiddenRanges.length && this._hiddenRanges[k].start + 1 === startLineNumber && (this._hiddenRanges[k].end + 1) === endLineNumber) {
453
- newHiddenAreas.push(this._hiddenRanges[k]);
454
- k++;
455
- } else {
456
- updateHiddenAreas = true;
457
- newHiddenAreas.push({
458
- start: startLineNumber - 1,
459
- end: endLineNumber - 1
460
- });
461
- }
462
- lastCollapsedStart = startLineNumber;
463
- lastCollapsedEnd = endLineNumber;
464
- }
465
- if (updateHiddenAreas || k < this._hiddenRanges.length) {
466
- this._hiddenRanges = newHiddenAreas;
467
- this._onDidFoldingStateChanged.fire();
468
- }
469
- this._viewCells.forEach(cell => {
470
- if (cell.cellKind === CellKind.Markup) {
471
- cell.triggerFoldingStateChange();
472
- }
473
- });
474
- }
475
- getHiddenRanges() {
476
- return this._hiddenRanges;
477
- }
478
- getOverviewRulerDecorations() {
479
- return Array.from(( this._overviewRulerDecorations.values()));
480
- }
481
- getCellByHandle(handle) {
482
- return this._handleToViewCellMapping.get(handle);
483
- }
484
- getCellIndexByHandle(handle) {
485
- return this._viewCells.findIndex(cell => cell.handle === handle);
486
- }
487
- getCellIndex(cell) {
488
- return this._viewCells.indexOf(cell);
489
- }
490
- cellAt(index) {
491
- return this._viewCells[index];
492
- }
493
- getCellsInRange(range) {
494
- if (!range) {
495
- return this._viewCells.slice(0);
496
- }
497
- const validatedRange = this.validateRange(range);
498
- if (validatedRange) {
499
- const result = [];
500
- for (let i = validatedRange.start; i < validatedRange.end; i++) {
501
- result.push(this._viewCells[i]);
502
- }
503
- return result;
504
- }
505
- return [];
506
- }
507
- getNearestVisibleCellIndexUpwards(index) {
508
- for (let i = this._hiddenRanges.length - 1; i >= 0; i--) {
509
- const cellRange = this._hiddenRanges[i];
510
- const foldStart = cellRange.start - 1;
511
- const foldEnd = cellRange.end;
512
- if (foldStart > index) {
513
- continue;
514
- }
515
- if (foldStart <= index && foldEnd >= index) {
516
- return index;
517
- }
518
- break;
519
- }
520
- return index;
521
- }
522
- getNextVisibleCellIndex(index) {
523
- for (let i = 0; i < this._hiddenRanges.length; i++) {
524
- const cellRange = this._hiddenRanges[i];
525
- const foldStart = cellRange.start - 1;
526
- const foldEnd = cellRange.end;
527
- if (foldEnd < index) {
528
- continue;
529
- }
530
- if (foldStart <= index) {
531
- return foldEnd + 1;
532
- }
533
- break;
534
- }
535
- return index + 1;
536
- }
537
- getPreviousVisibleCellIndex(index) {
538
- for (let i = this._hiddenRanges.length - 1; i >= 0; i--) {
539
- const cellRange = this._hiddenRanges[i];
540
- const foldStart = cellRange.start - 1;
541
- const foldEnd = cellRange.end;
542
- if (foldEnd < index) {
543
- return index;
544
- }
545
- if (foldStart <= index) {
546
- return foldStart;
547
- }
548
- }
549
- return index;
550
- }
551
- hasCell(cell) {
552
- return ( this._handleToViewCellMapping.has(cell.handle));
553
- }
554
- getVersionId() {
555
- return this._notebook.versionId;
556
- }
557
- getAlternativeId() {
558
- return this._notebook.alternativeVersionId;
559
- }
560
- getTrackedRange(id) {
561
- return this._getDecorationRange(id);
562
- }
563
- _getDecorationRange(decorationId) {
564
- const node = this._decorations[decorationId];
565
- if (!node) {
566
- return null;
567
- }
568
- const versionId = this.getVersionId();
569
- if (node.cachedVersionId !== versionId) {
570
- this._decorationsTree.resolveNode(node, versionId);
571
- }
572
- if (node.range === null) {
573
- return {
574
- start: node.cachedAbsoluteStart - 1,
575
- end: node.cachedAbsoluteEnd - 1
576
- };
577
- }
578
- return {
579
- start: node.range.startLineNumber - 1,
580
- end: node.range.endLineNumber - 1
581
- };
582
- }
583
- setTrackedRange(id, newRange, newStickiness) {
584
- const node = (id ? this._decorations[id] : null);
585
- if (!node) {
586
- if (!newRange) {
587
- return null;
588
- }
589
- return this._deltaCellDecorationsImpl(0, [], [{
590
- range: ( new Range(newRange.start + 1, 1, newRange.end + 1, 1)),
591
- options: TRACKED_RANGE_OPTIONS[newStickiness]
592
- }])[0];
593
- }
594
- if (!newRange) {
595
- this._decorationsTree.delete(node);
596
- delete this._decorations[node.id];
597
- return null;
598
- }
599
- this._decorationsTree.delete(node);
600
- node.reset(this.getVersionId(), newRange.start, newRange.end + 1, ( new Range(newRange.start + 1, 1, newRange.end + 1, 1)));
601
- node.setOptions(TRACKED_RANGE_OPTIONS[newStickiness]);
602
- this._decorationsTree.insert(node);
603
- return node.id;
604
- }
605
- _deltaCellDecorationsImpl(ownerId, oldDecorationsIds, newDecorations) {
606
- const versionId = this.getVersionId();
607
- const oldDecorationsLen = oldDecorationsIds.length;
608
- let oldDecorationIndex = 0;
609
- const newDecorationsLen = newDecorations.length;
610
- let newDecorationIndex = 0;
611
- const result = ( new Array(newDecorationsLen));
612
- while (oldDecorationIndex < oldDecorationsLen || newDecorationIndex < newDecorationsLen) {
613
- let node = null;
614
- if (oldDecorationIndex < oldDecorationsLen) {
615
- do {
616
- node = this._decorations[oldDecorationsIds[oldDecorationIndex++]];
617
- } while (!node && oldDecorationIndex < oldDecorationsLen);
618
- if (node) {
619
- this._decorationsTree.delete(node);
620
- }
621
- }
622
- if (newDecorationIndex < newDecorationsLen) {
623
- if (!node) {
624
- const internalDecorationId = (++this._lastDecorationId);
625
- const decorationId = `${this._instanceId};${internalDecorationId}`;
626
- node = ( new IntervalNode(decorationId, 0, 0));
627
- this._decorations[decorationId] = node;
628
- }
629
- const newDecoration = newDecorations[newDecorationIndex];
630
- const range = newDecoration.range;
631
- const options = _normalizeOptions(newDecoration.options);
632
- node.ownerId = ownerId;
633
- node.reset(versionId, range.startLineNumber, range.endLineNumber, Range.lift(range));
634
- node.setOptions(options);
635
- this._decorationsTree.insert(node);
636
- result[newDecorationIndex] = node.id;
637
- newDecorationIndex++;
638
- } else {
639
- if (node) {
640
- delete this._decorations[node.id];
641
- }
642
- }
643
- }
644
- return result;
645
- }
646
- deltaCellDecorations(oldDecorations, newDecorations) {
647
- oldDecorations.forEach(id => {
648
- const handle = this._decorationIdToCellMap.get(id);
649
- if (handle !== undefined) {
650
- const cell = this.getCellByHandle(handle);
651
- cell?.deltaCellDecorations([id], []);
652
- this._decorationIdToCellMap.delete(id);
653
- }
654
- this._overviewRulerDecorations.delete(id);
655
- });
656
- const result = [];
657
- newDecorations.forEach(decoration => {
658
- if (isNotebookCellDecoration(decoration)) {
659
- const cell = this.getCellByHandle(decoration.handle);
660
- const ret = cell?.deltaCellDecorations([], [decoration.options]) || [];
661
- ret.forEach(id => {
662
- this._decorationIdToCellMap.set(id, decoration.handle);
663
- });
664
- result.push(...ret);
665
- } else {
666
- const id = ++this._lastOverviewRulerDecorationId;
667
- const decorationId = `_overview_${this.id};${id}`;
668
- this._overviewRulerDecorations.set(decorationId, decoration);
669
- result.push(decorationId);
670
- }
671
- });
672
- return result;
673
- }
674
- deltaCellStatusBarItems(oldItems, newItems) {
675
- const deletesByHandle = groupBy(oldItems, id => this._statusBarItemIdToCellMap.get(id) ?? -1);
676
- const result = [];
677
- newItems.forEach(itemDelta => {
678
- const cell = this.getCellByHandle(itemDelta.handle);
679
- const deleted = deletesByHandle[itemDelta.handle] ?? [];
680
- delete deletesByHandle[itemDelta.handle];
681
- deleted.forEach(id => this._statusBarItemIdToCellMap.delete(id));
682
- const ret = cell?.deltaCellStatusBarItems(deleted, itemDelta.items) || [];
683
- ret.forEach(id => {
684
- this._statusBarItemIdToCellMap.set(id, itemDelta.handle);
685
- });
686
- result.push(...ret);
687
- });
688
- for (const _handle in deletesByHandle) {
689
- const handle = parseInt(_handle);
690
- const ids = deletesByHandle[handle];
691
- const cell = this.getCellByHandle(handle);
692
- cell?.deltaCellStatusBarItems(ids, []);
693
- ids.forEach(id => this._statusBarItemIdToCellMap.delete(id));
694
- }
695
- return result;
696
- }
697
- nearestCodeCellIndex(index ) {
698
- const nearest = this.viewCells.slice(0, index).reverse().findIndex(cell => cell.cellKind === CellKind.Code);
699
- if (nearest > -1) {
700
- return index - nearest - 1;
701
- } else {
702
- const nearestCellTheOtherDirection = this.viewCells.slice(index + 1).findIndex(cell => cell.cellKind === CellKind.Code);
703
- if (nearestCellTheOtherDirection > -1) {
704
- return index + 1 + nearestCellTheOtherDirection;
705
- }
706
- return -1;
707
- }
708
- }
709
- getEditorViewState() {
710
- const editingCells = {};
711
- const collapsedInputCells = {};
712
- const collapsedOutputCells = {};
713
- const cellLineNumberStates = {};
714
- this._viewCells.forEach((cell, i) => {
715
- if (cell.getEditState() === CellEditState.Editing) {
716
- editingCells[i] = true;
717
- }
718
- if (cell.isInputCollapsed) {
719
- collapsedInputCells[i] = true;
720
- }
721
- if (cell instanceof CodeCellViewModel && cell.isOutputCollapsed) {
722
- collapsedOutputCells[i] = true;
723
- }
724
- if (cell.lineNumbers !== "inherit") {
725
- cellLineNumberStates[i] = cell.lineNumbers;
726
- }
727
- });
728
- const editorViewStates = {};
729
- ( this._viewCells.map(cell => ({
730
- handle: cell.model.handle,
731
- state: cell.saveEditorViewState()
732
- }))).forEach((viewState, i) => {
733
- if (viewState.state) {
734
- editorViewStates[i] = viewState.state;
735
- }
736
- });
737
- return {
738
- editingCells,
739
- editorViewStates,
740
- cellLineNumberStates,
741
- collapsedInputCells,
742
- collapsedOutputCells
743
- };
744
- }
745
- restoreEditorViewState(viewState) {
746
- if (!viewState) {
747
- return;
748
- }
749
- this._viewCells.forEach((cell, index) => {
750
- const isEditing = viewState.editingCells && viewState.editingCells[index];
751
- const editorViewState = viewState.editorViewStates && viewState.editorViewStates[index];
752
- cell.updateEditState(isEditing ? CellEditState.Editing : CellEditState.Preview, "viewState");
753
- const cellHeight = viewState.cellTotalHeights ? viewState.cellTotalHeights[index] : undefined;
754
- cell.restoreEditorViewState(editorViewState, cellHeight);
755
- if (viewState.collapsedInputCells && viewState.collapsedInputCells[index]) {
756
- cell.isInputCollapsed = true;
757
- }
758
- if (viewState.collapsedOutputCells && viewState.collapsedOutputCells[index] && cell instanceof CodeCellViewModel) {
759
- cell.isOutputCollapsed = true;
760
- }
761
- if (viewState.cellLineNumberStates && viewState.cellLineNumberStates[index]) {
762
- cell.lineNumbers = viewState.cellLineNumberStates[index];
763
- }
764
- });
765
- }
766
- changeModelDecorations(callback) {
767
- const changeAccessor = {
768
- deltaDecorations: (oldDecorations, newDecorations) => {
769
- return this._deltaModelDecorationsImpl(oldDecorations, newDecorations);
770
- }
771
- };
772
- let result = null;
773
- try {
774
- result = callback(changeAccessor);
775
- } catch (e) {
776
- onUnexpectedError(e);
777
- }
778
- changeAccessor.deltaDecorations = invalidFunc;
779
- return result;
780
- }
781
- _deltaModelDecorationsImpl(oldDecorations, newDecorations) {
782
- const mapping = ( new Map());
783
- oldDecorations.forEach(oldDecoration => {
784
- const ownerId = oldDecoration.ownerId;
785
- if (!( mapping.has(ownerId))) {
786
- const cell = this._viewCells.find(cell => cell.handle === ownerId);
787
- if (cell) {
788
- mapping.set(ownerId, {
789
- cell: cell,
790
- oldDecorations: [],
791
- newDecorations: []
792
- });
793
- }
794
- }
795
- const data = mapping.get(ownerId);
796
- if (data) {
797
- data.oldDecorations = oldDecoration.decorations;
798
- }
799
- });
800
- newDecorations.forEach(newDecoration => {
801
- const ownerId = newDecoration.ownerId;
802
- if (!( mapping.has(ownerId))) {
803
- const cell = this._viewCells.find(cell => cell.handle === ownerId);
804
- if (cell) {
805
- mapping.set(ownerId, {
806
- cell: cell,
807
- oldDecorations: [],
808
- newDecorations: []
809
- });
810
- }
811
- }
812
- const data = mapping.get(ownerId);
813
- if (data) {
814
- data.newDecorations = newDecoration.decorations;
815
- }
816
- });
817
- const ret = [];
818
- mapping.forEach((value, ownerId) => {
819
- const cellRet = value.cell.deltaModelDecorations(value.oldDecorations, value.newDecorations);
820
- ret.push({
821
- ownerId: ownerId,
822
- decorations: cellRet
823
- });
824
- });
825
- return ret;
826
- }
827
- find(value, options) {
828
- const matches = [];
829
- let findCells = [];
830
- if (options.findScope && (options.findScope.findScopeType === NotebookFindScopeType.Cells || options.findScope.findScopeType === NotebookFindScopeType.Text)) {
831
- const selectedRanges = options.findScope.selectedCellRanges?.map(range => this.validateRange(range)).filter(range => !!range) ?? [];
832
- const selectedIndexes = cellRangesToIndexes(selectedRanges);
833
- findCells = ( selectedIndexes.map(index => this._viewCells[index]));
834
- } else {
835
- findCells = this._viewCells;
836
- }
837
- findCells.forEach((cell, index) => {
838
- const cellMatches = cell.startFind(value, options);
839
- if (cellMatches) {
840
- matches.push(( new CellFindMatchModel(cellMatches.cell, index, cellMatches.contentMatches, [])));
841
- }
842
- });
843
- return matches.filter(match => {
844
- if (match.cell.cellKind === CellKind.Code) {
845
- return options.includeCodeInput;
846
- }
847
- if (match.cell.getEditState() === CellEditState.Editing) {
848
- return options.includeMarkupInput;
849
- } else {
850
- return !options.includeMarkupPreview && options.includeMarkupInput;
851
- }
852
- });
853
- }
854
- replaceOne(cell, range, text) {
855
- const viewCell = cell;
856
- this._lastNotebookEditResource.push(viewCell.uri);
857
- return viewCell.resolveTextModel().then(() => {
858
- this._bulkEditService.apply([( new ResourceTextEdit(cell.uri, {
859
- range,
860
- text
861
- }))], {
862
- quotableLabel: "Notebook Replace"
863
- });
864
- });
865
- }
866
- async replaceAll(matches, texts) {
867
- if (!matches.length) {
868
- return;
869
- }
870
- const textEdits = [];
871
- this._lastNotebookEditResource.push(matches[0].cell.uri);
872
- matches.forEach(match => {
873
- match.contentMatches.forEach((singleMatch, index) => {
874
- textEdits.push({
875
- versionId: undefined,
876
- textEdit: {
877
- range: singleMatch.range,
878
- text: texts[index]
879
- },
880
- resource: match.cell.uri
881
- });
882
- });
883
- });
884
- return Promise.all(( matches.map(match => {
885
- return match.cell.resolveTextModel();
886
- }))).then(async () => {
887
- this._bulkEditService.apply({
888
- edits: textEdits
889
- }, {
890
- quotableLabel: "Notebook Replace All"
891
- });
892
- return;
893
- });
894
- }
895
- async _withElement(element, callback) {
896
- const viewCells = this._viewCells.filter(cell => element.matchesResource(cell.uri));
897
- const refs = await Promise.all(( viewCells.map(cell => this._textModelService.createModelReference(cell.uri))));
898
- await callback();
899
- refs.forEach(ref => ref.dispose());
900
- }
901
- async undo() {
902
- const editStack = this._undoService.getElements(this.uri);
903
- const element = editStack.past.length ? editStack.past[editStack.past.length - 1] : undefined;
904
- if (element && element instanceof SingleModelEditStackElement || element instanceof MultiModelEditStackElement) {
905
- await this._withElement(element, async () => {
906
- await this._undoService.undo(this.uri);
907
- });
908
- return (element instanceof SingleModelEditStackElement) ? [element.resource] : element.resources;
909
- }
910
- await this._undoService.undo(this.uri);
911
- return [];
912
- }
913
- async redo() {
914
- const editStack = this._undoService.getElements(this.uri);
915
- const element = editStack.future[0];
916
- if (element && element instanceof SingleModelEditStackElement || element instanceof MultiModelEditStackElement) {
917
- await this._withElement(element, async () => {
918
- await this._undoService.redo(this.uri);
919
- });
920
- return (element instanceof SingleModelEditStackElement) ? [element.resource] : element.resources;
921
- }
922
- await this._undoService.redo(this.uri);
923
- return [];
924
- }
925
- equal(notebook) {
926
- return this._notebook === notebook;
927
- }
928
- dispose() {
929
- this._localStore.clear();
930
- this._viewCells.forEach(cell => {
931
- cell.dispose();
932
- });
933
- super.dispose();
934
- }
935
- };
936
- NotebookViewModel = ( __decorate([( __param(5, IInstantiationService)), ( __param(6, IBulkEditService)), ( __param(7, IUndoRedoService)), ( __param(8, ITextModelService)), ( __param(9, INotebookExecutionStateService))], NotebookViewModel));
937
- function createCellViewModel(instantiationService, notebookViewModel, cell, viewContext) {
938
- if (cell.cellKind === CellKind.Code) {
939
- return instantiationService.createInstance(
940
- CodeCellViewModel,
941
- notebookViewModel.viewType,
942
- cell,
943
- notebookViewModel.layoutInfo,
944
- viewContext
945
- );
946
- } else {
947
- return instantiationService.createInstance(
948
- MarkupCellViewModel,
949
- notebookViewModel.viewType,
950
- cell,
951
- notebookViewModel.layoutInfo,
952
- notebookViewModel,
953
- viewContext
954
- );
955
- }
956
- }
957
-
958
- export { NotebookViewModel, createCellViewModel };