@codingame/monaco-vscode-api 32.0.1 → 33.0.3

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 (630) hide show
  1. package/missing-services.js +51 -7
  2. package/package.json +8 -8
  3. package/service-override/tools/views.d.ts +2 -2
  4. package/services.d.ts +3 -0
  5. package/services.js +8 -3
  6. package/vscode/product.json.js +1 -1
  7. package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  8. package/vscode/src/vs/base/common/arrays.js +5 -1
  9. package/vscode/src/vs/base/common/async.js +94 -1
  10. package/vscode/src/vs/base/common/cache.js +22 -1
  11. package/vscode/src/vs/base/common/defaultAccount.d.ts +63 -0
  12. package/vscode/src/vs/base/common/policy.d.ts +1 -1
  13. package/vscode/src/vs/base/common/product.d.ts +0 -2
  14. package/vscode/src/vs/base/parts/ipc/common/ipc.net.d.ts +12 -0
  15. package/vscode/src/vs/base/parts/ipc/common/ipc.net.js +1 -1
  16. package/vscode/src/vs/editor/common/config/editorOptions.js +1 -1
  17. package/vscode/src/vs/editor/common/textModelEditSource.js +18 -1
  18. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +2 -2
  19. package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.d.ts +2 -0
  20. package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +22 -2
  21. package/vscode/src/vs/editor/contrib/snippet/browser/snippetSession.d.ts +1 -0
  22. package/vscode/src/vs/editor/contrib/snippet/browser/snippetSession.js +58 -17
  23. package/vscode/src/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  24. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  25. package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +9 -9
  26. package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
  27. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
  28. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  29. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  30. package/vscode/src/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  31. package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  32. package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  33. package/vscode/src/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  34. package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  35. package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  36. package/vscode/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  37. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  38. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js +6 -3
  39. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  40. package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +3 -3
  41. package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +3 -0
  42. package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  43. package/vscode/src/vs/platform/action/common/actionCommonCategories.js +6 -6
  44. package/vscode/src/vs/platform/actionWidget/browser/actionList.d.ts +7 -0
  45. package/vscode/src/vs/platform/actionWidget/browser/actionList.js +24 -10
  46. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.css +1 -0
  47. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +12 -12
  48. package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +3 -3
  49. package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -2
  50. package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
  51. package/vscode/src/vs/platform/actions/common/menuService.js +2 -2
  52. package/vscode/src/vs/platform/agentHost/browser/nullAgentHostService.d.ts +1 -1
  53. package/vscode/src/vs/platform/agentHost/common/agentHostUri.js +3 -0
  54. package/vscode/src/vs/platform/agentHost/common/agentPluginManager.d.ts +1 -1
  55. package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +1 -1
  56. package/vscode/src/vs/platform/agentHost/common/remoteAgentHostService.d.ts +13 -4
  57. package/vscode/src/vs/platform/agentHost/common/remoteAgentHostService.js +8 -3
  58. package/vscode/src/vs/platform/agentHost/common/remoteAgentHostService.service.d.ts +17 -1
  59. package/vscode/src/vs/platform/agentHost/common/sshRemoteAgentHost.d.ts +27 -0
  60. package/vscode/src/vs/platform/agentHost/common/sshRemoteAgentHost.service.d.ts +20 -1
  61. package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +1 -1
  62. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +1054 -0
  63. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.js +59 -0
  64. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +17 -1
  65. package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +6 -2
  66. package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +5 -0
  67. package/vscode/src/vs/platform/agentHost/common/state/protocolUpgrade.d.ts +73 -0
  68. package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +139 -0
  69. package/vscode/src/vs/platform/agentHost/common/state/sessionState.js +24 -0
  70. package/vscode/src/vs/platform/browserView/common/browserView.d.ts +20 -0
  71. package/vscode/src/vs/platform/browserView/common/browserView.js +1 -0
  72. package/vscode/src/vs/platform/browserView/common/browserViewTelemetry.d.ts +3 -1
  73. package/vscode/src/vs/platform/configuration/common/configuration.js +1 -1
  74. package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +10 -10
  75. package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  76. package/vscode/src/vs/platform/contextkey/common/contextkey.js +10 -10
  77. package/vscode/src/vs/platform/contextkey/common/contextkeys.js +9 -9
  78. package/vscode/src/vs/platform/contextkey/common/scanner.js +5 -5
  79. package/vscode/src/vs/platform/defaultAccount/common/defaultAccount.d.ts +16 -1
  80. package/vscode/src/vs/platform/defaultAccount/common/defaultAccount.js +8 -0
  81. package/vscode/src/vs/platform/defaultAccount/common/defaultAccount.service.d.ts +9 -1
  82. package/vscode/src/vs/platform/dialogs/common/dialogs.js +9 -9
  83. package/vscode/src/vs/platform/dnd/browser/dnd.js +1 -1
  84. package/vscode/src/vs/platform/environment/common/argv.d.ts +0 -2
  85. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +14 -14
  86. package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
  87. package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +7 -7
  88. package/vscode/src/vs/platform/extensions/common/extensionValidator.js +21 -21
  89. package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js +2 -2
  90. package/vscode/src/vs/platform/files/common/files.js +6 -6
  91. package/vscode/src/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  92. package/vscode/src/vs/platform/hover/browser/hoverService.js +1 -1
  93. package/vscode/src/vs/platform/hover/browser/hoverWidget.js +1 -1
  94. package/vscode/src/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  95. package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  96. package/vscode/src/vs/platform/languagePacks/common/languagePacks.js +1 -1
  97. package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +3 -3
  98. package/vscode/src/vs/platform/list/browser/listService.js +25 -25
  99. package/vscode/src/vs/platform/log/common/log.js +6 -6
  100. package/vscode/src/vs/platform/markers/common/markerService.js +2 -2
  101. package/vscode/src/vs/platform/markers/common/markers.js +6 -6
  102. package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +1 -1
  103. package/vscode/src/vs/platform/meteredConnection/common/meteredConnection.config.contribution.js +5 -5
  104. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.service.d.ts +2 -4
  105. package/vscode/src/vs/platform/notification/common/notification.js +3 -3
  106. package/vscode/src/vs/platform/policy/common/policy.d.ts +1 -1
  107. package/vscode/src/vs/platform/product/common/product.js +3 -3
  108. package/vscode/src/vs/platform/quickinput/browser/quickInput.js +10 -10
  109. package/vscode/src/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  110. package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +6 -6
  111. package/vscode/src/vs/platform/quickinput/browser/quickInputList.js +1 -1
  112. package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  113. package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +2 -2
  114. package/vscode/src/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  115. package/vscode/src/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  116. package/vscode/src/vs/platform/request/common/request.js +20 -20
  117. package/vscode/src/vs/platform/telemetry/common/telemetry.js +4 -1
  118. package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -1
  119. package/vscode/src/vs/platform/terminal/common/terminalPlatformConfiguration.js +34 -34
  120. package/vscode/src/vs/platform/terminal/common/terminalProfiles.js +1 -1
  121. package/vscode/src/vs/platform/theme/common/colorUtils.js +2 -2
  122. package/vscode/src/vs/platform/theme/common/colors/baseColors.js +19 -19
  123. package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +9 -9
  124. package/vscode/src/vs/platform/theme/common/colors/editorColors.js +95 -95
  125. package/vscode/src/vs/platform/theme/common/colors/inputColors.js +48 -48
  126. package/vscode/src/vs/platform/theme/common/colors/listColors.js +36 -36
  127. package/vscode/src/vs/platform/theme/common/colors/menuColors.js +7 -7
  128. package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +11 -11
  129. package/vscode/src/vs/platform/theme/common/colors/miscColors.js +16 -16
  130. package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +10 -10
  131. package/vscode/src/vs/platform/theme/common/colors/searchColors.js +3 -3
  132. package/vscode/src/vs/platform/theme/common/iconRegistry.js +6 -6
  133. package/vscode/src/vs/platform/theme/common/sizeUtils.d.ts +5 -3
  134. package/vscode/src/vs/platform/theme/common/sizeUtils.js +17 -3
  135. package/vscode/src/vs/platform/theme/common/sizes/baseSizes.js +11 -11
  136. package/vscode/src/vs/platform/theme/common/tokenClassificationRegistry.js +42 -42
  137. package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  138. package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
  139. package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +2 -2
  140. package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +2 -2
  141. package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +1 -1
  142. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +5 -5
  143. package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +1 -1
  144. package/vscode/src/vs/platform/workspace/common/workspace.js +1 -1
  145. package/vscode/src/vs/workbench/api/browser/statusBarExtensionPoint.js +12 -12
  146. package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +7 -1
  147. package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +5 -5
  148. package/vscode/src/vs/workbench/api/common/extHostChatOutputRenderer.d.ts +2 -2
  149. package/vscode/src/vs/workbench/api/common/extHostChatOutputRenderer.js +2 -2
  150. package/vscode/src/vs/workbench/api/common/extHostChatStatus.js +9 -1
  151. package/vscode/src/vs/workbench/api/common/extHostConfiguration.js +1 -0
  152. package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +1 -1
  153. package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +2 -2
  154. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +2 -2
  155. package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +3 -4
  156. package/vscode/src/vs/workbench/api/common/extHostLogService.js +1 -1
  157. package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
  158. package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +2 -2
  159. package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +4 -1
  160. package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +1 -1
  161. package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +2 -2
  162. package/vscode/src/vs/workbench/api/common/extHostWorkspace.d.ts +12 -0
  163. package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +98 -38
  164. package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +11 -11
  165. package/vscode/src/vs/workbench/browser/actions/developerActions.js +35 -35
  166. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +127 -127
  167. package/vscode/src/vs/workbench/browser/actions/textInputActions.js +6 -6
  168. package/vscode/src/vs/workbench/browser/actions/windowActions.js +29 -29
  169. package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +21 -21
  170. package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +4 -4
  171. package/vscode/src/vs/workbench/browser/editor.js +2 -2
  172. package/vscode/src/vs/workbench/browser/labels.js +4 -4
  173. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +23 -23
  174. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +26 -26
  175. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +4 -4
  176. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +1 -1
  177. package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +9 -9
  178. package/vscode/src/vs/workbench/browser/parts/compositePart.js +3 -3
  179. package/vscode/src/vs/workbench/browser/parts/dialogs/dialog.js +1 -1
  180. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +3 -3
  181. package/vscode/src/vs/workbench/browser/parts/editor/binaryDiffEditor.js +1 -1
  182. package/vscode/src/vs/workbench/browser/parts/editor/binaryEditor.js +3 -3
  183. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbs.js +37 -37
  184. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +12 -12
  185. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +1 -1
  186. package/vscode/src/vs/workbench/browser/parts/editor/diffEditorCommands.js +19 -9
  187. package/vscode/src/vs/workbench/browser/parts/editor/editorActions.d.ts +1 -2
  188. package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +139 -176
  189. package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +28 -27
  190. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +1 -1
  191. package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +7 -7
  192. package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +12 -12
  193. package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +2 -2
  194. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +16 -10
  195. package/vscode/src/vs/workbench/browser/parts/editor/editorPlaceholder.js +10 -10
  196. package/vscode/src/vs/workbench/browser/parts/editor/editorQuickAccess.js +5 -5
  197. package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +66 -66
  198. package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +3 -3
  199. package/vscode/src/vs/workbench/browser/parts/editor/modalEditorPart.js +24 -7
  200. package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +1 -1
  201. package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -1
  202. package/vscode/src/vs/workbench/browser/parts/editor/textCodeEditor.js +1 -1
  203. package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +3 -3
  204. package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +1 -1
  205. package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +19 -19
  206. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +22 -22
  207. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +3 -3
  208. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +6 -6
  209. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +13 -13
  210. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +6 -6
  211. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +13 -13
  212. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +2 -2
  213. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +4 -4
  214. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +4 -4
  215. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +3 -3
  216. package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +27 -27
  217. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +3 -3
  218. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +2 -2
  219. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +1 -1
  220. package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +10 -10
  221. package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarActions.js +15 -15
  222. package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +2 -2
  223. package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +1 -1
  224. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +7 -7
  225. package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +4 -4
  226. package/vscode/src/vs/workbench/browser/parts/views/viewMenuActions.d.ts +7 -2
  227. package/vscode/src/vs/workbench/browser/parts/views/viewMenuActions.js +28 -5
  228. package/vscode/src/vs/workbench/browser/parts/views/viewPane.d.ts +7 -0
  229. package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +11 -5
  230. package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +12 -9
  231. package/vscode/src/vs/workbench/browser/quickaccess.js +1 -1
  232. package/vscode/src/vs/workbench/browser/window.js +14 -14
  233. package/vscode/src/vs/workbench/browser/workbench.contribution.js +225 -225
  234. package/vscode/src/vs/workbench/common/configuration.js +9 -9
  235. package/vscode/src/vs/workbench/common/contextkeys.js +82 -82
  236. package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +1 -1
  237. package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +1 -1
  238. package/vscode/src/vs/workbench/common/editor/textEditorModel.js +1 -1
  239. package/vscode/src/vs/workbench/common/editor.js +4 -4
  240. package/vscode/src/vs/workbench/common/theme.js +161 -161
  241. package/vscode/src/vs/workbench/common/views.js +4 -4
  242. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +156 -156
  243. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +12 -12
  244. package/vscode/src/vs/workbench/contrib/browserView/common/browserEditorInput.js +1 -1
  245. package/vscode/src/vs/workbench/contrib/browserView/common/browserView.js +10 -7
  246. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +68 -66
  247. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.service.d.ts +8 -0
  248. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.service.js +6 -0
  249. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.service.d.ts +70 -0
  250. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.service.js +6 -0
  251. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +12 -12
  252. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +1 -1
  253. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +3 -3
  254. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatScreenshotContext.js +1 -1
  255. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys.js +7 -7
  256. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.service.d.ts +4 -2
  257. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +2 -2
  258. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +43 -43
  259. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +1 -1
  260. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatOutputPartStateCache.service.d.ts +7 -0
  261. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatOutputPartStateCache.service.js +6 -0
  262. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.js +9 -9
  263. package/vscode/src/vs/workbench/contrib/chat/common/actions/chatContextKeys.d.ts +1 -0
  264. package/vscode/src/vs/workbench/contrib/chat/common/actions/chatContextKeys.js +93 -86
  265. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.js +2 -2
  266. package/vscode/src/vs/workbench/contrib/chat/common/chatModes.d.ts +4 -6
  267. package/vscode/src/vs/workbench/contrib/chat/common/chatModes.js +29 -21
  268. package/vscode/src/vs/workbench/contrib/chat/common/chatModes.service.d.ts +7 -8
  269. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.d.ts +1 -1
  270. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionsService.d.ts +41 -2
  271. package/vscode/src/vs/workbench/contrib/chat/common/constants.d.ts +3 -0
  272. package/vscode/src/vs/workbench/contrib/chat/common/constants.js +3 -0
  273. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +1 -1
  274. package/vscode/src/vs/workbench/contrib/chat/common/editing/chatEditingService.js +2 -2
  275. package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +3 -3
  276. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.d.ts +17 -4
  277. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +152 -49
  278. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.service.d.ts +20 -0
  279. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModel.d.ts +3 -0
  280. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModel.js +17 -8
  281. package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.js +1 -1
  282. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +21 -19
  283. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookSchema.js +18 -18
  284. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookTypes.js +20 -20
  285. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptFileAttributes.js +79 -79
  286. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptTypes.js +10 -10
  287. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +92 -0
  288. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +329 -0
  289. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +5 -44
  290. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +33 -276
  291. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +1 -1
  292. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +8 -8
  293. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +10 -10
  294. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +7 -7
  295. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +2 -2
  296. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +3 -3
  297. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +4 -4
  298. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +22 -22
  299. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.d.ts +2 -1
  300. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.js +6 -5
  301. package/vscode/src/vs/workbench/contrib/chat/common/tools/toolResultCompressor.service.d.ts +2 -1
  302. package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +11 -11
  303. package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
  304. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +5 -5
  305. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -3
  306. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +10 -10
  307. package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +2 -2
  308. package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +3 -3
  309. package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +6 -6
  310. package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +4 -4
  311. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
  312. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +3 -3
  313. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
  314. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +12 -12
  315. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +5 -5
  316. package/vscode/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.js +65 -65
  317. package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +7 -7
  318. package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +7 -7
  319. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +2 -2
  320. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +3 -3
  321. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +3 -3
  322. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +3 -3
  323. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +3 -3
  324. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +3 -3
  325. package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
  326. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +7 -7
  327. package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +1 -1
  328. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +9 -9
  329. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +14 -14
  330. package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +16 -16
  331. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +7 -7
  332. package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +12 -12
  333. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorDiffInput.d.ts +7 -12
  334. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorDiffInput.js +68 -64
  335. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +3 -3
  336. package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +1 -1
  337. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +29 -29
  338. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +14 -14
  339. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +75 -75
  340. package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +2 -2
  341. package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +6 -6
  342. package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +12 -12
  343. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +38 -38
  344. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +2 -2
  345. package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +3 -3
  346. package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +57 -57
  347. package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +3 -3
  348. package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +4 -4
  349. package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +2 -2
  350. package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +18 -18
  351. package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +5 -5
  352. package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +9 -9
  353. package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
  354. package/vscode/src/vs/workbench/contrib/debug/common/debug.js +65 -65
  355. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +6 -6
  356. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +1 -1
  357. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +2 -2
  358. package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +1 -1
  359. package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +1 -1
  360. package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/commands.js +2 -2
  361. package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/configurationSchema.js +4 -4
  362. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +15 -0
  363. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +85 -0
  364. package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.js +1 -1
  365. package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.js +1 -1
  366. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +41 -41
  367. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.js +1 -1
  368. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.js +15 -15
  369. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +14 -14
  370. package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +149 -151
  371. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +179 -179
  372. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.js +1 -1
  373. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.js +1 -1
  374. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.js +5 -5
  375. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +25 -25
  376. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.js +4 -4
  377. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewer.js +7 -7
  378. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +47 -47
  379. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +6 -6
  380. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +30 -30
  381. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +79 -76
  382. package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.js +2 -2
  383. package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.js +1 -1
  384. package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +2 -2
  385. package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +1 -1
  386. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +5 -5
  387. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +2 -2
  388. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +3 -3
  389. package/vscode/src/vs/workbench/contrib/extensions/common/searchExtensionsTool.js +3 -3
  390. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/configuration.js +4 -4
  391. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.js +3 -3
  392. package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +1 -1
  393. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +8 -8
  394. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +18 -18
  395. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +14 -14
  396. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +39 -39
  397. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +84 -84
  398. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands._save.js +4 -4
  399. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +2 -2
  400. package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
  401. package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +28 -28
  402. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +50 -50
  403. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
  404. package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
  405. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.js +4 -4
  406. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +7 -7
  407. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +17 -17
  408. package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +7 -7
  409. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +4 -4
  410. package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +1 -1
  411. package/vscode/src/vs/workbench/contrib/files/common/files.js +16 -16
  412. package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +3 -3
  413. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +20 -20
  414. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +4 -4
  415. package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
  416. package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +4 -4
  417. package/vscode/src/vs/workbench/contrib/inlineCompletions/browser/inlineCompletionLanguageStatusBarContribution.d.ts +17 -0
  418. package/vscode/src/vs/workbench/contrib/inlineCompletions/browser/inlineCompletionLanguageStatusBarContribution.js +108 -0
  419. package/vscode/src/vs/workbench/contrib/inlineCompletions/browser/inlineCompletions.contribution.d.ts +8 -0
  420. package/vscode/src/vs/workbench/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +49 -0
  421. package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
  422. package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
  423. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommandsAddConfiguration.js +66 -66
  424. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +40 -40
  425. package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfiguration.js +42 -42
  426. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +16 -16
  427. package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.js +4 -4
  428. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +4 -4
  429. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +23 -23
  430. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +2 -2
  431. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +8 -8
  432. package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnection.contribution.js +8 -8
  433. package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnectionStatus.js +4 -4
  434. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/icons.contribution.js +1 -1
  435. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +3 -3
  436. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +1 -1
  437. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +17 -17
  438. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
  439. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +746 -0
  440. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +6 -6
  441. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
  442. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +3 -3
  443. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +13 -0
  444. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +300 -0
  445. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
  446. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
  447. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
  448. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1963 -0
  449. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
  450. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +314 -0
  451. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
  452. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +886 -0
  453. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
  454. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +118 -0
  455. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
  456. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +71 -0
  457. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
  458. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
  459. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
  460. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +313 -0
  461. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
  462. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +265 -0
  463. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
  464. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +185 -0
  465. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
  466. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +104 -0
  467. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
  468. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +43 -0
  469. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
  470. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +41 -0
  471. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
  472. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +69 -0
  473. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
  474. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
  475. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +933 -0
  476. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
  477. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +32 -0
  478. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
  479. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +643 -0
  480. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
  481. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +197 -0
  482. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
  483. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +539 -0
  484. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
  485. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
  486. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +3 -3
  487. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +7 -7
  488. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +24 -24
  489. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +29 -29
  490. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +5 -5
  491. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +7 -7
  492. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
  493. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +4 -4
  494. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +1 -1
  495. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +3 -3
  496. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +1 -1
  497. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +2 -2
  498. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +4 -4
  499. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +1 -1
  500. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +14 -14
  501. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +2 -2
  502. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +1 -1
  503. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
  504. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +90 -0
  505. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
  506. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
  507. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -2
  508. package/vscode/src/vs/workbench/contrib/opener/browser/opener.contribution.d.ts +1 -0
  509. package/vscode/src/vs/workbench/contrib/opener/browser/opener.contribution.js +44 -0
  510. package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +3 -3
  511. package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesIcons.js +13 -13
  512. package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +10 -10
  513. package/vscode/src/vs/workbench/contrib/preferences/browser/settingsLayout.js +60 -60
  514. package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +3 -3
  515. package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +21 -21
  516. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +15 -15
  517. package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +17 -17
  518. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +59 -59
  519. package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +11 -11
  520. package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryChatContext.js +6 -6
  521. package/vscode/src/vs/workbench/contrib/scm/common/quickDiff.js +14 -14
  522. package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +9 -9
  523. package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +3 -3
  524. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +1 -1
  525. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +9 -9
  526. package/vscode/src/vs/workbench/contrib/search/browser/searchChatContext.js +5 -5
  527. package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +1 -1
  528. package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +20 -20
  529. package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +2 -2
  530. package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +14 -14
  531. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +55 -55
  532. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +11 -11
  533. package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +2 -2
  534. package/vscode/src/vs/workbench/contrib/search/common/search.d.ts +2 -0
  535. package/vscode/src/vs/workbench/contrib/search/common/search.js +9 -1
  536. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +4 -4
  537. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +5 -5
  538. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
  539. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
  540. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
  541. package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
  542. package/vscode/src/vs/workbench/contrib/tasks/common/constants.js +1 -1
  543. package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +6 -6
  544. package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +6 -6
  545. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +4 -4
  546. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +3 -3
  547. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +13 -13
  548. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalMenus.js +40 -40
  549. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +15 -15
  550. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +10 -10
  551. package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -23
  552. package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +17 -17
  553. package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +26 -26
  554. package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/common/terminalAccessibilityConfiguration.js +2 -2
  555. package/vscode/src/vs/workbench/contrib/terminalContrib/autoReplies/common/terminalAutoRepliesConfiguration.js +2 -2
  556. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +9 -9
  557. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.d.ts +2 -0
  558. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.js +104 -74
  559. package/vscode/src/vs/workbench/contrib/terminalContrib/commandGuide/common/terminalCommandGuideConfiguration.js +1 -1
  560. package/vscode/src/vs/workbench/contrib/terminalContrib/history/common/terminal.history.js +1 -1
  561. package/vscode/src/vs/workbench/contrib/terminalContrib/inlineHint/common/terminalInitialHintConfiguration.js +2 -2
  562. package/vscode/src/vs/workbench/contrib/terminalContrib/notification/common/terminalNotificationConfiguration.js +1 -1
  563. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/common/terminalStickyScrollConfiguration.js +3 -3
  564. package/vscode/src/vs/workbench/contrib/terminalContrib/suggest/common/terminalSuggestConfiguration.js +30 -30
  565. package/vscode/src/vs/workbench/contrib/terminalContrib/typeAhead/common/terminalTypeAheadConfiguration.js +5 -5
  566. package/vscode/src/vs/workbench/contrib/terminalContrib/zoom/common/terminal.zoom.js +2 -2
  567. package/vscode/src/vs/workbench/contrib/testing/common/constants.js +11 -11
  568. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
  569. package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +3 -3
  570. package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +6 -6
  571. package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +3 -3
  572. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindAccessibilityHelp.js +30 -30
  573. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +1 -1
  574. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.js +14 -14
  575. package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +2 -2
  576. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +2 -1
  577. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +14 -3
  578. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +31 -25
  579. package/vscode/src/vs/workbench/services/authentication/common/authentication.d.ts +15 -0
  580. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +5 -5
  581. package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.d.ts +11 -2
  582. package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.js +65 -22
  583. package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.service.d.ts +2 -0
  584. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +16 -16
  585. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +1 -1
  586. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +16 -16
  587. package/vscode/src/vs/workbench/services/editor/common/editorResolverService.d.ts +15 -3
  588. package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +19 -3
  589. package/vscode/src/vs/workbench/services/editor/common/editorResolverService.service.d.ts +2 -2
  590. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionsIcons.js +3 -3
  591. package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +6 -6
  592. package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +10 -10
  593. package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +88 -88
  594. package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +5 -5
  595. package/vscode/src/vs/workbench/services/language/common/languageService.js +24 -24
  596. package/vscode/src/vs/workbench/services/log/common/logConstants.js +1 -1
  597. package/vscode/src/vs/workbench/services/policies/common/accountPolicyService.js +1 -1
  598. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +2 -2
  599. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +7 -7
  600. package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +4 -4
  601. package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.js +2 -2
  602. package/vscode/src/vs/workbench/services/preferences/common/preferencesValidation.js +30 -30
  603. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +8 -8
  604. package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +6 -6
  605. package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +1 -1
  606. package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +9 -9
  607. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +3 -3
  608. package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +18 -18
  609. package/vscode/src/vs/workbench/services/themes/common/colorThemeData.js +8 -8
  610. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +13 -13
  611. package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +24 -24
  612. package/vscode/src/vs/workbench/services/title/browser/titleService.service.d.ts +7 -0
  613. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +3 -3
  614. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +1 -1
  615. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +13 -13
  616. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +16 -16
  617. package/vscode-dts/vscode.proposed.authIssuers.d.ts +14 -0
  618. package/vscode-dts/vscode.proposed.chatOutputRenderer.d.ts +23 -3
  619. package/vscode-dts/vscode.proposed.chatProvider.d.ts +0 -9
  620. package/vscode-dts/vscode.proposed.chatStatusItem.d.ts +5 -0
  621. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputStateCache.service.d.ts +0 -7
  622. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputStateCache.service.js +0 -6
  623. package/vscode/src/vs/workbench/contrib/chat/common/tools/toolResultCompressor.d.ts +0 -39
  624. package/vscode/src/vs/workbench/contrib/chat/common/widget/input/modelPickerWidget.d.ts +0 -4
  625. package/vscode/src/vs/workbench/contrib/chat/common/widget/input/modelPickerWidget.js +0 -9
  626. package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.d.ts +0 -76
  627. package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +0 -470
  628. package/vscode/src/vs/workbench/contrib/extensions/browser/media/runtimeExtensionsEditor.css +0 -86
  629. package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.d.ts +0 -15
  630. package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.js +0 -47
@@ -0,0 +1,1963 @@
1
+
2
+ import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
3
+ import { addDisposableListener, append, $, reset, scheduleAtNextAnimationFrame, getWindow, h } from '../../../../../base/browser/dom.js';
4
+ import { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';
5
+ import { Schemas } from '../../../../../base/common/network.js';
6
+ import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
7
+ import { PropertyFoldingState, NotebookDocumentMetadataViewModel, SideBySideDiffElementViewModel, getFormattedOutputJSON, OUTPUT_EDITOR_HEIGHT_MAGIC, OutputComparison, outputEqual } from './diffElementViewModel.js';
8
+ import { NOTEBOOK_DIFF_CELL_PROPERTY, NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED, DIFF_CELL_MARGIN, NOTEBOOK_DIFF_METADATA, DiffSide, NOTEBOOK_DIFF_CELL_INPUT, NOTEBOOK_DIFF_CELL_IGNORE_WHITESPACE } from './notebookDiffEditorBrowser.js';
9
+ import { CodeEditorWidget } from '../../../../../editor/browser/widget/codeEditor/codeEditorWidget.js';
10
+ import { IModelService } from '../../../../../editor/common/services/model.service.js';
11
+ import { ILanguageService } from '../../../../../editor/common/languages/language.service.js';
12
+ import { CellEditType, CellUri } from '../../common/notebookCommon.js';
13
+ import { IContextMenuService } from '../../../../../platform/contextview/browser/contextView.service.js';
14
+ import { MenuItemAction, MenuId } from '../../../../../platform/actions/common/actions.js';
15
+ import { IMenuService } from '../../../../../platform/actions/common/actions.service.js';
16
+ import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.service.js';
17
+ import { INotificationService } from '../../../../../platform/notification/common/notification.service.js';
18
+ import { getFlatActionBarActions } from '../../../../../platform/actions/browser/menuEntryActionViewItem.js';
19
+ import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.service.js';
20
+ import { CodiconActionViewItem } from '../view/cellParts/cellActionView.js';
21
+ import { collapsedIcon, expandedIcon } from '../notebookIcons.js';
22
+ import { OutputContainer } from './diffElementOutputs.js';
23
+ import { EditorExtensionsRegistry } from '../../../../../editor/browser/editorExtensions.js';
24
+ import { ContextMenuController } from '../../../../../editor/contrib/contextmenu/browser/contextmenu.js';
25
+ import { SnippetController2 } from '../../../../../editor/contrib/snippet/browser/snippetController2.js';
26
+ import { SuggestController } from '../../../../../editor/contrib/suggest/browser/suggestController.js';
27
+ import { MenuPreventer } from '../../../codeEditor/browser/menuPreventer.js';
28
+ import { SelectionClipboardContributionID } from '../../../codeEditor/browser/selectionClipboard.js';
29
+ import { TabCompletionController } from '../../../snippets/browser/tabCompletion.js';
30
+ import { renderIcon, renderLabelWithIcons } from '../../../../../base/browser/ui/iconLabel/iconLabels.js';
31
+ import { ITextModelService } from '../../../../../editor/common/services/resolverService.service.js';
32
+ import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.service.js';
33
+ import { IThemeService } from '../../../../../platform/theme/common/themeService.service.js';
34
+ import { WorkbenchToolBar } from '../../../../../platform/actions/browser/toolbar.js';
35
+ import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.service.js';
36
+ import { getEditorPadding, fixedDiffEditorOptions, fixedEditorOptions } from './diffCellEditorOptions.js';
37
+ import { AccessibilityVerbositySettingId } from '../../../accessibility/browser/accessibilityConfiguration.js';
38
+ import { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.service.js';
39
+ import { DiffEditorWidget } from '../../../../../editor/browser/widget/diffEditor/diffEditorWidget.js';
40
+ import { ICommandService } from '../../../../../platform/commands/common/commands.service.js';
41
+ import { localize } from '../../../../../nls.js';
42
+ import { Emitter } from '../../../../../base/common/event.js';
43
+ import { ITextResourceConfigurationService } from '../../../../../editor/common/services/textResourceConfiguration.service.js';
44
+ import { getFormattedMetadataJSON } from '../../common/model/notebookCellTextModel.js';
45
+ import { getUnchangedRegionSettings } from './unchangedEditorRegions.js';
46
+
47
+ function getOptimizedNestedCodeEditorWidgetOptions() {
48
+ return {
49
+ isSimpleWidget: false,
50
+ contributions: EditorExtensionsRegistry.getSomeEditorContributions([
51
+ MenuPreventer.ID,
52
+ SelectionClipboardContributionID,
53
+ ContextMenuController.ID,
54
+ SuggestController.ID,
55
+ SnippetController2.ID,
56
+ TabCompletionController.ID
57
+ ])
58
+ };
59
+ }
60
+ class CellDiffPlaceholderElement extends Disposable {
61
+ constructor(placeholder, templateData) {
62
+ super();
63
+ templateData.body.classList.remove("left", "right", "full");
64
+ const text = (placeholder.hiddenCells.length === 1) ? ( localize(11788, "{0} hidden cell", placeholder.hiddenCells.length)) : ( localize(11789, "{0} hidden cells", placeholder.hiddenCells.length));
65
+ templateData.placeholder.innerText = text;
66
+ this._register(addDisposableListener(templateData.placeholder, "dblclick", e => {
67
+ if (e.button !== 0) {
68
+ return;
69
+ }
70
+ e.preventDefault();
71
+ placeholder.showHiddenCells();
72
+ }));
73
+ this._register(templateData.marginOverlay.onAction(() => placeholder.showHiddenCells()));
74
+ templateData.marginOverlay.show();
75
+ }
76
+ }
77
+ let PropertyHeader = class PropertyHeader extends Disposable {
78
+ constructor(
79
+ cell,
80
+ propertyHeaderContainer,
81
+ notebookEditor,
82
+ accessor,
83
+ contextMenuService,
84
+ keybindingService,
85
+ commandService,
86
+ notificationService,
87
+ menuService,
88
+ contextKeyService,
89
+ themeService,
90
+ telemetryService,
91
+ accessibilityService
92
+ ) {
93
+ super();
94
+ this.cell = cell;
95
+ this.propertyHeaderContainer = propertyHeaderContainer;
96
+ this.notebookEditor = notebookEditor;
97
+ this.accessor = accessor;
98
+ this.contextMenuService = contextMenuService;
99
+ this.keybindingService = keybindingService;
100
+ this.commandService = commandService;
101
+ this.notificationService = notificationService;
102
+ this.menuService = menuService;
103
+ this.contextKeyService = contextKeyService;
104
+ this.themeService = themeService;
105
+ this.telemetryService = telemetryService;
106
+ this.accessibilityService = accessibilityService;
107
+ }
108
+ buildHeader() {
109
+ this._foldingIndicator = append(this.propertyHeaderContainer, $(".property-folding-indicator"));
110
+ this._foldingIndicator.classList.add(this.accessor.prefix);
111
+ const metadataStatus = append(this.propertyHeaderContainer, $("div.property-status"));
112
+ this._statusSpan = append(metadataStatus, $("span"));
113
+ this._description = append(metadataStatus, $("span.property-description"));
114
+ const cellToolbarContainer = append(this.propertyHeaderContainer, $("div.property-toolbar"));
115
+ this._toolbar = this._register(( new WorkbenchToolBar(cellToolbarContainer, {
116
+ actionViewItemProvider: (action, options) => {
117
+ if (action instanceof MenuItemAction) {
118
+ const item = ( new CodiconActionViewItem(action, {
119
+ hoverDelegate: options.hoverDelegate
120
+ }, this.keybindingService, this.notificationService, this.contextKeyService, this.themeService, this.contextMenuService, this.accessibilityService));
121
+ return item;
122
+ }
123
+ return undefined;
124
+ }
125
+ }, this.menuService, this.contextKeyService, this.contextMenuService, this.keybindingService, this.commandService, this.telemetryService)));
126
+ this._toolbar.context = this.cell;
127
+ const scopedContextKeyService = this.contextKeyService.createScoped(cellToolbarContainer);
128
+ this._register(scopedContextKeyService);
129
+ this._propertyChanged = NOTEBOOK_DIFF_CELL_PROPERTY.bindTo(scopedContextKeyService);
130
+ this._propertyExpanded = NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED.bindTo(scopedContextKeyService);
131
+ this._menu = this._register(this.menuService.createMenu(this.accessor.menuId, scopedContextKeyService));
132
+ this._register(this._menu.onDidChange(() => this.updateMenu()));
133
+ this._register(this.notebookEditor.onMouseUp(e => {
134
+ if (!e.event.target || e.target !== this.cell) {
135
+ return;
136
+ }
137
+ const target = e.event.target;
138
+ if (target === this.propertyHeaderContainer || target === this._foldingIndicator || this._foldingIndicator.contains(target) || target === metadataStatus || metadataStatus.contains(target)) {
139
+ const oldFoldingState = this.accessor.getFoldingState();
140
+ this.accessor.updateFoldingState(
141
+ oldFoldingState === PropertyFoldingState.Expanded ? PropertyFoldingState.Collapsed : PropertyFoldingState.Expanded
142
+ );
143
+ this._updateFoldingIcon();
144
+ this.accessor.updateInfoRendering(this.cell.renderOutput);
145
+ }
146
+ }));
147
+ this.refresh();
148
+ this.accessor.updateInfoRendering(this.cell.renderOutput);
149
+ }
150
+ refresh() {
151
+ this.updateMenu();
152
+ this._updateFoldingIcon();
153
+ const metadataChanged = this.accessor.checkIfModified();
154
+ if (this._propertyChanged) {
155
+ this._propertyChanged.set(!!metadataChanged);
156
+ }
157
+ if (metadataChanged) {
158
+ this._statusSpan.textContent = this.accessor.changedLabel;
159
+ this._statusSpan.style.fontWeight = "bold";
160
+ if (metadataChanged.reason) {
161
+ this._description.textContent = metadataChanged.reason;
162
+ }
163
+ this.propertyHeaderContainer.classList.add("modified");
164
+ } else {
165
+ this._statusSpan.textContent = this.accessor.unChangedLabel;
166
+ this._statusSpan.style.fontWeight = "normal";
167
+ this._description.textContent = "";
168
+ this.propertyHeaderContainer.classList.remove("modified");
169
+ }
170
+ }
171
+ updateMenu() {
172
+ const metadataChanged = this.accessor.checkIfModified();
173
+ if (metadataChanged) {
174
+ const actions = getFlatActionBarActions(this._menu.getActions({
175
+ shouldForwardArgs: true
176
+ }));
177
+ this._toolbar.setActions(actions);
178
+ } else {
179
+ this._toolbar.setActions([]);
180
+ }
181
+ }
182
+ _updateFoldingIcon() {
183
+ if (this.accessor.getFoldingState() === PropertyFoldingState.Collapsed) {
184
+ reset(this._foldingIndicator, renderIcon(collapsedIcon));
185
+ this._propertyExpanded?.set(false);
186
+ } else {
187
+ reset(this._foldingIndicator, renderIcon(expandedIcon));
188
+ this._propertyExpanded?.set(true);
189
+ }
190
+ }
191
+ };
192
+ PropertyHeader = ( __decorate([( __param(4, IContextMenuService)), ( __param(5, IKeybindingService)), ( __param(6, ICommandService)), ( __param(7, INotificationService)), ( __param(8, IMenuService)), ( __param(9, IContextKeyService)), ( __param(10, IThemeService)), ( __param(11, ITelemetryService)), ( __param(12, IAccessibilityService))], PropertyHeader));
193
+ let NotebookDocumentMetadataElement = class NotebookDocumentMetadataElement extends Disposable {
194
+ constructor(
195
+ notebookEditor,
196
+ viewModel,
197
+ templateData,
198
+ instantiationService,
199
+ textModelService,
200
+ menuService,
201
+ contextKeyService,
202
+ textConfigurationService,
203
+ configurationService
204
+ ) {
205
+ super();
206
+ this.notebookEditor = notebookEditor;
207
+ this.viewModel = viewModel;
208
+ this.templateData = templateData;
209
+ this.instantiationService = instantiationService;
210
+ this.textModelService = textModelService;
211
+ this.menuService = menuService;
212
+ this.contextKeyService = contextKeyService;
213
+ this.textConfigurationService = textConfigurationService;
214
+ this.configurationService = configurationService;
215
+ this._editor = templateData.sourceEditor;
216
+ this._cellHeaderContainer = this.templateData.cellHeaderContainer;
217
+ this._editorContainer = this.templateData.editorContainer;
218
+ this._diffEditorContainer = this.templateData.diffEditorContainer;
219
+ this._editorViewStateChanged = false;
220
+ this._register(viewModel.onDidLayoutChange(e => {
221
+ this.layout(e);
222
+ this.updateBorders();
223
+ }));
224
+ this.buildBody();
225
+ this.updateBorders();
226
+ }
227
+ buildBody() {
228
+ const body = this.templateData.body;
229
+ body.classList.remove("full");
230
+ body.classList.add("full");
231
+ this.updateSourceEditor();
232
+ if (this.viewModel instanceof NotebookDocumentMetadataViewModel) {
233
+ this._register(this.viewModel.modifiedMetadata.onDidChange(e => {
234
+ this._cellHeader.refresh();
235
+ }));
236
+ }
237
+ }
238
+ layoutNotebookCell() {
239
+ this.notebookEditor.layoutNotebookCell(this.viewModel, this.viewModel.layoutInfo.totalHeight);
240
+ }
241
+ updateBorders() {
242
+ this.templateData.leftBorder.style.height = `${this.viewModel.layoutInfo.totalHeight - 32}px`;
243
+ this.templateData.rightBorder.style.height = `${this.viewModel.layoutInfo.totalHeight - 32}px`;
244
+ this.templateData.bottomBorder.style.top = `${this.viewModel.layoutInfo.totalHeight - 32}px`;
245
+ }
246
+ updateSourceEditor() {
247
+ this._cellHeaderContainer.style.display = "flex";
248
+ this._cellHeaderContainer.innerText = "";
249
+ this._editorContainer.classList.add("diff");
250
+ const updateSourceEditor = () => {
251
+ if (this.viewModel.cellFoldingState === PropertyFoldingState.Collapsed) {
252
+ this._editorContainer.style.display = "none";
253
+ this.viewModel.editorHeight = 0;
254
+ return;
255
+ }
256
+ const lineHeight = this.notebookEditor.getLayoutInfo().fontInfo.lineHeight || 17;
257
+ const editorHeight = this.viewModel.layoutInfo.editorHeight !== 0 ? this.viewModel.layoutInfo.editorHeight : this.viewModel.computeInputEditorHeight(lineHeight);
258
+ this._editorContainer.style.height = `${editorHeight}px`;
259
+ this._editorContainer.style.display = "block";
260
+ const contentHeight = this._editor.getContentHeight();
261
+ if (contentHeight >= 0) {
262
+ this.viewModel.editorHeight = contentHeight;
263
+ }
264
+ return editorHeight;
265
+ };
266
+ const renderSourceEditor = () => {
267
+ const editorHeight = updateSourceEditor();
268
+ if (!editorHeight) {
269
+ return;
270
+ }
271
+ const lineCount = this.viewModel.modifiedMetadata.textBuffer.getLineCount();
272
+ const options = {
273
+ padding: getEditorPadding(lineCount)
274
+ };
275
+ const unchangedRegions = this._register(getUnchangedRegionSettings(this.configurationService));
276
+ if (unchangedRegions.options.enabled) {
277
+ options.hideUnchangedRegions = unchangedRegions.options;
278
+ }
279
+ this._editor.updateOptions(options);
280
+ this._register(unchangedRegions.onDidChangeEnablement(() => {
281
+ options.hideUnchangedRegions = unchangedRegions.options;
282
+ this._editor.updateOptions(options);
283
+ }));
284
+ this._editor.layout({
285
+ width: this.notebookEditor.getLayoutInfo().width - 2 * DIFF_CELL_MARGIN,
286
+ height: editorHeight
287
+ });
288
+ this._register(this._editor.onDidContentSizeChange(e => {
289
+ if (this.viewModel.cellFoldingState === PropertyFoldingState.Expanded && e.contentHeightChanged && this.viewModel.layoutInfo.editorHeight !== e.contentHeight) {
290
+ this.viewModel.editorHeight = e.contentHeight;
291
+ }
292
+ }));
293
+ this._initializeSourceDiffEditor();
294
+ };
295
+ this._cellHeader = this._register(this.instantiationService.createInstance(
296
+ PropertyHeader,
297
+ this.viewModel,
298
+ this._cellHeaderContainer,
299
+ this.notebookEditor,
300
+ {
301
+ updateInfoRendering: () => renderSourceEditor(),
302
+ checkIfModified: () => {
303
+ return this.viewModel.originalMetadata.getHash() !== this.viewModel.modifiedMetadata.getHash() ? {
304
+ reason: undefined
305
+ } : false;
306
+ },
307
+ getFoldingState: () => this.viewModel.cellFoldingState,
308
+ updateFoldingState: state => this.viewModel.cellFoldingState = state,
309
+ unChangedLabel: "Notebook Metadata",
310
+ changedLabel: "Notebook Metadata changed",
311
+ prefix: "metadata",
312
+ menuId: MenuId.NotebookDiffDocumentMetadata
313
+ }
314
+ ));
315
+ this._cellHeader.buildHeader();
316
+ renderSourceEditor();
317
+ const scopedContextKeyService = this.contextKeyService.createScoped(this.templateData.inputToolbarContainer);
318
+ this._register(scopedContextKeyService);
319
+ const inputChanged = NOTEBOOK_DIFF_METADATA.bindTo(scopedContextKeyService);
320
+ inputChanged.set(
321
+ this.viewModel.originalMetadata.getHash() !== this.viewModel.modifiedMetadata.getHash()
322
+ );
323
+ this._toolbar = this.templateData.toolbar;
324
+ this._toolbar.context = this.viewModel;
325
+ const refreshToolbar = () => {
326
+ const hasChanges = this.viewModel.originalMetadata.getHash() !== this.viewModel.modifiedMetadata.getHash();
327
+ inputChanged.set(hasChanges);
328
+ if (hasChanges) {
329
+ const menu = this.menuService.getMenuActions(MenuId.NotebookDiffDocumentMetadata, scopedContextKeyService, {
330
+ shouldForwardArgs: true
331
+ });
332
+ const actions = getFlatActionBarActions(menu);
333
+ this._toolbar.setActions(actions);
334
+ } else {
335
+ this._toolbar.setActions([]);
336
+ }
337
+ };
338
+ this._register(this.viewModel.modifiedMetadata.onDidChange(() => {
339
+ refreshToolbar();
340
+ }));
341
+ refreshToolbar();
342
+ }
343
+ async _initializeSourceDiffEditor() {
344
+ const [originalRef, modifiedRef] = await Promise.all([
345
+ this.textModelService.createModelReference(this.viewModel.originalMetadata.uri),
346
+ this.textModelService.createModelReference(this.viewModel.modifiedMetadata.uri)
347
+ ]);
348
+ if (this._store.isDisposed) {
349
+ originalRef.dispose();
350
+ modifiedRef.dispose();
351
+ return;
352
+ }
353
+ this._register(originalRef);
354
+ this._register(modifiedRef);
355
+ const vm = this._register(this._editor.createViewModel({
356
+ original: originalRef.object.textEditorModel,
357
+ modified: modifiedRef.object.textEditorModel
358
+ }));
359
+ await vm.waitForDiff();
360
+ this._editor.setModel(vm);
361
+ const handleViewStateChange = () => {
362
+ this._editorViewStateChanged = true;
363
+ };
364
+ const handleScrollChange = e => {
365
+ if (e.scrollTopChanged || e.scrollLeftChanged) {
366
+ this._editorViewStateChanged = true;
367
+ }
368
+ };
369
+ this.updateEditorOptionsForWhitespace();
370
+ this._register(
371
+ this._editor.getOriginalEditor().onDidChangeCursorSelection(handleViewStateChange)
372
+ );
373
+ this._register(this._editor.getOriginalEditor().onDidScrollChange(handleScrollChange));
374
+ this._register(
375
+ this._editor.getModifiedEditor().onDidChangeCursorSelection(handleViewStateChange)
376
+ );
377
+ this._register(this._editor.getModifiedEditor().onDidScrollChange(handleScrollChange));
378
+ const editorViewState = this.viewModel.getSourceEditorViewState();
379
+ if (editorViewState) {
380
+ this._editor.restoreViewState(editorViewState);
381
+ }
382
+ const contentHeight = this._editor.getContentHeight();
383
+ this.viewModel.editorHeight = contentHeight;
384
+ }
385
+ updateEditorOptionsForWhitespace() {
386
+ const editor = this._editor;
387
+ const uri = editor.getModel()?.modified.uri || editor.getModel()?.original.uri;
388
+ if (!uri) {
389
+ return;
390
+ }
391
+ const ignoreTrimWhitespace = this.textConfigurationService.getValue(uri, "diffEditor.ignoreTrimWhitespace");
392
+ editor.updateOptions({
393
+ ignoreTrimWhitespace
394
+ });
395
+ this._register(this.textConfigurationService.onDidChangeConfiguration(e => {
396
+ if (e.affectsConfiguration(uri, "diffEditor") && ( e.affectedKeys.has("diffEditor.ignoreTrimWhitespace"))) {
397
+ const ignoreTrimWhitespace = this.textConfigurationService.getValue(uri, "diffEditor.ignoreTrimWhitespace");
398
+ editor.updateOptions({
399
+ ignoreTrimWhitespace
400
+ });
401
+ }
402
+ }));
403
+ }
404
+ layout(state) {
405
+ scheduleAtNextAnimationFrame(getWindow(this._diffEditorContainer), () => {
406
+ if (state.editorHeight) {
407
+ this._editorContainer.style.height = `${this.viewModel.layoutInfo.editorHeight}px`;
408
+ this._editor.layout({
409
+ width: this._editor.getViewWidth(),
410
+ height: this.viewModel.layoutInfo.editorHeight
411
+ });
412
+ }
413
+ if (state.outerWidth) {
414
+ this._editorContainer.style.height = `${this.viewModel.layoutInfo.editorHeight}px`;
415
+ this._editor.layout();
416
+ }
417
+ this.layoutNotebookCell();
418
+ });
419
+ }
420
+ dispose() {
421
+ this._editor.setModel(null);
422
+ if (this._editorViewStateChanged) {
423
+ this.viewModel.saveSpirceEditorViewState(this._editor.saveViewState());
424
+ }
425
+ super.dispose();
426
+ }
427
+ };
428
+ NotebookDocumentMetadataElement = ( __decorate([( __param(3, IInstantiationService)), ( __param(4, ITextModelService)), ( __param(5, IMenuService)), ( __param(6, IContextKeyService)), ( __param(7, ITextResourceConfigurationService)), ( __param(8, IConfigurationService))], NotebookDocumentMetadataElement));
429
+ class AbstractElementRenderer extends Disposable {
430
+ constructor(
431
+ notebookEditor,
432
+ cell,
433
+ templateData,
434
+ style,
435
+ instantiationService,
436
+ languageService,
437
+ modelService,
438
+ textModelService,
439
+ contextMenuService,
440
+ keybindingService,
441
+ notificationService,
442
+ menuService,
443
+ contextKeyService,
444
+ configurationService,
445
+ textConfigurationService
446
+ ) {
447
+ super();
448
+ this.notebookEditor = notebookEditor;
449
+ this.cell = cell;
450
+ this.templateData = templateData;
451
+ this.style = style;
452
+ this.instantiationService = instantiationService;
453
+ this.languageService = languageService;
454
+ this.modelService = modelService;
455
+ this.textModelService = textModelService;
456
+ this.contextMenuService = contextMenuService;
457
+ this.keybindingService = keybindingService;
458
+ this.notificationService = notificationService;
459
+ this.menuService = menuService;
460
+ this.contextKeyService = contextKeyService;
461
+ this.configurationService = configurationService;
462
+ this.textConfigurationService = textConfigurationService;
463
+ this._metadataLocalDisposable = this._register(( new DisposableStore()));
464
+ this._outputLocalDisposable = this._register(( new DisposableStore()));
465
+ this._ignoreMetadata = false;
466
+ this._ignoreOutputs = false;
467
+ this._isDisposed = false;
468
+ this._metadataEditorDisposeStore = this._register(( new DisposableStore()));
469
+ this._outputEditorDisposeStore = this._register(( new DisposableStore()));
470
+ this._register(cell.onDidLayoutChange(e => {
471
+ this.layout(e);
472
+ }));
473
+ this._register(cell.onDidLayoutChange(e => this.updateBorders()));
474
+ this.init();
475
+ this.buildBody();
476
+ this._register(cell.onDidStateChange(() => {
477
+ this.updateOutputRendering(this.cell.renderOutput);
478
+ }));
479
+ }
480
+ buildBody() {
481
+ const body = this.templateData.body;
482
+ this._diffEditorContainer = this.templateData.diffEditorContainer;
483
+ body.classList.remove("left", "right", "full");
484
+ switch (this.style) {
485
+ case "left":
486
+ body.classList.add("left");
487
+ break;
488
+ case "right":
489
+ body.classList.add("right");
490
+ break;
491
+ default:
492
+ body.classList.add("full");
493
+ break;
494
+ }
495
+ this.styleContainer(this._diffEditorContainer);
496
+ this.updateSourceEditor();
497
+ if (this.cell.modified) {
498
+ this._register(
499
+ this.cell.modified.textModel.onDidChangeContent(() => this._cellHeader.refresh())
500
+ );
501
+ }
502
+ this._ignoreMetadata = this.configurationService.getValue("notebook.diff.ignoreMetadata");
503
+ if (this._ignoreMetadata) {
504
+ this._disposeMetadata();
505
+ } else {
506
+ this._buildMetadata();
507
+ }
508
+ this._ignoreOutputs = this.configurationService.getValue("notebook.diff.ignoreOutputs") || !!(this.notebookEditor.textModel?.transientOptions.transientOutputs);
509
+ if (this._ignoreOutputs) {
510
+ this._disposeOutput();
511
+ } else {
512
+ this._buildOutput();
513
+ }
514
+ this._register(this.configurationService.onDidChangeConfiguration(e => {
515
+ let metadataLayoutChange = false;
516
+ let outputLayoutChange = false;
517
+ if (e.affectsConfiguration("notebook.diff.ignoreMetadata")) {
518
+ const newValue = this.configurationService.getValue("notebook.diff.ignoreMetadata");
519
+ if (newValue !== undefined && this._ignoreMetadata !== newValue) {
520
+ this._ignoreMetadata = newValue;
521
+ this._metadataLocalDisposable.clear();
522
+ if (this.configurationService.getValue("notebook.diff.ignoreMetadata")) {
523
+ this._disposeMetadata();
524
+ } else {
525
+ this.cell.metadataStatusHeight = 25;
526
+ this._buildMetadata();
527
+ this.updateMetadataRendering();
528
+ metadataLayoutChange = true;
529
+ }
530
+ }
531
+ }
532
+ if (e.affectsConfiguration("notebook.diff.ignoreOutputs")) {
533
+ const newValue = this.configurationService.getValue("notebook.diff.ignoreOutputs");
534
+ if (newValue !== undefined && this._ignoreOutputs !== (newValue || this.notebookEditor.textModel?.transientOptions.transientOutputs)) {
535
+ this._ignoreOutputs = newValue || !!(this.notebookEditor.textModel?.transientOptions.transientOutputs);
536
+ this._outputLocalDisposable.clear();
537
+ if (this._ignoreOutputs) {
538
+ this._disposeOutput();
539
+ this.cell.layoutChange();
540
+ } else {
541
+ this.cell.outputStatusHeight = 25;
542
+ this._buildOutput();
543
+ outputLayoutChange = true;
544
+ }
545
+ }
546
+ }
547
+ if (metadataLayoutChange || outputLayoutChange) {
548
+ this.layout({
549
+ metadataHeight: metadataLayoutChange,
550
+ outputTotalHeight: outputLayoutChange
551
+ });
552
+ }
553
+ }));
554
+ }
555
+ updateMetadataRendering() {
556
+ if (this.cell.metadataFoldingState === PropertyFoldingState.Expanded) {
557
+ this._metadataInfoContainer.style.display = "block";
558
+ if (!this._metadataEditorContainer || !this._metadataEditor) {
559
+ this._metadataEditorContainer = append(this._metadataInfoContainer, $(".metadata-editor-container"));
560
+ this._buildMetadataEditor();
561
+ } else {
562
+ this.cell.metadataHeight = this._metadataEditor.getContentHeight();
563
+ }
564
+ } else {
565
+ this._metadataInfoContainer.style.display = "none";
566
+ this.cell.metadataHeight = 0;
567
+ }
568
+ }
569
+ updateOutputRendering(renderRichOutput) {
570
+ if (this.cell.outputFoldingState === PropertyFoldingState.Expanded) {
571
+ this._outputInfoContainer.style.display = "block";
572
+ if (renderRichOutput) {
573
+ this._hideOutputsRaw();
574
+ this._buildOutputRendererContainer();
575
+ this._showOutputsRenderer();
576
+ this._showOutputsEmptyView();
577
+ } else {
578
+ this._hideOutputsRenderer();
579
+ this._buildOutputRawContainer();
580
+ this._showOutputsRaw();
581
+ }
582
+ } else {
583
+ this._outputInfoContainer.style.display = "none";
584
+ this._hideOutputsRaw();
585
+ this._hideOutputsRenderer();
586
+ this._hideOutputsEmptyView();
587
+ }
588
+ }
589
+ _buildOutputRawContainer() {
590
+ if (!this._outputEditorContainer) {
591
+ this._outputEditorContainer = append(this._outputInfoContainer, $(".output-editor-container"));
592
+ this._buildOutputEditor();
593
+ }
594
+ }
595
+ _showOutputsRaw() {
596
+ if (this._outputEditorContainer) {
597
+ this._outputEditorContainer.style.display = "block";
598
+ this.cell.rawOutputHeight = this._outputEditor.getContentHeight();
599
+ }
600
+ }
601
+ _showOutputsEmptyView() {
602
+ this.cell.layoutChange();
603
+ }
604
+ _hideOutputsRaw() {
605
+ if (this._outputEditorContainer) {
606
+ this._outputEditorContainer.style.display = "none";
607
+ this.cell.rawOutputHeight = 0;
608
+ }
609
+ }
610
+ _hideOutputsEmptyView() {
611
+ this.cell.layoutChange();
612
+ }
613
+ _applySanitizedMetadataChanges(currentMetadata, newMetadata) {
614
+ const result = {};
615
+ try {
616
+ const newMetadataObj = JSON.parse(newMetadata);
617
+ const keys = ( new Set([...( Object.keys(newMetadataObj))]));
618
+ for (const key of keys) {
619
+ switch (key) {
620
+ case "inputCollapsed":
621
+ case "outputCollapsed":
622
+ if (typeof newMetadataObj[key] === "boolean") {
623
+ result[key] = newMetadataObj[key];
624
+ } else {
625
+ result[key] = currentMetadata[key];
626
+ }
627
+ break;
628
+ default:
629
+ result[key] = newMetadataObj[key];
630
+ break;
631
+ }
632
+ }
633
+ const index = this.notebookEditor.textModel.cells.indexOf(this.cell.modified.textModel);
634
+ if (index < 0) {
635
+ return;
636
+ }
637
+ this.notebookEditor.textModel.applyEdits([{
638
+ editType: CellEditType.Metadata,
639
+ index,
640
+ metadata: result
641
+ }], true, undefined, () => undefined, undefined, true);
642
+ } catch {}
643
+ }
644
+ async _buildMetadataEditor() {
645
+ this._metadataEditorDisposeStore.clear();
646
+ if (this.cell instanceof SideBySideDiffElementViewModel) {
647
+ this._metadataEditor = this.instantiationService.createInstance(DiffEditorWidget, this._metadataEditorContainer, {
648
+ ...fixedDiffEditorOptions,
649
+ overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode(),
650
+ readOnly: false,
651
+ originalEditable: false,
652
+ ignoreTrimWhitespace: false,
653
+ automaticLayout: false,
654
+ dimension: {
655
+ height: this.cell.layoutInfo.metadataHeight,
656
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), true, true)
657
+ }
658
+ }, {
659
+ originalEditor: getOptimizedNestedCodeEditorWidgetOptions(),
660
+ modifiedEditor: getOptimizedNestedCodeEditorWidgetOptions()
661
+ });
662
+ const unchangedRegions = this._register(getUnchangedRegionSettings(this.configurationService));
663
+ if (unchangedRegions.options.enabled) {
664
+ this._metadataEditor.updateOptions({
665
+ hideUnchangedRegions: unchangedRegions.options
666
+ });
667
+ }
668
+ this._metadataEditorDisposeStore.add(unchangedRegions.onDidChangeEnablement(() => {
669
+ if (this._metadataEditor) {
670
+ this._metadataEditor.updateOptions({
671
+ hideUnchangedRegions: unchangedRegions.options
672
+ });
673
+ }
674
+ }));
675
+ this.layout({
676
+ metadataHeight: true
677
+ });
678
+ this._metadataEditorDisposeStore.add(this._metadataEditor);
679
+ this._metadataEditorContainer?.classList.add("diff");
680
+ const [originalMetadataModel, modifiedMetadataModel] = await Promise.all([
681
+ this.textModelService.createModelReference(CellUri.generateCellPropertyUri(
682
+ this.cell.originalDocument.uri,
683
+ this.cell.original.handle,
684
+ Schemas.vscodeNotebookCellMetadata
685
+ )),
686
+ this.textModelService.createModelReference(CellUri.generateCellPropertyUri(
687
+ this.cell.modifiedDocument.uri,
688
+ this.cell.modified.handle,
689
+ Schemas.vscodeNotebookCellMetadata
690
+ ))
691
+ ]);
692
+ if (this._isDisposed) {
693
+ originalMetadataModel.dispose();
694
+ modifiedMetadataModel.dispose();
695
+ return;
696
+ }
697
+ this._metadataEditorDisposeStore.add(originalMetadataModel);
698
+ this._metadataEditorDisposeStore.add(modifiedMetadataModel);
699
+ const vm = this._metadataEditor.createViewModel({
700
+ original: originalMetadataModel.object.textEditorModel,
701
+ modified: modifiedMetadataModel.object.textEditorModel
702
+ });
703
+ this._metadataEditor.setModel(vm);
704
+ await vm.waitForDiff();
705
+ if (this._isDisposed) {
706
+ return;
707
+ }
708
+ this.cell.metadataHeight = this._metadataEditor.getContentHeight();
709
+ this._metadataEditorDisposeStore.add(this._metadataEditor.onDidContentSizeChange(e => {
710
+ if (e.contentHeightChanged && this.cell.metadataFoldingState === PropertyFoldingState.Expanded) {
711
+ this.cell.metadataHeight = e.contentHeight;
712
+ }
713
+ }));
714
+ let respondingToContentChange = false;
715
+ this._metadataEditorDisposeStore.add(modifiedMetadataModel.object.textEditorModel.onDidChangeContent(() => {
716
+ respondingToContentChange = true;
717
+ const value = modifiedMetadataModel.object.textEditorModel.getValue();
718
+ this._applySanitizedMetadataChanges(this.cell.modified.metadata, value);
719
+ this._metadataHeader.refresh();
720
+ respondingToContentChange = false;
721
+ }));
722
+ this._metadataEditorDisposeStore.add(this.cell.modified.textModel.onDidChangeMetadata(() => {
723
+ if (respondingToContentChange) {
724
+ return;
725
+ }
726
+ const modifiedMetadataSource = getFormattedMetadataJSON(
727
+ this.notebookEditor.textModel?.transientOptions.transientCellMetadata,
728
+ this.cell.modified?.metadata || {},
729
+ this.cell.modified?.language,
730
+ true
731
+ );
732
+ modifiedMetadataModel.object.textEditorModel.setValue(modifiedMetadataSource);
733
+ }));
734
+ return;
735
+ } else {
736
+ this._metadataEditor = this.instantiationService.createInstance(CodeEditorWidget, this._metadataEditorContainer, {
737
+ ...fixedEditorOptions,
738
+ dimension: {
739
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, true),
740
+ height: this.cell.layoutInfo.metadataHeight
741
+ },
742
+ overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode(),
743
+ readOnly: false,
744
+ allowVariableLineHeights: false
745
+ }, {});
746
+ this.layout({
747
+ metadataHeight: true
748
+ });
749
+ this._metadataEditorDisposeStore.add(this._metadataEditor);
750
+ const mode = this.languageService.createById("jsonc");
751
+ const originalMetadataSource = getFormattedMetadataJSON(
752
+ this.notebookEditor.textModel?.transientOptions.transientCellMetadata,
753
+ this.cell.type === "insert" ? this.cell.modified.metadata || {} : this.cell.original.metadata || {},
754
+ undefined,
755
+ true
756
+ );
757
+ const uri = this.cell.type === "insert" ? this.cell.modified.uri : this.cell.original.uri;
758
+ const handle = this.cell.type === "insert" ? this.cell.modified.handle : this.cell.original.handle;
759
+ const modelUri = CellUri.generateCellPropertyUri(uri, handle, Schemas.vscodeNotebookCellMetadata);
760
+ const metadataModel = this.modelService.createModel(originalMetadataSource, mode, modelUri, false);
761
+ this._metadataEditor.setModel(metadataModel);
762
+ this._metadataEditorDisposeStore.add(metadataModel);
763
+ this.cell.metadataHeight = this._metadataEditor.getContentHeight();
764
+ this._metadataEditorDisposeStore.add(this._metadataEditor.onDidContentSizeChange(e => {
765
+ if (e.contentHeightChanged && this.cell.metadataFoldingState === PropertyFoldingState.Expanded) {
766
+ this.cell.metadataHeight = e.contentHeight;
767
+ }
768
+ }));
769
+ }
770
+ }
771
+ _buildOutputEditor() {
772
+ this._outputEditorDisposeStore.clear();
773
+ if ((this.cell.type === "modified" || this.cell.type === "unchanged") && !this.notebookEditor.textModel.transientOptions.transientOutputs) {
774
+ const originalOutputsSource = getFormattedOutputJSON(this.cell.original?.outputs || []);
775
+ const modifiedOutputsSource = getFormattedOutputJSON(this.cell.modified?.outputs || []);
776
+ if (originalOutputsSource !== modifiedOutputsSource) {
777
+ const mode = this.languageService.createById("json");
778
+ const originalModel = this.modelService.createModel(originalOutputsSource, mode, undefined, true);
779
+ const modifiedModel = this.modelService.createModel(modifiedOutputsSource, mode, undefined, true);
780
+ this._outputEditorDisposeStore.add(originalModel);
781
+ this._outputEditorDisposeStore.add(modifiedModel);
782
+ const lineHeight = this.notebookEditor.getLayoutInfo().fontInfo.lineHeight || 17;
783
+ const lineCount = Math.max(originalModel.getLineCount(), modifiedModel.getLineCount());
784
+ this._outputEditor = this.instantiationService.createInstance(DiffEditorWidget, this._outputEditorContainer, {
785
+ ...fixedDiffEditorOptions,
786
+ overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode(),
787
+ readOnly: true,
788
+ ignoreTrimWhitespace: false,
789
+ automaticLayout: false,
790
+ dimension: {
791
+ height: Math.min(
792
+ OUTPUT_EDITOR_HEIGHT_MAGIC,
793
+ this.cell.layoutInfo.rawOutputHeight || lineHeight * lineCount
794
+ ),
795
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, true)
796
+ },
797
+ accessibilityVerbose: this.configurationService.getValue(AccessibilityVerbositySettingId.DiffEditor) ?? false
798
+ }, {
799
+ originalEditor: getOptimizedNestedCodeEditorWidgetOptions(),
800
+ modifiedEditor: getOptimizedNestedCodeEditorWidgetOptions()
801
+ });
802
+ this._outputEditorDisposeStore.add(this._outputEditor);
803
+ this._outputEditorContainer?.classList.add("diff");
804
+ this._outputEditor.setModel({
805
+ original: originalModel,
806
+ modified: modifiedModel
807
+ });
808
+ this._outputEditor.restoreViewState(this.cell.getOutputEditorViewState());
809
+ this.cell.rawOutputHeight = this._outputEditor.getContentHeight();
810
+ this._outputEditorDisposeStore.add(this._outputEditor.onDidContentSizeChange(e => {
811
+ if (e.contentHeightChanged && this.cell.outputFoldingState === PropertyFoldingState.Expanded) {
812
+ this.cell.rawOutputHeight = e.contentHeight;
813
+ }
814
+ }));
815
+ this._outputEditorDisposeStore.add(this.cell.modified.textModel.onDidChangeOutputs(() => {
816
+ const modifiedOutputsSource = getFormattedOutputJSON(this.cell.modified?.outputs || []);
817
+ modifiedModel.setValue(modifiedOutputsSource);
818
+ this._outputHeader.refresh();
819
+ }));
820
+ return;
821
+ }
822
+ }
823
+ this._outputEditor = this.instantiationService.createInstance(CodeEditorWidget, this._outputEditorContainer, {
824
+ ...fixedEditorOptions,
825
+ dimension: {
826
+ width: Math.min(OUTPUT_EDITOR_HEIGHT_MAGIC, this.cell.getComputedCellContainerWidth(
827
+ this.notebookEditor.getLayoutInfo(),
828
+ false,
829
+ this.cell.type === "unchanged" || this.cell.type === "modified"
830
+ ) - 32),
831
+ height: this.cell.layoutInfo.rawOutputHeight
832
+ },
833
+ overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode(),
834
+ allowVariableLineHeights: false
835
+ }, {});
836
+ this._outputEditorDisposeStore.add(this._outputEditor);
837
+ const mode = this.languageService.createById("json");
838
+ const originaloutputSource = getFormattedOutputJSON(
839
+ this.notebookEditor.textModel.transientOptions.transientOutputs ? [] : this.cell.type === "insert" ? this.cell.modified?.outputs || [] : this.cell.original?.outputs || []
840
+ );
841
+ const outputModel = this.modelService.createModel(originaloutputSource, mode, undefined, true);
842
+ this._outputEditorDisposeStore.add(outputModel);
843
+ this._outputEditor.setModel(outputModel);
844
+ this._outputEditor.restoreViewState(this.cell.getOutputEditorViewState());
845
+ this.cell.rawOutputHeight = this._outputEditor.getContentHeight();
846
+ this._outputEditorDisposeStore.add(this._outputEditor.onDidContentSizeChange(e => {
847
+ if (e.contentHeightChanged && this.cell.outputFoldingState === PropertyFoldingState.Expanded) {
848
+ this.cell.rawOutputHeight = e.contentHeight;
849
+ }
850
+ }));
851
+ }
852
+ layoutNotebookCell() {
853
+ this.notebookEditor.layoutNotebookCell(this.cell, this.cell.layoutInfo.totalHeight);
854
+ }
855
+ updateBorders() {
856
+ this.templateData.leftBorder.style.height = `${this.cell.layoutInfo.totalHeight - 32}px`;
857
+ this.templateData.rightBorder.style.height = `${this.cell.layoutInfo.totalHeight - 32}px`;
858
+ this.templateData.bottomBorder.style.top = `${this.cell.layoutInfo.totalHeight - 32}px`;
859
+ }
860
+ dispose() {
861
+ if (this._outputEditor) {
862
+ this.cell.saveOutputEditorViewState(this._outputEditor.saveViewState());
863
+ }
864
+ if (this._metadataEditor) {
865
+ this.cell.saveMetadataEditorViewState(this._metadataEditor.saveViewState());
866
+ }
867
+ this._metadataEditorDisposeStore.dispose();
868
+ this._outputEditorDisposeStore.dispose();
869
+ this._isDisposed = true;
870
+ super.dispose();
871
+ }
872
+ }
873
+ class SingleSideDiffElement extends AbstractElementRenderer {
874
+ constructor(
875
+ notebookEditor,
876
+ cell,
877
+ templateData,
878
+ style,
879
+ instantiationService,
880
+ languageService,
881
+ modelService,
882
+ textModelService,
883
+ contextMenuService,
884
+ keybindingService,
885
+ notificationService,
886
+ menuService,
887
+ contextKeyService,
888
+ configurationService,
889
+ textConfigurationService
890
+ ) {
891
+ super(
892
+ notebookEditor,
893
+ cell,
894
+ templateData,
895
+ style,
896
+ instantiationService,
897
+ languageService,
898
+ modelService,
899
+ textModelService,
900
+ contextMenuService,
901
+ keybindingService,
902
+ notificationService,
903
+ menuService,
904
+ contextKeyService,
905
+ configurationService,
906
+ textConfigurationService
907
+ );
908
+ this.cell = cell;
909
+ this.templateData = templateData;
910
+ this.updateBorders();
911
+ }
912
+ init() {
913
+ this._diagonalFill = this.templateData.diagonalFill;
914
+ }
915
+ buildBody() {
916
+ const body = this.templateData.body;
917
+ this._diffEditorContainer = this.templateData.diffEditorContainer;
918
+ body.classList.remove("left", "right", "full");
919
+ switch (this.style) {
920
+ case "left":
921
+ body.classList.add("left");
922
+ break;
923
+ case "right":
924
+ body.classList.add("right");
925
+ break;
926
+ default:
927
+ body.classList.add("full");
928
+ break;
929
+ }
930
+ this.styleContainer(this._diffEditorContainer);
931
+ this.updateSourceEditor();
932
+ if (this.configurationService.getValue("notebook.diff.ignoreMetadata")) {
933
+ this._disposeMetadata();
934
+ } else {
935
+ this._buildMetadata();
936
+ }
937
+ if (this.configurationService.getValue("notebook.diff.ignoreOutputs") || this.notebookEditor.textModel?.transientOptions.transientOutputs) {
938
+ this._disposeOutput();
939
+ } else {
940
+ this._buildOutput();
941
+ }
942
+ this._register(this.configurationService.onDidChangeConfiguration(e => {
943
+ let metadataLayoutChange = false;
944
+ let outputLayoutChange = false;
945
+ if (e.affectsConfiguration("notebook.diff.ignoreMetadata")) {
946
+ this._metadataLocalDisposable.clear();
947
+ if (this.configurationService.getValue("notebook.diff.ignoreMetadata")) {
948
+ this._disposeMetadata();
949
+ } else {
950
+ this.cell.metadataStatusHeight = 25;
951
+ this._buildMetadata();
952
+ this.updateMetadataRendering();
953
+ metadataLayoutChange = true;
954
+ }
955
+ }
956
+ if (e.affectsConfiguration("notebook.diff.ignoreOutputs")) {
957
+ this._outputLocalDisposable.clear();
958
+ if (this.configurationService.getValue("notebook.diff.ignoreOutputs") || this.notebookEditor.textModel?.transientOptions.transientOutputs) {
959
+ this._disposeOutput();
960
+ } else {
961
+ this.cell.outputStatusHeight = 25;
962
+ this._buildOutput();
963
+ outputLayoutChange = true;
964
+ }
965
+ }
966
+ if (metadataLayoutChange || outputLayoutChange) {
967
+ this.layout({
968
+ metadataHeight: metadataLayoutChange,
969
+ outputTotalHeight: outputLayoutChange
970
+ });
971
+ }
972
+ }));
973
+ }
974
+ updateSourceEditor() {
975
+ this._cellHeaderContainer = this.templateData.cellHeaderContainer;
976
+ this._cellHeaderContainer.style.display = "flex";
977
+ this._cellHeaderContainer.innerText = "";
978
+ this._editorContainer = this.templateData.editorContainer;
979
+ this._editorContainer.classList.add("diff");
980
+ const renderSourceEditor = () => {
981
+ if (this.cell.cellFoldingState === PropertyFoldingState.Collapsed) {
982
+ this._editorContainer.style.display = "none";
983
+ this.cell.editorHeight = 0;
984
+ return;
985
+ }
986
+ const lineHeight = this.notebookEditor.getLayoutInfo().fontInfo.lineHeight || 17;
987
+ const editorHeight = this.cell.computeInputEditorHeight(lineHeight);
988
+ this._editorContainer.style.height = `${editorHeight}px`;
989
+ this._editorContainer.style.display = "block";
990
+ if (this._editor) {
991
+ const contentHeight = this._editor.getContentHeight();
992
+ if (contentHeight >= 0) {
993
+ this.cell.editorHeight = contentHeight;
994
+ }
995
+ return;
996
+ }
997
+ this._editor = this.templateData.sourceEditor;
998
+ this._editor.layout({
999
+ width: (this.notebookEditor.getLayoutInfo().width - 2 * DIFF_CELL_MARGIN) / 2 - 18,
1000
+ height: editorHeight
1001
+ });
1002
+ this._editor.updateOptions({
1003
+ readOnly: this.readonly
1004
+ });
1005
+ this.cell.editorHeight = editorHeight;
1006
+ this._register(this._editor.onDidContentSizeChange(e => {
1007
+ if (this.cell.cellFoldingState === PropertyFoldingState.Expanded && e.contentHeightChanged && this.cell.layoutInfo.editorHeight !== e.contentHeight) {
1008
+ this.cell.editorHeight = e.contentHeight;
1009
+ }
1010
+ }));
1011
+ this._initializeSourceDiffEditor(this.nestedCellViewModel);
1012
+ };
1013
+ this._cellHeader = this._register(this.instantiationService.createInstance(
1014
+ PropertyHeader,
1015
+ this.cell,
1016
+ this._cellHeaderContainer,
1017
+ this.notebookEditor,
1018
+ {
1019
+ updateInfoRendering: () => renderSourceEditor(),
1020
+ checkIfModified: () => ({
1021
+ reason: undefined
1022
+ }),
1023
+ getFoldingState: () => this.cell.cellFoldingState,
1024
+ updateFoldingState: state => this.cell.cellFoldingState = state,
1025
+ unChangedLabel: "Input",
1026
+ changedLabel: "Input",
1027
+ prefix: "input",
1028
+ menuId: MenuId.NotebookDiffCellInputTitle
1029
+ }
1030
+ ));
1031
+ this._cellHeader.buildHeader();
1032
+ renderSourceEditor();
1033
+ this._initializeSourceDiffEditor(this.nestedCellViewModel);
1034
+ }
1035
+ calculateDiagonalFillHeight() {
1036
+ return this.cell.layoutInfo.cellStatusHeight + this.cell.layoutInfo.editorHeight + this.cell.layoutInfo.editorMargin + this.cell.layoutInfo.metadataStatusHeight + this.cell.layoutInfo.metadataHeight + this.cell.layoutInfo.outputTotalHeight + this.cell.layoutInfo.outputStatusHeight;
1037
+ }
1038
+ async _initializeSourceDiffEditor(modifiedCell) {
1039
+ const modifiedRef = await this.textModelService.createModelReference(modifiedCell.uri);
1040
+ if (this._isDisposed) {
1041
+ return;
1042
+ }
1043
+ const modifiedTextModel = modifiedRef.object.textEditorModel;
1044
+ this._register(modifiedRef);
1045
+ this._editor.setModel(modifiedTextModel);
1046
+ const editorViewState = this.cell.getSourceEditorViewState();
1047
+ if (editorViewState) {
1048
+ this._editor.restoreViewState(editorViewState);
1049
+ }
1050
+ const contentHeight = this._editor.getContentHeight();
1051
+ this.cell.editorHeight = contentHeight;
1052
+ const height = `${this.calculateDiagonalFillHeight()}px`;
1053
+ if (this._diagonalFill.style.height !== height) {
1054
+ this._diagonalFill.style.height = height;
1055
+ }
1056
+ }
1057
+ _disposeMetadata() {
1058
+ this.cell.metadataStatusHeight = 0;
1059
+ this.cell.metadataHeight = 0;
1060
+ this.templateData.cellHeaderContainer.style.display = "none";
1061
+ this.templateData.metadataHeaderContainer.style.display = "none";
1062
+ this.templateData.metadataInfoContainer.style.display = "none";
1063
+ this._metadataEditor = undefined;
1064
+ }
1065
+ _buildMetadata() {
1066
+ this._metadataHeaderContainer = this.templateData.metadataHeaderContainer;
1067
+ this._metadataInfoContainer = this.templateData.metadataInfoContainer;
1068
+ this._metadataHeaderContainer.style.display = "flex";
1069
+ this._metadataInfoContainer.style.display = "block";
1070
+ this._metadataHeaderContainer.innerText = "";
1071
+ this._metadataInfoContainer.innerText = "";
1072
+ this._metadataHeader = this.instantiationService.createInstance(
1073
+ PropertyHeader,
1074
+ this.cell,
1075
+ this._metadataHeaderContainer,
1076
+ this.notebookEditor,
1077
+ {
1078
+ updateInfoRendering: this.updateMetadataRendering.bind(this),
1079
+ checkIfModified: () => {
1080
+ return this.cell.checkMetadataIfModified();
1081
+ },
1082
+ getFoldingState: () => {
1083
+ return this.cell.metadataFoldingState;
1084
+ },
1085
+ updateFoldingState: state => {
1086
+ this.cell.metadataFoldingState = state;
1087
+ },
1088
+ unChangedLabel: "Metadata",
1089
+ changedLabel: "Metadata changed",
1090
+ prefix: "metadata",
1091
+ menuId: MenuId.NotebookDiffCellMetadataTitle
1092
+ }
1093
+ );
1094
+ this._metadataLocalDisposable.add(this._metadataHeader);
1095
+ this._metadataHeader.buildHeader();
1096
+ }
1097
+ _buildOutput() {
1098
+ this.templateData.outputHeaderContainer.style.display = "flex";
1099
+ this.templateData.outputInfoContainer.style.display = "block";
1100
+ this._outputHeaderContainer = this.templateData.outputHeaderContainer;
1101
+ this._outputInfoContainer = this.templateData.outputInfoContainer;
1102
+ this._outputHeaderContainer.innerText = "";
1103
+ this._outputInfoContainer.innerText = "";
1104
+ this._outputHeader = this.instantiationService.createInstance(
1105
+ PropertyHeader,
1106
+ this.cell,
1107
+ this._outputHeaderContainer,
1108
+ this.notebookEditor,
1109
+ {
1110
+ updateInfoRendering: this.updateOutputRendering.bind(this),
1111
+ checkIfModified: () => {
1112
+ return this.cell.checkIfOutputsModified();
1113
+ },
1114
+ getFoldingState: () => {
1115
+ return this.cell.outputFoldingState;
1116
+ },
1117
+ updateFoldingState: state => {
1118
+ this.cell.outputFoldingState = state;
1119
+ },
1120
+ unChangedLabel: "Outputs",
1121
+ changedLabel: "Outputs changed",
1122
+ prefix: "output",
1123
+ menuId: MenuId.NotebookDiffCellOutputsTitle
1124
+ }
1125
+ );
1126
+ this._outputLocalDisposable.add(this._outputHeader);
1127
+ this._outputHeader.buildHeader();
1128
+ }
1129
+ _disposeOutput() {
1130
+ this._hideOutputsRaw();
1131
+ this._hideOutputsRenderer();
1132
+ this._hideOutputsEmptyView();
1133
+ this.cell.rawOutputHeight = 0;
1134
+ this.cell.outputMetadataHeight = 0;
1135
+ this.cell.outputStatusHeight = 0;
1136
+ this.templateData.outputHeaderContainer.style.display = "none";
1137
+ this.templateData.outputInfoContainer.style.display = "none";
1138
+ this._outputViewContainer = undefined;
1139
+ }
1140
+ }
1141
+ let DeletedElement = class DeletedElement extends SingleSideDiffElement {
1142
+ constructor(
1143
+ notebookEditor,
1144
+ cell,
1145
+ templateData,
1146
+ languageService,
1147
+ modelService,
1148
+ textModelService,
1149
+ instantiationService,
1150
+ contextMenuService,
1151
+ keybindingService,
1152
+ notificationService,
1153
+ menuService,
1154
+ contextKeyService,
1155
+ configurationService,
1156
+ textConfigurationService
1157
+ ) {
1158
+ super(
1159
+ notebookEditor,
1160
+ cell,
1161
+ templateData,
1162
+ "left",
1163
+ instantiationService,
1164
+ languageService,
1165
+ modelService,
1166
+ textModelService,
1167
+ contextMenuService,
1168
+ keybindingService,
1169
+ notificationService,
1170
+ menuService,
1171
+ contextKeyService,
1172
+ configurationService,
1173
+ textConfigurationService
1174
+ );
1175
+ }
1176
+ get nestedCellViewModel() {
1177
+ return this.cell.original;
1178
+ }
1179
+ get readonly() {
1180
+ return true;
1181
+ }
1182
+ styleContainer(container) {
1183
+ container.classList.remove("inserted");
1184
+ container.classList.add("removed");
1185
+ }
1186
+ layout(state) {
1187
+ scheduleAtNextAnimationFrame(getWindow(this._diffEditorContainer), () => {
1188
+ if ((state.editorHeight || state.outerWidth) && this._editor) {
1189
+ this._editorContainer.style.height = `${this.cell.layoutInfo.editorHeight}px`;
1190
+ this._editor.layout({
1191
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, false),
1192
+ height: this.cell.layoutInfo.editorHeight
1193
+ });
1194
+ }
1195
+ if (state.outerWidth && this._editor) {
1196
+ this._editorContainer.style.height = `${this.cell.layoutInfo.editorHeight}px`;
1197
+ this._editor.layout();
1198
+ }
1199
+ if (state.metadataHeight || state.outerWidth) {
1200
+ this._metadataEditor?.layout({
1201
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, false),
1202
+ height: this.cell.layoutInfo.metadataHeight
1203
+ });
1204
+ }
1205
+ if (state.outputTotalHeight || state.outerWidth) {
1206
+ this._outputEditor?.layout({
1207
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, false),
1208
+ height: this.cell.layoutInfo.outputTotalHeight
1209
+ });
1210
+ }
1211
+ if (this._diagonalFill) {
1212
+ this._diagonalFill.style.height = `${this.calculateDiagonalFillHeight()}px`;
1213
+ }
1214
+ this.layoutNotebookCell();
1215
+ });
1216
+ }
1217
+ _buildOutputRendererContainer() {
1218
+ if (!this._outputViewContainer) {
1219
+ this._outputViewContainer = append(this._outputInfoContainer, $(".output-view-container"));
1220
+ this._outputEmptyElement = append(this._outputViewContainer, $(".output-empty-view"));
1221
+ const span = append(this._outputEmptyElement, $("span"));
1222
+ span.innerText = "No outputs to render";
1223
+ if (!this.cell.original?.outputs.length) {
1224
+ this._outputEmptyElement.style.display = "block";
1225
+ } else {
1226
+ this._outputEmptyElement.style.display = "none";
1227
+ }
1228
+ this.cell.layoutChange();
1229
+ this._outputLeftView = this.instantiationService.createInstance(
1230
+ OutputContainer,
1231
+ this.notebookEditor,
1232
+ this.notebookEditor.textModel,
1233
+ this.cell,
1234
+ this.cell.original,
1235
+ DiffSide.Original,
1236
+ this._outputViewContainer
1237
+ );
1238
+ this._register(this._outputLeftView);
1239
+ this._outputLeftView.render();
1240
+ const removedOutputRenderListener = this.notebookEditor.onDidDynamicOutputRendered(e => {
1241
+ if (( e.cell.uri.toString()) === ( this.cell.original.uri.toString())) {
1242
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Original, this.cell.original.id, ["nb-cellDeleted"], []);
1243
+ removedOutputRenderListener.dispose();
1244
+ }
1245
+ });
1246
+ this._register(removedOutputRenderListener);
1247
+ }
1248
+ this._outputViewContainer.style.display = "block";
1249
+ }
1250
+ _decorate() {
1251
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Original, this.cell.original.id, ["nb-cellDeleted"], []);
1252
+ }
1253
+ _showOutputsRenderer() {
1254
+ if (this._outputViewContainer) {
1255
+ this._outputViewContainer.style.display = "block";
1256
+ this._outputLeftView?.showOutputs();
1257
+ this._decorate();
1258
+ }
1259
+ }
1260
+ _hideOutputsRenderer() {
1261
+ if (this._outputViewContainer) {
1262
+ this._outputViewContainer.style.display = "none";
1263
+ this._outputLeftView?.hideOutputs();
1264
+ }
1265
+ }
1266
+ dispose() {
1267
+ if (this._editor) {
1268
+ this.cell.saveSpirceEditorViewState(this._editor.saveViewState());
1269
+ }
1270
+ super.dispose();
1271
+ }
1272
+ };
1273
+ DeletedElement = ( __decorate([( __param(3, ILanguageService)), ( __param(4, IModelService)), ( __param(5, ITextModelService)), ( __param(6, IInstantiationService)), ( __param(7, IContextMenuService)), ( __param(8, IKeybindingService)), ( __param(9, INotificationService)), ( __param(10, IMenuService)), ( __param(11, IContextKeyService)), ( __param(12, IConfigurationService)), ( __param(13, ITextResourceConfigurationService))], DeletedElement));
1274
+ let InsertElement = class InsertElement extends SingleSideDiffElement {
1275
+ constructor(
1276
+ notebookEditor,
1277
+ cell,
1278
+ templateData,
1279
+ instantiationService,
1280
+ languageService,
1281
+ modelService,
1282
+ textModelService,
1283
+ contextMenuService,
1284
+ keybindingService,
1285
+ notificationService,
1286
+ menuService,
1287
+ contextKeyService,
1288
+ configurationService,
1289
+ textConfigurationService
1290
+ ) {
1291
+ super(
1292
+ notebookEditor,
1293
+ cell,
1294
+ templateData,
1295
+ "right",
1296
+ instantiationService,
1297
+ languageService,
1298
+ modelService,
1299
+ textModelService,
1300
+ contextMenuService,
1301
+ keybindingService,
1302
+ notificationService,
1303
+ menuService,
1304
+ contextKeyService,
1305
+ configurationService,
1306
+ textConfigurationService
1307
+ );
1308
+ }
1309
+ get nestedCellViewModel() {
1310
+ return this.cell.modified;
1311
+ }
1312
+ get readonly() {
1313
+ return false;
1314
+ }
1315
+ styleContainer(container) {
1316
+ container.classList.remove("removed");
1317
+ container.classList.add("inserted");
1318
+ }
1319
+ _buildOutputRendererContainer() {
1320
+ if (!this._outputViewContainer) {
1321
+ this._outputViewContainer = append(this._outputInfoContainer, $(".output-view-container"));
1322
+ this._outputEmptyElement = append(this._outputViewContainer, $(".output-empty-view"));
1323
+ this._outputEmptyElement.innerText = "No outputs to render";
1324
+ if (!this.cell.modified?.outputs.length) {
1325
+ this._outputEmptyElement.style.display = "block";
1326
+ } else {
1327
+ this._outputEmptyElement.style.display = "none";
1328
+ }
1329
+ this.cell.layoutChange();
1330
+ this._outputRightView = this.instantiationService.createInstance(
1331
+ OutputContainer,
1332
+ this.notebookEditor,
1333
+ this.notebookEditor.textModel,
1334
+ this.cell,
1335
+ this.cell.modified,
1336
+ DiffSide.Modified,
1337
+ this._outputViewContainer
1338
+ );
1339
+ this._register(this._outputRightView);
1340
+ this._outputRightView.render();
1341
+ const insertOutputRenderListener = this.notebookEditor.onDidDynamicOutputRendered(e => {
1342
+ if (( e.cell.uri.toString()) === ( this.cell.modified.uri.toString())) {
1343
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Modified, this.cell.modified.id, ["nb-cellAdded"], []);
1344
+ insertOutputRenderListener.dispose();
1345
+ }
1346
+ });
1347
+ this._register(insertOutputRenderListener);
1348
+ }
1349
+ this._outputViewContainer.style.display = "block";
1350
+ }
1351
+ _decorate() {
1352
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Modified, this.cell.modified.id, ["nb-cellAdded"], []);
1353
+ }
1354
+ _showOutputsRenderer() {
1355
+ if (this._outputViewContainer) {
1356
+ this._outputViewContainer.style.display = "block";
1357
+ this._outputRightView?.showOutputs();
1358
+ this._decorate();
1359
+ }
1360
+ }
1361
+ _hideOutputsRenderer() {
1362
+ if (this._outputViewContainer) {
1363
+ this._outputViewContainer.style.display = "none";
1364
+ this._outputRightView?.hideOutputs();
1365
+ }
1366
+ }
1367
+ layout(state) {
1368
+ scheduleAtNextAnimationFrame(getWindow(this._diffEditorContainer), () => {
1369
+ if ((state.editorHeight || state.outerWidth) && this._editor) {
1370
+ this._editorContainer.style.height = `${this.cell.layoutInfo.editorHeight}px`;
1371
+ this._editor.layout({
1372
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, false),
1373
+ height: this.cell.layoutInfo.editorHeight
1374
+ });
1375
+ }
1376
+ if (state.outerWidth && this._editor) {
1377
+ this._editorContainer.style.height = `${this.cell.layoutInfo.editorHeight}px`;
1378
+ this._editor.layout();
1379
+ }
1380
+ if (state.metadataHeight || state.outerWidth) {
1381
+ this._metadataEditor?.layout({
1382
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, true),
1383
+ height: this.cell.layoutInfo.metadataHeight
1384
+ });
1385
+ }
1386
+ if (state.outputTotalHeight || state.outerWidth) {
1387
+ this._outputEditor?.layout({
1388
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, false),
1389
+ height: this.cell.layoutInfo.outputTotalHeight
1390
+ });
1391
+ }
1392
+ this.layoutNotebookCell();
1393
+ if (this._diagonalFill) {
1394
+ this._diagonalFill.style.height = `${this.calculateDiagonalFillHeight()}px`;
1395
+ }
1396
+ });
1397
+ }
1398
+ dispose() {
1399
+ if (this._editor) {
1400
+ this.cell.saveSpirceEditorViewState(this._editor.saveViewState());
1401
+ }
1402
+ super.dispose();
1403
+ }
1404
+ };
1405
+ InsertElement = ( __decorate([( __param(3, IInstantiationService)), ( __param(4, ILanguageService)), ( __param(5, IModelService)), ( __param(6, ITextModelService)), ( __param(7, IContextMenuService)), ( __param(8, IKeybindingService)), ( __param(9, INotificationService)), ( __param(10, IMenuService)), ( __param(11, IContextKeyService)), ( __param(12, IConfigurationService)), ( __param(13, ITextResourceConfigurationService))], InsertElement));
1406
+ let ModifiedElement = class ModifiedElement extends AbstractElementRenderer {
1407
+ constructor(
1408
+ notebookEditor,
1409
+ cell,
1410
+ templateData,
1411
+ instantiationService,
1412
+ languageService,
1413
+ modelService,
1414
+ textModelService,
1415
+ contextMenuService,
1416
+ keybindingService,
1417
+ notificationService,
1418
+ menuService,
1419
+ contextKeyService,
1420
+ configurationService,
1421
+ textConfigurationService
1422
+ ) {
1423
+ super(
1424
+ notebookEditor,
1425
+ cell,
1426
+ templateData,
1427
+ "full",
1428
+ instantiationService,
1429
+ languageService,
1430
+ modelService,
1431
+ textModelService,
1432
+ contextMenuService,
1433
+ keybindingService,
1434
+ notificationService,
1435
+ menuService,
1436
+ contextKeyService,
1437
+ configurationService,
1438
+ textConfigurationService
1439
+ );
1440
+ this.cell = cell;
1441
+ this.templateData = templateData;
1442
+ this._editorViewStateChanged = false;
1443
+ this.updateBorders();
1444
+ }
1445
+ init() {}
1446
+ styleContainer(container) {
1447
+ container.classList.remove("inserted", "removed");
1448
+ }
1449
+ buildBody() {
1450
+ super.buildBody();
1451
+ if (this.cell.displayIconToHideUnmodifiedCells) {
1452
+ this._register(
1453
+ this.templateData.marginOverlay.onAction(() => this.cell.hideUnchangedCells())
1454
+ );
1455
+ this.templateData.marginOverlay.show();
1456
+ } else {
1457
+ this.templateData.marginOverlay.hide();
1458
+ }
1459
+ }
1460
+ _disposeMetadata() {
1461
+ this.cell.metadataStatusHeight = 0;
1462
+ this.cell.metadataHeight = 0;
1463
+ this.templateData.metadataHeaderContainer.style.display = "none";
1464
+ this.templateData.metadataInfoContainer.style.display = "none";
1465
+ this._metadataEditor = undefined;
1466
+ }
1467
+ _buildMetadata() {
1468
+ this._metadataHeaderContainer = this.templateData.metadataHeaderContainer;
1469
+ this._metadataInfoContainer = this.templateData.metadataInfoContainer;
1470
+ this._metadataHeaderContainer.style.display = "flex";
1471
+ this._metadataInfoContainer.style.display = "block";
1472
+ this._metadataHeaderContainer.innerText = "";
1473
+ this._metadataInfoContainer.innerText = "";
1474
+ this._metadataHeader = this.instantiationService.createInstance(
1475
+ PropertyHeader,
1476
+ this.cell,
1477
+ this._metadataHeaderContainer,
1478
+ this.notebookEditor,
1479
+ {
1480
+ updateInfoRendering: this.updateMetadataRendering.bind(this),
1481
+ checkIfModified: () => {
1482
+ return this.cell.checkMetadataIfModified();
1483
+ },
1484
+ getFoldingState: () => {
1485
+ return this.cell.metadataFoldingState;
1486
+ },
1487
+ updateFoldingState: state => {
1488
+ this.cell.metadataFoldingState = state;
1489
+ },
1490
+ unChangedLabel: "Metadata",
1491
+ changedLabel: "Metadata changed",
1492
+ prefix: "metadata",
1493
+ menuId: MenuId.NotebookDiffCellMetadataTitle
1494
+ }
1495
+ );
1496
+ this._metadataLocalDisposable.add(this._metadataHeader);
1497
+ this._metadataHeader.buildHeader();
1498
+ }
1499
+ _disposeOutput() {
1500
+ this._hideOutputsRaw();
1501
+ this._hideOutputsRenderer();
1502
+ this._hideOutputsEmptyView();
1503
+ this.cell.rawOutputHeight = 0;
1504
+ this.cell.outputMetadataHeight = 0;
1505
+ this.cell.outputStatusHeight = 0;
1506
+ this.templateData.outputHeaderContainer.style.display = "none";
1507
+ this.templateData.outputInfoContainer.style.display = "none";
1508
+ this._outputViewContainer = undefined;
1509
+ }
1510
+ _buildOutput() {
1511
+ this.templateData.outputHeaderContainer.style.display = "flex";
1512
+ this.templateData.outputInfoContainer.style.display = "block";
1513
+ this._outputHeaderContainer = this.templateData.outputHeaderContainer;
1514
+ this._outputInfoContainer = this.templateData.outputInfoContainer;
1515
+ this._outputHeaderContainer.innerText = "";
1516
+ this._outputInfoContainer.innerText = "";
1517
+ if (this.cell.checkIfOutputsModified()) {
1518
+ this._outputInfoContainer.classList.add("modified");
1519
+ } else {
1520
+ this._outputInfoContainer.classList.remove("modified");
1521
+ }
1522
+ this._outputHeader = this.instantiationService.createInstance(
1523
+ PropertyHeader,
1524
+ this.cell,
1525
+ this._outputHeaderContainer,
1526
+ this.notebookEditor,
1527
+ {
1528
+ updateInfoRendering: this.updateOutputRendering.bind(this),
1529
+ checkIfModified: () => {
1530
+ return this.cell.checkIfOutputsModified();
1531
+ },
1532
+ getFoldingState: () => {
1533
+ return this.cell.outputFoldingState;
1534
+ },
1535
+ updateFoldingState: state => {
1536
+ this.cell.outputFoldingState = state;
1537
+ },
1538
+ unChangedLabel: "Outputs",
1539
+ changedLabel: "Outputs changed",
1540
+ prefix: "output",
1541
+ menuId: MenuId.NotebookDiffCellOutputsTitle
1542
+ }
1543
+ );
1544
+ this._outputLocalDisposable.add(this._outputHeader);
1545
+ this._outputHeader.buildHeader();
1546
+ }
1547
+ _buildOutputRendererContainer() {
1548
+ if (!this._outputViewContainer) {
1549
+ this._outputViewContainer = append(this._outputInfoContainer, $(".output-view-container"));
1550
+ this._outputEmptyElement = append(this._outputViewContainer, $(".output-empty-view"));
1551
+ this._outputEmptyElement.innerText = "No outputs to render";
1552
+ if (!this.cell.checkIfOutputsModified() && this.cell.modified.outputs.length === 0) {
1553
+ this._outputEmptyElement.style.display = "block";
1554
+ } else {
1555
+ this._outputEmptyElement.style.display = "none";
1556
+ }
1557
+ this.cell.layoutChange();
1558
+ this._register(this.cell.modified.textModel.onDidChangeOutputs(() => {
1559
+ if (!this.cell.checkIfOutputsModified() && this.cell.modified.outputs.length === 0) {
1560
+ this._outputEmptyElement.style.display = "block";
1561
+ } else {
1562
+ this._outputEmptyElement.style.display = "none";
1563
+ }
1564
+ this._decorate();
1565
+ }));
1566
+ this._outputLeftContainer = append(this._outputViewContainer, $(".output-view-container-left"));
1567
+ this._outputRightContainer = append(this._outputViewContainer, $(".output-view-container-right"));
1568
+ this._outputMetadataContainer = append(this._outputViewContainer, $(".output-view-container-metadata"));
1569
+ const outputModified = this.cell.checkIfOutputsModified();
1570
+ const outputMetadataChangeOnly = outputModified && outputModified.kind === OutputComparison.Metadata && this.cell.original.outputs.length === 1 && this.cell.modified.outputs.length === 1 && outputEqual(this.cell.original.outputs[0], this.cell.modified.outputs[0]) === OutputComparison.Metadata;
1571
+ if (outputModified && !outputMetadataChangeOnly) {
1572
+ const originalOutputRenderListener = this.notebookEditor.onDidDynamicOutputRendered(e => {
1573
+ if (( e.cell.uri.toString()) === ( this.cell.original.uri.toString()) && this.cell.checkIfOutputsModified()) {
1574
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Original, this.cell.original.id, ["nb-cellDeleted"], []);
1575
+ originalOutputRenderListener.dispose();
1576
+ }
1577
+ });
1578
+ const modifiedOutputRenderListener = this.notebookEditor.onDidDynamicOutputRendered(e => {
1579
+ if (( e.cell.uri.toString()) === ( this.cell.modified.uri.toString()) && this.cell.checkIfOutputsModified()) {
1580
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Modified, this.cell.modified.id, ["nb-cellAdded"], []);
1581
+ modifiedOutputRenderListener.dispose();
1582
+ }
1583
+ });
1584
+ this._register(originalOutputRenderListener);
1585
+ this._register(modifiedOutputRenderListener);
1586
+ }
1587
+ this._outputLeftView = this.instantiationService.createInstance(
1588
+ OutputContainer,
1589
+ this.notebookEditor,
1590
+ this.notebookEditor.textModel,
1591
+ this.cell,
1592
+ this.cell.original,
1593
+ DiffSide.Original,
1594
+ this._outputLeftContainer
1595
+ );
1596
+ this._outputLeftView.render();
1597
+ this._register(this._outputLeftView);
1598
+ this._outputRightView = this.instantiationService.createInstance(
1599
+ OutputContainer,
1600
+ this.notebookEditor,
1601
+ this.notebookEditor.textModel,
1602
+ this.cell,
1603
+ this.cell.modified,
1604
+ DiffSide.Modified,
1605
+ this._outputRightContainer
1606
+ );
1607
+ this._outputRightView.render();
1608
+ this._register(this._outputRightView);
1609
+ if (outputModified && !outputMetadataChangeOnly) {
1610
+ this._decorate();
1611
+ }
1612
+ if (outputMetadataChangeOnly) {
1613
+ this._outputMetadataContainer.style.top = `${this.cell.layoutInfo.rawOutputHeight}px`;
1614
+ this._outputMetadataEditor = this.instantiationService.createInstance(DiffEditorWidget, this._outputMetadataContainer, {
1615
+ ...fixedDiffEditorOptions,
1616
+ overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode(),
1617
+ readOnly: true,
1618
+ ignoreTrimWhitespace: false,
1619
+ automaticLayout: false,
1620
+ dimension: {
1621
+ height: OUTPUT_EDITOR_HEIGHT_MAGIC,
1622
+ width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, true)
1623
+ }
1624
+ }, {
1625
+ originalEditor: getOptimizedNestedCodeEditorWidgetOptions(),
1626
+ modifiedEditor: getOptimizedNestedCodeEditorWidgetOptions()
1627
+ });
1628
+ this._register(this._outputMetadataEditor);
1629
+ const originalOutputMetadataSource = JSON.stringify(this.cell.original.outputs[0].metadata ?? {}, undefined, "\t");
1630
+ const modifiedOutputMetadataSource = JSON.stringify(this.cell.modified.outputs[0].metadata ?? {}, undefined, "\t");
1631
+ const mode = this.languageService.createById("json");
1632
+ const originalModel = this.modelService.createModel(originalOutputMetadataSource, mode, undefined, true);
1633
+ const modifiedModel = this.modelService.createModel(modifiedOutputMetadataSource, mode, undefined, true);
1634
+ this._outputMetadataEditor.setModel({
1635
+ original: originalModel,
1636
+ modified: modifiedModel
1637
+ });
1638
+ this.cell.outputMetadataHeight = this._outputMetadataEditor.getContentHeight();
1639
+ this._register(this._outputMetadataEditor.onDidContentSizeChange(e => {
1640
+ this.cell.outputMetadataHeight = e.contentHeight;
1641
+ }));
1642
+ }
1643
+ }
1644
+ this._outputViewContainer.style.display = "block";
1645
+ }
1646
+ _decorate() {
1647
+ if (this.cell.checkIfOutputsModified()) {
1648
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Original, this.cell.original.id, ["nb-cellDeleted"], []);
1649
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Modified, this.cell.modified.id, ["nb-cellAdded"], []);
1650
+ } else {
1651
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Original, this.cell.original.id, [], ["nb-cellDeleted"]);
1652
+ this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Modified, this.cell.modified.id, [], ["nb-cellAdded"]);
1653
+ }
1654
+ }
1655
+ _showOutputsRenderer() {
1656
+ if (this._outputViewContainer) {
1657
+ this._outputViewContainer.style.display = "block";
1658
+ this._outputLeftView?.showOutputs();
1659
+ this._outputRightView?.showOutputs();
1660
+ this._outputMetadataEditor?.layout({
1661
+ width: this._editor?.getViewWidth() || this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, true),
1662
+ height: this.cell.layoutInfo.outputMetadataHeight
1663
+ });
1664
+ this._decorate();
1665
+ }
1666
+ }
1667
+ _hideOutputsRenderer() {
1668
+ if (this._outputViewContainer) {
1669
+ this._outputViewContainer.style.display = "none";
1670
+ this._outputLeftView?.hideOutputs();
1671
+ this._outputRightView?.hideOutputs();
1672
+ }
1673
+ }
1674
+ updateSourceEditor() {
1675
+ this._cellHeaderContainer = this.templateData.cellHeaderContainer;
1676
+ this._cellHeaderContainer.style.display = "flex";
1677
+ this._cellHeaderContainer.innerText = "";
1678
+ const modifiedCell = this.cell.modified;
1679
+ this._editorContainer = this.templateData.editorContainer;
1680
+ this._editorContainer.classList.add("diff");
1681
+ const renderSourceEditor = () => {
1682
+ if (this.cell.cellFoldingState === PropertyFoldingState.Collapsed) {
1683
+ this._editorContainer.style.display = "none";
1684
+ this.cell.editorHeight = 0;
1685
+ return;
1686
+ }
1687
+ const lineCount = modifiedCell.textModel.textBuffer.getLineCount();
1688
+ const lineHeight = this.notebookEditor.getLayoutInfo().fontInfo.lineHeight || 17;
1689
+ const editorHeight = this.cell.layoutInfo.editorHeight !== 0 ? this.cell.layoutInfo.editorHeight : this.cell.computeInputEditorHeight(lineHeight);
1690
+ this._editorContainer.style.height = `${editorHeight}px`;
1691
+ this._editorContainer.style.display = "block";
1692
+ if (this._editor) {
1693
+ const contentHeight = this._editor.getContentHeight();
1694
+ if (contentHeight >= 0) {
1695
+ this.cell.editorHeight = contentHeight;
1696
+ }
1697
+ return;
1698
+ }
1699
+ this._editor = this.templateData.sourceEditor;
1700
+ const options = {
1701
+ padding: getEditorPadding(lineCount)
1702
+ };
1703
+ const unchangedRegions = this._register(getUnchangedRegionSettings(this.configurationService));
1704
+ if (unchangedRegions.options.enabled) {
1705
+ options.hideUnchangedRegions = unchangedRegions.options;
1706
+ }
1707
+ this._editor.updateOptions(options);
1708
+ this._register(unchangedRegions.onDidChangeEnablement(() => {
1709
+ options.hideUnchangedRegions = unchangedRegions.options;
1710
+ this._editor?.updateOptions(options);
1711
+ }));
1712
+ this._editor.layout({
1713
+ width: this.notebookEditor.getLayoutInfo().width - 2 * DIFF_CELL_MARGIN,
1714
+ height: editorHeight
1715
+ });
1716
+ this._register(this._editor.onDidContentSizeChange(e => {
1717
+ if (this.cell.cellFoldingState === PropertyFoldingState.Expanded && e.contentHeightChanged && this.cell.layoutInfo.editorHeight !== e.contentHeight) {
1718
+ this.cell.editorHeight = e.contentHeight;
1719
+ }
1720
+ }));
1721
+ this._initializeSourceDiffEditor();
1722
+ };
1723
+ this._cellHeader = this._register(this.instantiationService.createInstance(
1724
+ PropertyHeader,
1725
+ this.cell,
1726
+ this._cellHeaderContainer,
1727
+ this.notebookEditor,
1728
+ {
1729
+ updateInfoRendering: () => renderSourceEditor(),
1730
+ checkIfModified: () => {
1731
+ return this.cell.modified?.textModel.getTextBufferHash() !== this.cell.original?.textModel.getTextBufferHash() ? {
1732
+ reason: undefined
1733
+ } : false;
1734
+ },
1735
+ getFoldingState: () => this.cell.cellFoldingState,
1736
+ updateFoldingState: state => this.cell.cellFoldingState = state,
1737
+ unChangedLabel: "Input",
1738
+ changedLabel: "Input changed",
1739
+ prefix: "input",
1740
+ menuId: MenuId.NotebookDiffCellInputTitle
1741
+ }
1742
+ ));
1743
+ this._cellHeader.buildHeader();
1744
+ renderSourceEditor();
1745
+ const scopedContextKeyService = this.contextKeyService.createScoped(this.templateData.inputToolbarContainer);
1746
+ this._register(scopedContextKeyService);
1747
+ const inputChanged = NOTEBOOK_DIFF_CELL_INPUT.bindTo(scopedContextKeyService);
1748
+ inputChanged.set(
1749
+ this.cell.modified.textModel.getTextBufferHash() !== this.cell.original.textModel.getTextBufferHash()
1750
+ );
1751
+ const ignoreWhitespace = NOTEBOOK_DIFF_CELL_IGNORE_WHITESPACE.bindTo(scopedContextKeyService);
1752
+ const ignore = this.textConfigurationService.getValue(this.cell.modified.uri, "diffEditor.ignoreTrimWhitespace");
1753
+ ignoreWhitespace.set(ignore);
1754
+ this._toolbar = this.templateData.toolbar;
1755
+ this._toolbar.context = this.cell;
1756
+ const refreshToolbar = () => {
1757
+ const ignore = this.textConfigurationService.getValue(this.cell.modified.uri, "diffEditor.ignoreTrimWhitespace");
1758
+ ignoreWhitespace.set(ignore);
1759
+ const hasChanges = this.cell.modified.textModel.getTextBufferHash() !== this.cell.original.textModel.getTextBufferHash();
1760
+ inputChanged.set(hasChanges);
1761
+ if (hasChanges) {
1762
+ const menu = this.menuService.getMenuActions(MenuId.NotebookDiffCellInputTitle, scopedContextKeyService, {
1763
+ shouldForwardArgs: true
1764
+ });
1765
+ const actions = getFlatActionBarActions(menu);
1766
+ this._toolbar.setActions(actions);
1767
+ } else {
1768
+ this._toolbar.setActions([]);
1769
+ }
1770
+ };
1771
+ this._register(this.cell.modified.textModel.onDidChangeContent(() => refreshToolbar()));
1772
+ this._register(this.textConfigurationService.onDidChangeConfiguration(e => {
1773
+ if (e.affectsConfiguration(this.cell.modified.uri, "diffEditor") && ( e.affectedKeys.has("diffEditor.ignoreTrimWhitespace"))) {
1774
+ refreshToolbar();
1775
+ }
1776
+ }));
1777
+ refreshToolbar();
1778
+ }
1779
+ async _initializeSourceDiffEditor() {
1780
+ const [originalRef, modifiedRef] = await Promise.all([
1781
+ this.textModelService.createModelReference(this.cell.original.uri),
1782
+ this.textModelService.createModelReference(this.cell.modified.uri)
1783
+ ]);
1784
+ this._register(originalRef);
1785
+ this._register(modifiedRef);
1786
+ if (this._isDisposed) {
1787
+ originalRef.dispose();
1788
+ modifiedRef.dispose();
1789
+ return;
1790
+ }
1791
+ const vm = this._register(this._editor.createViewModel({
1792
+ original: originalRef.object.textEditorModel,
1793
+ modified: modifiedRef.object.textEditorModel
1794
+ }));
1795
+ await vm.waitForDiff();
1796
+ this._editor.setModel(vm);
1797
+ const handleViewStateChange = () => {
1798
+ this._editorViewStateChanged = true;
1799
+ };
1800
+ const handleScrollChange = e => {
1801
+ if (e.scrollTopChanged || e.scrollLeftChanged) {
1802
+ this._editorViewStateChanged = true;
1803
+ }
1804
+ };
1805
+ this.updateEditorOptionsForWhitespace();
1806
+ this._register(
1807
+ this._editor.getOriginalEditor().onDidChangeCursorSelection(handleViewStateChange)
1808
+ );
1809
+ this._register(this._editor.getOriginalEditor().onDidScrollChange(handleScrollChange));
1810
+ this._register(
1811
+ this._editor.getModifiedEditor().onDidChangeCursorSelection(handleViewStateChange)
1812
+ );
1813
+ this._register(this._editor.getModifiedEditor().onDidScrollChange(handleScrollChange));
1814
+ const editorViewState = this.cell.getSourceEditorViewState();
1815
+ if (editorViewState) {
1816
+ this._editor.restoreViewState(editorViewState);
1817
+ }
1818
+ const contentHeight = this._editor.getContentHeight();
1819
+ this.cell.editorHeight = contentHeight;
1820
+ }
1821
+ updateEditorOptionsForWhitespace() {
1822
+ const editor = this._editor;
1823
+ if (!editor) {
1824
+ return;
1825
+ }
1826
+ const uri = editor.getModel()?.modified.uri || editor.getModel()?.original.uri;
1827
+ if (!uri) {
1828
+ return;
1829
+ }
1830
+ const ignoreTrimWhitespace = this.textConfigurationService.getValue(uri, "diffEditor.ignoreTrimWhitespace");
1831
+ editor.updateOptions({
1832
+ ignoreTrimWhitespace
1833
+ });
1834
+ this._register(this.textConfigurationService.onDidChangeConfiguration(e => {
1835
+ if (e.affectsConfiguration(uri, "diffEditor") && ( e.affectedKeys.has("diffEditor.ignoreTrimWhitespace"))) {
1836
+ const ignoreTrimWhitespace = this.textConfigurationService.getValue(uri, "diffEditor.ignoreTrimWhitespace");
1837
+ editor.updateOptions({
1838
+ ignoreTrimWhitespace
1839
+ });
1840
+ }
1841
+ }));
1842
+ }
1843
+ layout(state) {
1844
+ scheduleAtNextAnimationFrame(getWindow(this._diffEditorContainer), () => {
1845
+ if (state.editorHeight && this._editor) {
1846
+ this._editorContainer.style.height = `${this.cell.layoutInfo.editorHeight}px`;
1847
+ this._editor.layout({
1848
+ width: this._editor.getViewWidth(),
1849
+ height: this.cell.layoutInfo.editorHeight
1850
+ });
1851
+ }
1852
+ if (state.outerWidth && this._editor) {
1853
+ this._editorContainer.style.height = `${this.cell.layoutInfo.editorHeight}px`;
1854
+ this._editor.layout();
1855
+ }
1856
+ if (state.metadataHeight || state.outerWidth) {
1857
+ if (this._metadataEditorContainer) {
1858
+ this._metadataEditorContainer.style.height = `${this.cell.layoutInfo.metadataHeight}px`;
1859
+ this._metadataEditor?.layout({
1860
+ width: this._editor?.getViewWidth() || this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, true),
1861
+ height: this.cell.layoutInfo.metadataHeight
1862
+ });
1863
+ }
1864
+ }
1865
+ if (state.outputTotalHeight || state.outerWidth) {
1866
+ if (this._outputEditorContainer) {
1867
+ this._outputEditorContainer.style.height = `${this.cell.layoutInfo.outputTotalHeight}px`;
1868
+ this._outputEditor?.layout({
1869
+ width: this._editor?.getViewWidth() || this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, true),
1870
+ height: this.cell.layoutInfo.outputTotalHeight
1871
+ });
1872
+ }
1873
+ if (this._outputMetadataContainer) {
1874
+ this._outputMetadataContainer.style.height = `${this.cell.layoutInfo.outputMetadataHeight}px`;
1875
+ this._outputMetadataContainer.style.top = `${this.cell.layoutInfo.outputTotalHeight - this.cell.layoutInfo.outputMetadataHeight}px`;
1876
+ this._outputMetadataEditor?.layout({
1877
+ width: this._editor?.getViewWidth() || this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, true),
1878
+ height: this.cell.layoutInfo.outputMetadataHeight
1879
+ });
1880
+ }
1881
+ }
1882
+ this.layoutNotebookCell();
1883
+ });
1884
+ }
1885
+ dispose() {
1886
+ if (this._editor) {
1887
+ this._editor.setModel(null);
1888
+ }
1889
+ if (this._editor && this._editorViewStateChanged) {
1890
+ this.cell.saveSpirceEditorViewState(this._editor.saveViewState());
1891
+ }
1892
+ super.dispose();
1893
+ }
1894
+ };
1895
+ ModifiedElement = ( __decorate([( __param(3, IInstantiationService)), ( __param(4, ILanguageService)), ( __param(5, IModelService)), ( __param(6, ITextModelService)), ( __param(7, IContextMenuService)), ( __param(8, IKeybindingService)), ( __param(9, INotificationService)), ( __param(10, IMenuService)), ( __param(11, IContextKeyService)), ( __param(12, IConfigurationService)), ( __param(13, ITextResourceConfigurationService))], ModifiedElement));
1896
+ class CollapsedCellOverlayWidget extends Disposable {
1897
+ constructor(container) {
1898
+ super();
1899
+ this.container = container;
1900
+ this._nodes = h("div.diff-hidden-cells", [h("div.center@content", {
1901
+ style: {
1902
+ display: "flex"
1903
+ }
1904
+ }, [$("a", {
1905
+ title: ( localize(11790, "Show Unchanged Cells")),
1906
+ role: "button",
1907
+ onclick: () => {
1908
+ this._action.fire();
1909
+ }
1910
+ }, ...renderLabelWithIcons("$(unfold)"))])]);
1911
+ this._action = this._register(( new Emitter()));
1912
+ this.onAction = this._action.event;
1913
+ this._nodes.root.style.display = "none";
1914
+ container.appendChild(this._nodes.root);
1915
+ }
1916
+ show() {
1917
+ this._nodes.root.style.display = "block";
1918
+ }
1919
+ hide() {
1920
+ this._nodes.root.style.display = "none";
1921
+ }
1922
+ dispose() {
1923
+ this.hide();
1924
+ this.container.removeChild(this._nodes.root);
1925
+ reset(this._nodes.root);
1926
+ super.dispose();
1927
+ }
1928
+ }
1929
+ class UnchangedCellOverlayWidget extends Disposable {
1930
+ constructor(container) {
1931
+ super();
1932
+ this.container = container;
1933
+ this._nodes = h("div.diff-hidden-cells", [h("div.center@content", {
1934
+ style: {
1935
+ display: "flex"
1936
+ }
1937
+ }, [$("a", {
1938
+ title: ( localize(11791, "Hide Unchanged Cells")),
1939
+ role: "button",
1940
+ onclick: () => {
1941
+ this._action.fire();
1942
+ }
1943
+ }, ...renderLabelWithIcons("$(fold)"))])]);
1944
+ this._action = this._register(( new Emitter()));
1945
+ this.onAction = this._action.event;
1946
+ this._nodes.root.style.display = "none";
1947
+ container.appendChild(this._nodes.root);
1948
+ }
1949
+ show() {
1950
+ this._nodes.root.style.display = "block";
1951
+ }
1952
+ hide() {
1953
+ this._nodes.root.style.display = "none";
1954
+ }
1955
+ dispose() {
1956
+ this.hide();
1957
+ this.container.removeChild(this._nodes.root);
1958
+ reset(this._nodes.root);
1959
+ super.dispose();
1960
+ }
1961
+ }
1962
+
1963
+ export { CellDiffPlaceholderElement, CollapsedCellOverlayWidget, DeletedElement, InsertElement, ModifiedElement, NotebookDocumentMetadataElement, UnchangedCellOverlayWidget, getOptimizedNestedCodeEditorWidgetOptions };