@codingame/monaco-vscode-api 1.85.0 → 1.85.2

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 (298) hide show
  1. package/README.md +31 -13
  2. package/contributions.js +1 -0
  3. package/missing-services.js +396 -68
  4. package/monaco-editor-treemending.patch +957 -950
  5. package/package.json +8 -7
  6. package/service-override/tools/editor.js +1 -1
  7. package/services.js +10 -6
  8. package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +14 -0
  9. package/vscode/src/vs/base/common/jsonFormatter.js +8 -1
  10. package/vscode/src/vs/platform/actions/browser/buttonbar.js +128 -0
  11. package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +140 -0
  12. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
  13. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1062 -93
  14. package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +220 -0
  15. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
  16. package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +102 -0
  17. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
  18. package/vscode/src/vs/platform/userDataSync/common/content.js +9 -0
  19. package/vscode/src/vs/platform/userDataSync/common/settingsMerge.js +514 -0
  20. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +154 -2
  21. package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +43 -1
  22. package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +177 -0
  23. package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -1
  24. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  25. package/vscode/src/vs/workbench/api/common/extHostWebview.js +2 -2
  26. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
  27. package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +105 -0
  28. package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +4 -0
  29. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +1614 -0
  30. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +191 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +238 -2
  32. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +205 -1
  34. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +168 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +35 -0
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +340 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1195 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +115 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +81 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.css.js +4 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +62 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +583 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +4 -0
  44. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +290 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +167 -0
  46. package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +4 -0
  47. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +6 -1
  48. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +562 -0
  49. package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +31 -1
  50. package/vscode/src/vs/workbench/contrib/chat/common/chatProvider.js +24 -1
  51. package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +193 -0
  52. package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +22 -1
  53. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +52 -1
  54. package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +258 -0
  55. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +37 -0
  56. package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +25 -0
  57. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +4 -0
  58. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +388 -0
  59. package/vscode/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +7 -7
  60. package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +61 -0
  61. package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +49 -0
  62. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +647 -0
  63. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +300 -0
  64. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +60 -0
  65. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
  66. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +107 -0
  67. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +333 -0
  68. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +4 -0
  69. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +99 -0
  70. package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +55 -0
  71. package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +2 -0
  72. package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +20 -0
  73. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +855 -0
  74. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +410 -0
  75. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1591 -0
  76. package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
  77. package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +4 -0
  78. package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +4 -0
  79. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1485 -0
  80. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +125 -0
  81. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +29 -0
  82. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +41 -0
  83. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +102 -0
  84. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +73 -2
  85. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +4 -0
  86. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +988 -0
  87. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +431 -0
  88. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +417 -0
  89. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +806 -0
  90. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +915 -0
  91. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +19 -0
  92. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +129 -10
  93. package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +205 -0
  94. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +150 -0
  95. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +480 -0
  96. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
  97. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +90 -0
  98. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
  99. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
  100. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +258 -0
  101. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +614 -0
  102. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
  103. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +44 -0
  104. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
  105. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
  106. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +169 -0
  107. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +64 -0
  108. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.js +49 -0
  109. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
  110. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +120 -0
  111. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +416 -0
  112. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
  113. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +663 -0
  114. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +593 -0
  115. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +72 -0
  116. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +326 -0
  117. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +539 -0
  118. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +265 -0
  119. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +348 -0
  120. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css.js +4 -0
  121. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +4 -0
  122. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css.js +4 -0
  123. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css.js +4 -0
  124. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css.js +4 -0
  125. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css.js +4 -0
  126. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css.js +4 -0
  127. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css.js +4 -0
  128. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +4 -0
  129. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css.js +4 -0
  130. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css.js +4 -0
  131. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css.js +4 -0
  132. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css.js +4 -0
  133. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css.js +4 -0
  134. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +95 -3
  135. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +437 -0
  136. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +29 -0
  137. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2730 -0
  138. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +139 -0
  139. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +17 -0
  140. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +564 -0
  141. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +27 -0
  142. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +119 -0
  143. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +27 -0
  144. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +135 -0
  145. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +178 -0
  146. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +35 -0
  147. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +377 -0
  148. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +97 -0
  149. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +194 -0
  150. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +71 -0
  151. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +20 -0
  152. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +85 -0
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +652 -0
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +59 -0
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +303 -0
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +24 -0
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +228 -0
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +302 -0
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +438 -0
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +45 -0
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +435 -0
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +95 -0
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +107 -0
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +29 -0
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +59 -0
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +67 -0
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +430 -0
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +54 -0
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +1131 -0
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +21 -0
  171. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +1591 -0
  172. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +341 -0
  173. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +2155 -0
  174. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +65 -0
  175. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +95 -0
  176. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +507 -0
  177. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +85 -0
  178. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +47 -0
  179. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +40 -0
  180. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +435 -0
  181. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +31 -0
  182. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +257 -0
  183. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +239 -0
  184. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +103 -0
  185. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +211 -0
  186. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +808 -0
  187. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +8 -0
  188. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +381 -0
  189. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +527 -0
  190. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +163 -0
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +651 -0
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +173 -0
  193. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +98 -0
  194. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +62 -0
  195. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +101 -0
  196. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +346 -0
  197. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +152 -1
  198. package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +39 -0
  199. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +296 -0
  200. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +261 -0
  201. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.js +3 -1
  202. package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
  203. package/vscode/src/vs/workbench/contrib/notebook/common/notebookKeymapService.js +3 -0
  204. package/vscode/src/vs/workbench/contrib/notebook/common/notebookLoggingService.js +3 -0
  205. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +16 -0
  206. package/vscode/src/vs/workbench/contrib/notebook/common/notebookRange.js +66 -0
  207. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWorkerService.js +4 -0
  208. package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +130 -0
  209. package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +4 -0
  210. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +847 -0
  211. package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +89 -0
  212. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +1942 -0
  213. package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +107 -0
  214. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +49 -0
  215. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +387 -0
  216. package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +2 -2
  217. package/vscode/src/vs/workbench/contrib/search/common/constants.js +66 -0
  218. package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
  219. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +24 -0
  220. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +95 -0
  221. package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +6 -6
  222. package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +12 -2
  223. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +712 -0
  224. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
  225. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +130 -0
  226. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -1
  227. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/featuredExtensionService.js +159 -0
  228. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExtensionPoint.js +375 -0
  229. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +563 -0
  230. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.js +932 -0
  231. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +20 -1
  232. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +205 -0
  233. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +11 -0
  234. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +9 -9
  235. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +1 -1
  236. package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +2 -2
  237. package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.js +24 -1
  238. package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
  239. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +41 -0
  240. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +588 -0
  241. package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +43 -0
  242. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +2 -2
  243. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +190 -2
  244. package/vscode/src/vs/workbench/services/search/common/search.js +3 -3
  245. package/vscode/src/vs/workbench/services/terminal/common/embedderTerminalService.js +75 -1
  246. package/vscode/src/vs/workbench/services/timer/browser/timerService.js +240 -1
  247. package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +31 -1
  248. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +25 -1
  249. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +75 -1
  250. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +74 -4
  251. package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +77 -0
  252. package/assets/break.mp3 +0 -0
  253. package/assets/chatRequestSent.mp3 +0 -0
  254. package/assets/chatResponsePending.mp3 +0 -0
  255. package/assets/chatResponseReceived1.mp3 +0 -0
  256. package/assets/chatResponseReceived2.mp3 +0 -0
  257. package/assets/chatResponseReceived3.mp3 +0 -0
  258. package/assets/chatResponseReceived4.mp3 +0 -0
  259. package/assets/clear.mp3 +0 -0
  260. package/assets/defaultIcon.png +0 -0
  261. package/assets/diffLineDeleted.mp3 +0 -0
  262. package/assets/diffLineInserted.mp3 +0 -0
  263. package/assets/diffLineModified.mp3 +0 -0
  264. package/assets/error.mp3 +0 -0
  265. package/assets/fake.html +0 -10
  266. package/assets/foldedAreas.mp3 +0 -0
  267. package/assets/format.mp3 +0 -0
  268. package/assets/index-no-csp.html +0 -1226
  269. package/assets/index.html +0 -1227
  270. package/assets/quickFixes.mp3 +0 -0
  271. package/assets/save.mp3 +0 -0
  272. package/assets/service-worker.js +0 -457
  273. package/assets/taskCompleted.mp3 +0 -0
  274. package/assets/taskFailed.mp3 +0 -0
  275. package/assets/terminalBell.mp3 +0 -0
  276. package/assets/warning.mp3 +0 -0
  277. package/assets/webWorkerExtensionHostIframe.html +0 -123
  278. package/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
  279. package/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2
  280. package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -5
  281. package/vscode/src/vs/base/parts/request/browser/request.js +0 -60
  282. package/vscode/src/vs/platform/request/browser/requestService.js +0 -28
  283. package/vscode/src/vs/platform/request/common/requestIpc.js +0 -17
  284. package/vscode/src/vs/platform/url/common/urlService.js +0 -17
  285. package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +0 -120
  286. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +0 -319
  287. package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +0 -9
  288. package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +0 -408
  289. package/vscode/src/vs/workbench/services/request/browser/requestService.js +0 -48
  290. package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +0 -56
  291. package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +0 -639
  292. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +0 -402
  293. package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +0 -62
  294. package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +0 -38
  295. package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +0 -295
  296. package/vscode/src/vs/workbench/services/url/browser/urlService.js +0 -47
  297. package/vscode/src/vs/workbench/services/views/common/treeViewsService.js +0 -20
  298. package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js +0 -19
@@ -0,0 +1,65 @@
1
+ const mapping = ( new Map([
2
+ ['theme-font-family', 'vscode-font-family'],
3
+ ['theme-font-weight', 'vscode-font-weight'],
4
+ ['theme-font-size', 'vscode-font-size'],
5
+ ['theme-code-font-family', 'vscode-editor-font-family'],
6
+ ['theme-code-font-weight', 'vscode-editor-font-weight'],
7
+ ['theme-code-font-size', 'vscode-editor-font-size'],
8
+ ['theme-scrollbar-background', 'vscode-scrollbarSlider-background'],
9
+ ['theme-scrollbar-hover-background', 'vscode-scrollbarSlider-hoverBackground'],
10
+ ['theme-scrollbar-active-background', 'vscode-scrollbarSlider-activeBackground'],
11
+ ['theme-quote-background', 'vscode-textBlockQuote-background'],
12
+ ['theme-quote-border', 'vscode-textBlockQuote-border'],
13
+ ['theme-code-foreground', 'vscode-textPreformat-foreground'],
14
+ ['theme-background', 'vscode-editor-background'],
15
+ ['theme-foreground', 'vscode-editor-foreground'],
16
+ ['theme-ui-foreground', 'vscode-foreground'],
17
+ ['theme-link', 'vscode-textLink-foreground'],
18
+ ['theme-link-active', 'vscode-textLink-activeForeground'],
19
+ ['theme-button-background', 'vscode-button-background'],
20
+ ['theme-button-hover-background', 'vscode-button-hoverBackground'],
21
+ ['theme-button-foreground', 'vscode-button-foreground'],
22
+ ['theme-button-secondary-background', 'vscode-button-secondaryBackground'],
23
+ ['theme-button-secondary-hover-background', 'vscode-button-secondaryHoverBackground'],
24
+ ['theme-button-secondary-foreground', 'vscode-button-secondaryForeground'],
25
+ ['theme-button-hover-foreground', 'vscode-button-foreground'],
26
+ ['theme-button-focus-foreground', 'vscode-button-foreground'],
27
+ ['theme-button-secondary-hover-foreground', 'vscode-button-secondaryForeground'],
28
+ ['theme-button-secondary-focus-foreground', 'vscode-button-secondaryForeground'],
29
+ ['theme-input-background', 'vscode-input-background'],
30
+ ['theme-input-foreground', 'vscode-input-foreground'],
31
+ ['theme-input-placeholder-foreground', 'vscode-input-placeholderForeground'],
32
+ ['theme-input-focus-border-color', 'vscode-focusBorder'],
33
+ ['theme-menu-background', 'vscode-menu-background'],
34
+ ['theme-menu-foreground', 'vscode-menu-foreground'],
35
+ ['theme-menu-hover-background', 'vscode-menu-selectionBackground'],
36
+ ['theme-menu-focus-background', 'vscode-menu-selectionBackground'],
37
+ ['theme-menu-hover-foreground', 'vscode-menu-selectionForeground'],
38
+ ['theme-menu-focus-foreground', 'vscode-menu-selectionForeground'],
39
+ ['theme-error-background', 'vscode-inputValidation-errorBackground'],
40
+ ['theme-error-foreground', 'vscode-foreground'],
41
+ ['theme-warning-background', 'vscode-inputValidation-warningBackground'],
42
+ ['theme-warning-foreground', 'vscode-foreground'],
43
+ ['theme-info-background', 'vscode-inputValidation-infoBackground'],
44
+ ['theme-info-foreground', 'vscode-foreground'],
45
+ ['theme-notebook-output-background', 'vscode-notebook-outputContainerBackgroundColor'],
46
+ ['theme-notebook-output-border', 'vscode-notebook-outputContainerBorderColor'],
47
+ ['theme-notebook-cell-selected-background', 'vscode-notebook-selectedCellBackground'],
48
+ ['theme-notebook-symbol-highlight-background', 'vscode-notebook-symbolHighlightBackground'],
49
+ ['theme-notebook-diff-removed-background', 'vscode-diffEditor-removedTextBackground'],
50
+ ['theme-notebook-diff-inserted-background', 'vscode-diffEditor-insertedTextBackground'],
51
+ ]));
52
+ const constants = {
53
+ 'theme-input-border-width': '1px',
54
+ 'theme-button-primary-hover-shadow': 'none',
55
+ 'theme-button-secondary-hover-shadow': 'none',
56
+ 'theme-input-border-color': 'transparent',
57
+ };
58
+ const transformWebviewThemeVars = (s) => {
59
+ const result = { ...s, ...constants };
60
+ for (const [target, src] of mapping) {
61
+ result[target] = s[src];
62
+ }
63
+ return result;
64
+ };
65
+ export { transformWebviewThemeVars };
@@ -0,0 +1,95 @@
1
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
2
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
3
+ import { MarkerSeverity } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
4
+ import { executingStateIcon } from '../notebookIcons.js';
5
+ import { CellKind } from '../../common/notebookCommon.js';
6
+ import { SymbolKinds } from 'monaco-editor/esm/vs/editor/common/languages.js';
7
+ class OutlineEntry {
8
+ get icon() {
9
+ if (this.symbolKind) {
10
+ return SymbolKinds.toIcon(this.symbolKind);
11
+ }
12
+ return this.isExecuting && this.isPaused ? executingStateIcon :
13
+ this.isExecuting ? ThemeIcon.modify(executingStateIcon, 'spin') :
14
+ this.cell.cellKind === CellKind.Markup ? Codicon.markdown : Codicon.code;
15
+ }
16
+ constructor(index, level, cell, label, isExecuting, isPaused, range, symbolKind) {
17
+ this.index = index;
18
+ this.level = level;
19
+ this.cell = cell;
20
+ this.label = label;
21
+ this.isExecuting = isExecuting;
22
+ this.isPaused = isPaused;
23
+ this.range = range;
24
+ this.symbolKind = symbolKind;
25
+ this._children = [];
26
+ }
27
+ addChild(entry) {
28
+ this._children.push(entry);
29
+ entry._parent = this;
30
+ }
31
+ get parent() {
32
+ return this._parent;
33
+ }
34
+ get children() {
35
+ return this._children;
36
+ }
37
+ get markerInfo() {
38
+ return this._markerInfo;
39
+ }
40
+ get position() {
41
+ if (this.range) {
42
+ return { startLineNumber: this.range.startLineNumber, startColumn: this.range.startColumn };
43
+ }
44
+ return undefined;
45
+ }
46
+ updateMarkers(markerService) {
47
+ if (this.cell.cellKind === CellKind.Code) {
48
+ const marker = markerService.read({ resource: this.cell.uri, severities: MarkerSeverity.Error | MarkerSeverity.Warning });
49
+ if (marker.length === 0) {
50
+ this._markerInfo = undefined;
51
+ }
52
+ else {
53
+ const topSev = marker.find(a => a.severity === MarkerSeverity.Error)?.severity ?? MarkerSeverity.Warning;
54
+ this._markerInfo = { topSev, count: marker.length };
55
+ }
56
+ }
57
+ else {
58
+ let topChild;
59
+ for (const child of this.children) {
60
+ child.updateMarkers(markerService);
61
+ if (child.markerInfo) {
62
+ topChild = !topChild ? child.markerInfo.topSev : Math.max(child.markerInfo.topSev, topChild);
63
+ }
64
+ }
65
+ this._markerInfo = topChild && { topSev: topChild, count: 0 };
66
+ }
67
+ }
68
+ clearMarkers() {
69
+ this._markerInfo = undefined;
70
+ for (const child of this.children) {
71
+ child.clearMarkers();
72
+ }
73
+ }
74
+ find(cell, parents) {
75
+ if (cell.id === this.cell.id) {
76
+ return this;
77
+ }
78
+ parents.push(this);
79
+ for (const child of this.children) {
80
+ const result = child.find(cell, parents);
81
+ if (result) {
82
+ return result;
83
+ }
84
+ }
85
+ parents.pop();
86
+ return undefined;
87
+ }
88
+ asFlatList(bucket) {
89
+ bucket.push(this);
90
+ for (const child of this.children) {
91
+ child.asFlatList(bucket);
92
+ }
93
+ }
94
+ }
95
+ export { OutlineEntry };
@@ -0,0 +1,507 @@
1
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
2
+ import { Disposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { Mimes } from 'monaco-editor/esm/vs/base/common/mime.js';
4
+ import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
5
+ import { Selection } from 'monaco-editor/esm/vs/editor/common/core/selection.js';
6
+ import { SearchParams } from 'monaco-editor/esm/vs/editor/common/model/textModelSearch.js';
7
+ import { writeTransientState, readTransientState } from '../../../codeEditor/browser/toggleWordWrap.js';
8
+ import { CellEditState, CellFocusMode, CursorAtLineBoundary, CursorAtBoundary } from '../notebookBrowser.js';
9
+ import { getEditorTopPadding } from '../notebookOptions.js';
10
+ class BaseCellViewModel extends Disposable {
11
+ get handle() {
12
+ return this.model.handle;
13
+ }
14
+ get uri() {
15
+ return this.model.uri;
16
+ }
17
+ get lineCount() {
18
+ return this.model.textBuffer.getLineCount();
19
+ }
20
+ get metadata() {
21
+ return this.model.metadata;
22
+ }
23
+ get internalMetadata() {
24
+ return this.model.internalMetadata;
25
+ }
26
+ get language() {
27
+ return this.model.language;
28
+ }
29
+ get mime() {
30
+ if (typeof this.model.mime === 'string') {
31
+ return this.model.mime;
32
+ }
33
+ switch (this.language) {
34
+ case 'markdown':
35
+ return Mimes.markdown;
36
+ default:
37
+ return Mimes.text;
38
+ }
39
+ }
40
+ get lineNumbers() {
41
+ return this._lineNumbers;
42
+ }
43
+ set lineNumbers(lineNumbers) {
44
+ if (lineNumbers === this._lineNumbers) {
45
+ return;
46
+ }
47
+ this._lineNumbers = lineNumbers;
48
+ this._onDidChangeState.fire({ cellLineNumberChanged: true });
49
+ }
50
+ get focusMode() {
51
+ return this._focusMode;
52
+ }
53
+ set focusMode(newMode) {
54
+ if (this._focusMode !== newMode) {
55
+ this._focusMode = newMode;
56
+ this._onDidChangeState.fire({ focusModeChanged: true });
57
+ }
58
+ }
59
+ get editorAttached() {
60
+ return !!this._textEditor;
61
+ }
62
+ get textModel() {
63
+ return this.model.textModel;
64
+ }
65
+ hasModel() {
66
+ return !!this.textModel;
67
+ }
68
+ get dragging() {
69
+ return this._dragging;
70
+ }
71
+ set dragging(v) {
72
+ this._dragging = v;
73
+ this._onDidChangeState.fire({ dragStateChanged: true });
74
+ }
75
+ get isInputCollapsed() {
76
+ return this._inputCollapsed;
77
+ }
78
+ set isInputCollapsed(v) {
79
+ this._inputCollapsed = v;
80
+ this._onDidChangeState.fire({ inputCollapsedChanged: true });
81
+ }
82
+ get isOutputCollapsed() {
83
+ return this._outputCollapsed;
84
+ }
85
+ set isOutputCollapsed(v) {
86
+ this._outputCollapsed = v;
87
+ this._onDidChangeState.fire({ outputCollapsedChanged: true });
88
+ }
89
+ constructor(viewType, model, id, _viewContext, _configurationService, _modelService, _undoRedoService, _codeEditorService) {
90
+ super();
91
+ this.viewType = viewType;
92
+ this.model = model;
93
+ this.id = id;
94
+ this._viewContext = _viewContext;
95
+ this._configurationService = _configurationService;
96
+ this._modelService = _modelService;
97
+ this._undoRedoService = _undoRedoService;
98
+ this._codeEditorService = _codeEditorService;
99
+ this._onDidChangeEditorAttachState = this._register(( new Emitter()));
100
+ this.onDidChangeEditorAttachState = this._onDidChangeEditorAttachState.event;
101
+ this._onDidChangeState = this._register(( new Emitter()));
102
+ this.onDidChangeState = this._onDidChangeState.event;
103
+ this._editState = CellEditState.Preview;
104
+ this._lineNumbers = 'inherit';
105
+ this._focusMode = CellFocusMode.Container;
106
+ this._editorListeners = [];
107
+ this._editorViewStates = null;
108
+ this._editorTransientState = null;
109
+ this._resolvedCellDecorations = ( new Map());
110
+ this._cellDecorationsChanged = this._register(( new Emitter()));
111
+ this.onCellDecorationsChanged = this._cellDecorationsChanged.event;
112
+ this._resolvedDecorations = ( new Map());
113
+ this._lastDecorationId = 0;
114
+ this._cellStatusBarItems = ( new Map());
115
+ this._onDidChangeCellStatusBarItems = this._register(( new Emitter()));
116
+ this.onDidChangeCellStatusBarItems = this._onDidChangeCellStatusBarItems.event;
117
+ this._lastStatusBarId = 0;
118
+ this._dragging = false;
119
+ this._inputCollapsed = false;
120
+ this._outputCollapsed = false;
121
+ this._isDisposed = false;
122
+ this._editStateSource = '';
123
+ this._register(model.onDidChangeMetadata(() => {
124
+ this._onDidChangeState.fire({ metadataChanged: true });
125
+ }));
126
+ this._register(model.onDidChangeInternalMetadata(e => {
127
+ this._onDidChangeState.fire({ internalMetadataChanged: true });
128
+ if (e.lastRunSuccessChanged) {
129
+ this.layoutChange({});
130
+ }
131
+ }));
132
+ this._register(this._configurationService.onDidChangeConfiguration(e => {
133
+ if (e.affectsConfiguration('notebook.lineNumbers')) {
134
+ this.lineNumbers = 'inherit';
135
+ }
136
+ }));
137
+ if (this.model.collapseState?.inputCollapsed) {
138
+ this._inputCollapsed = true;
139
+ }
140
+ if (this.model.collapseState?.outputCollapsed) {
141
+ this._outputCollapsed = true;
142
+ }
143
+ }
144
+ assertTextModelAttached() {
145
+ if (this.textModel && this._textEditor && this._textEditor.getModel() === this.textModel) {
146
+ return true;
147
+ }
148
+ return false;
149
+ }
150
+ attachTextEditor(editor, estimatedHasHorizontalScrolling) {
151
+ if (!editor.hasModel()) {
152
+ throw new Error('Invalid editor: model is missing');
153
+ }
154
+ if (this._textEditor === editor) {
155
+ if (this._editorListeners.length === 0) {
156
+ this._editorListeners.push(this._textEditor.onDidChangeCursorSelection(() => { this._onDidChangeState.fire({ selectionChanged: true }); }));
157
+ this._onDidChangeState.fire({ selectionChanged: true });
158
+ }
159
+ return;
160
+ }
161
+ this._textEditor = editor;
162
+ if (this._editorViewStates) {
163
+ this._restoreViewState(this._editorViewStates);
164
+ }
165
+ else {
166
+ if (estimatedHasHorizontalScrolling) {
167
+ this._restoreViewState({
168
+ contributionsState: {},
169
+ cursorState: [],
170
+ viewState: {
171
+ scrollLeft: 0,
172
+ firstPosition: { lineNumber: 1, column: 1 },
173
+ firstPositionDeltaTop: getEditorTopPadding()
174
+ }
175
+ });
176
+ }
177
+ }
178
+ if (this._editorTransientState) {
179
+ writeTransientState(editor.getModel(), this._editorTransientState, this._codeEditorService);
180
+ }
181
+ this._textEditor?.changeDecorations((accessor) => {
182
+ this._resolvedDecorations.forEach((value, key) => {
183
+ if (key.startsWith('_lazy_')) {
184
+ const ret = accessor.addDecoration(value.options.range, value.options.options);
185
+ this._resolvedDecorations.get(key).id = ret;
186
+ }
187
+ else {
188
+ const ret = accessor.addDecoration(value.options.range, value.options.options);
189
+ this._resolvedDecorations.get(key).id = ret;
190
+ }
191
+ });
192
+ });
193
+ this._editorListeners.push(this._textEditor.onDidChangeCursorSelection(() => { this._onDidChangeState.fire({ selectionChanged: true }); }));
194
+ this._onDidChangeState.fire({ selectionChanged: true });
195
+ this._onDidChangeEditorAttachState.fire();
196
+ }
197
+ detachTextEditor() {
198
+ this.saveViewState();
199
+ this.saveTransientState();
200
+ this._textEditor?.changeDecorations((accessor) => {
201
+ this._resolvedDecorations.forEach(value => {
202
+ const resolvedid = value.id;
203
+ if (resolvedid) {
204
+ accessor.removeDecoration(resolvedid);
205
+ }
206
+ });
207
+ });
208
+ this._textEditor = undefined;
209
+ dispose(this._editorListeners);
210
+ this._editorListeners = [];
211
+ this._onDidChangeEditorAttachState.fire();
212
+ if (this._textModelRef) {
213
+ this._textModelRef.dispose();
214
+ this._textModelRef = undefined;
215
+ }
216
+ }
217
+ getText() {
218
+ return this.model.getValue();
219
+ }
220
+ getTextLength() {
221
+ return this.model.getTextLength();
222
+ }
223
+ saveViewState() {
224
+ if (!this._textEditor) {
225
+ return;
226
+ }
227
+ this._editorViewStates = this._textEditor.saveViewState();
228
+ }
229
+ saveTransientState() {
230
+ if (!this._textEditor || !this._textEditor.hasModel()) {
231
+ return;
232
+ }
233
+ this._editorTransientState = readTransientState(this._textEditor.getModel(), this._codeEditorService);
234
+ }
235
+ saveEditorViewState() {
236
+ if (this._textEditor) {
237
+ this._editorViewStates = this._textEditor.saveViewState();
238
+ }
239
+ return this._editorViewStates;
240
+ }
241
+ restoreEditorViewState(editorViewStates, totalHeight) {
242
+ this._editorViewStates = editorViewStates;
243
+ }
244
+ _restoreViewState(state) {
245
+ if (state) {
246
+ this._textEditor?.restoreViewState(state);
247
+ }
248
+ }
249
+ addModelDecoration(decoration) {
250
+ if (!this._textEditor) {
251
+ const id = ++this._lastDecorationId;
252
+ const decorationId = `_lazy_${this.id};${id}`;
253
+ this._resolvedDecorations.set(decorationId, { options: decoration });
254
+ return decorationId;
255
+ }
256
+ let id;
257
+ this._textEditor.changeDecorations((accessor) => {
258
+ id = accessor.addDecoration(decoration.range, decoration.options);
259
+ this._resolvedDecorations.set(id, { id, options: decoration });
260
+ });
261
+ return id;
262
+ }
263
+ removeModelDecoration(decorationId) {
264
+ const realDecorationId = this._resolvedDecorations.get(decorationId);
265
+ if (this._textEditor && realDecorationId && realDecorationId.id !== undefined) {
266
+ this._textEditor.changeDecorations((accessor) => {
267
+ accessor.removeDecoration(realDecorationId.id);
268
+ });
269
+ }
270
+ this._resolvedDecorations.delete(decorationId);
271
+ }
272
+ deltaModelDecorations(oldDecorations, newDecorations) {
273
+ oldDecorations.forEach(id => {
274
+ this.removeModelDecoration(id);
275
+ });
276
+ const ret = ( newDecorations.map(option => {
277
+ return this.addModelDecoration(option);
278
+ }));
279
+ return ret;
280
+ }
281
+ _removeCellDecoration(decorationId) {
282
+ const options = this._resolvedCellDecorations.get(decorationId);
283
+ this._resolvedCellDecorations.delete(decorationId);
284
+ if (options) {
285
+ for (const existingOptions of ( this._resolvedCellDecorations.values())) {
286
+ if (options.className === existingOptions.className) {
287
+ options.className = undefined;
288
+ }
289
+ if (options.outputClassName === existingOptions.outputClassName) {
290
+ options.outputClassName = undefined;
291
+ }
292
+ if (options.gutterClassName === existingOptions.gutterClassName) {
293
+ options.gutterClassName = undefined;
294
+ }
295
+ if (options.topClassName === existingOptions.topClassName) {
296
+ options.topClassName = undefined;
297
+ }
298
+ }
299
+ this._cellDecorationsChanged.fire({ added: [], removed: [options] });
300
+ }
301
+ }
302
+ _addCellDecoration(options) {
303
+ const id = ++this._lastDecorationId;
304
+ const decorationId = `_cell_${this.id};${id}`;
305
+ this._resolvedCellDecorations.set(decorationId, options);
306
+ this._cellDecorationsChanged.fire({ added: [options], removed: [] });
307
+ return decorationId;
308
+ }
309
+ getCellDecorations() {
310
+ return [...( this._resolvedCellDecorations.values())];
311
+ }
312
+ getCellDecorationRange(decorationId) {
313
+ if (this._textEditor) {
314
+ return this._textEditor.getModel()?.getDecorationRange(decorationId) ?? null;
315
+ }
316
+ return null;
317
+ }
318
+ deltaCellDecorations(oldDecorations, newDecorations) {
319
+ oldDecorations.forEach(id => {
320
+ this._removeCellDecoration(id);
321
+ });
322
+ const ret = ( newDecorations.map(option => {
323
+ return this._addCellDecoration(option);
324
+ }));
325
+ return ret;
326
+ }
327
+ deltaCellStatusBarItems(oldItems, newItems) {
328
+ oldItems.forEach(id => {
329
+ const item = this._cellStatusBarItems.get(id);
330
+ if (item) {
331
+ this._cellStatusBarItems.delete(id);
332
+ }
333
+ });
334
+ const newIds = ( newItems.map(item => {
335
+ const id = ++this._lastStatusBarId;
336
+ const itemId = `_cell_${this.id};${id}`;
337
+ this._cellStatusBarItems.set(itemId, item);
338
+ return itemId;
339
+ }));
340
+ this._onDidChangeCellStatusBarItems.fire();
341
+ return newIds;
342
+ }
343
+ getCellStatusBarItems() {
344
+ return Array.from(( this._cellStatusBarItems.values()));
345
+ }
346
+ revealRangeInCenter(range) {
347
+ this._textEditor?.revealRangeInCenter(range, 1 );
348
+ }
349
+ setSelection(range) {
350
+ this._textEditor?.setSelection(range);
351
+ }
352
+ setSelections(selections) {
353
+ if (selections.length) {
354
+ this._textEditor?.setSelections(selections);
355
+ }
356
+ }
357
+ getSelections() {
358
+ return this._textEditor?.getSelections() || [];
359
+ }
360
+ getSelectionsStartPosition() {
361
+ if (this._textEditor) {
362
+ const selections = this._textEditor.getSelections();
363
+ return selections?.map(s => s.getStartPosition());
364
+ }
365
+ else {
366
+ const selections = this._editorViewStates?.cursorState;
367
+ return selections?.map(s => s.selectionStart);
368
+ }
369
+ }
370
+ getLineScrollTopOffset(line) {
371
+ if (!this._textEditor) {
372
+ return 0;
373
+ }
374
+ const editorPadding = this._viewContext.notebookOptions.computeEditorPadding(this.internalMetadata, this.uri);
375
+ return this._textEditor.getTopForLineNumber(line) + editorPadding.top;
376
+ }
377
+ getPositionScrollTopOffset(range) {
378
+ if (!this._textEditor) {
379
+ return 0;
380
+ }
381
+ const position = range instanceof Selection ? range.getPosition() : range.getStartPosition();
382
+ const editorPadding = this._viewContext.notebookOptions.computeEditorPadding(this.internalMetadata, this.uri);
383
+ return this._textEditor.getTopForPosition(position.lineNumber, position.column) + editorPadding.top;
384
+ }
385
+ cursorAtLineBoundary() {
386
+ if (!this._textEditor || !this.textModel || !this._textEditor.hasTextFocus()) {
387
+ return CursorAtLineBoundary.None;
388
+ }
389
+ const selection = this._textEditor.getSelection();
390
+ if (!selection || !selection.isEmpty()) {
391
+ return CursorAtLineBoundary.None;
392
+ }
393
+ const currentLineLength = this.textModel.getLineLength(selection.startLineNumber);
394
+ if (currentLineLength === 0) {
395
+ return CursorAtLineBoundary.Both;
396
+ }
397
+ switch (selection.startColumn) {
398
+ case 1:
399
+ return CursorAtLineBoundary.Start;
400
+ case currentLineLength + 1:
401
+ return CursorAtLineBoundary.End;
402
+ default:
403
+ return CursorAtLineBoundary.None;
404
+ }
405
+ }
406
+ cursorAtBoundary() {
407
+ if (!this._textEditor) {
408
+ return CursorAtBoundary.None;
409
+ }
410
+ if (!this.textModel) {
411
+ return CursorAtBoundary.None;
412
+ }
413
+ const selection = this._textEditor.getSelection();
414
+ if (!selection || !selection.isEmpty()) {
415
+ return CursorAtBoundary.None;
416
+ }
417
+ const firstViewLineTop = this._textEditor.getTopForPosition(1, 1);
418
+ const lastViewLineTop = this._textEditor.getTopForPosition(this.textModel.getLineCount(), this.textModel.getLineLength(this.textModel.getLineCount()));
419
+ const selectionTop = this._textEditor.getTopForPosition(selection.startLineNumber, selection.startColumn);
420
+ if (selectionTop === lastViewLineTop) {
421
+ if (selectionTop === firstViewLineTop) {
422
+ return CursorAtBoundary.Both;
423
+ }
424
+ else {
425
+ return CursorAtBoundary.Bottom;
426
+ }
427
+ }
428
+ else {
429
+ if (selectionTop === firstViewLineTop) {
430
+ return CursorAtBoundary.Top;
431
+ }
432
+ else {
433
+ return CursorAtBoundary.None;
434
+ }
435
+ }
436
+ }
437
+ get editStateSource() {
438
+ return this._editStateSource;
439
+ }
440
+ updateEditState(newState, source) {
441
+ this._editStateSource = source;
442
+ if (newState === this._editState) {
443
+ return;
444
+ }
445
+ this._editState = newState;
446
+ this._onDidChangeState.fire({ editStateChanged: true });
447
+ if (this._editState === CellEditState.Preview) {
448
+ this.focusMode = CellFocusMode.Container;
449
+ }
450
+ }
451
+ getEditState() {
452
+ return this._editState;
453
+ }
454
+ get textBuffer() {
455
+ return this.model.textBuffer;
456
+ }
457
+ async resolveTextModel() {
458
+ if (!this._textModelRef || !this.textModel) {
459
+ this._textModelRef = await this._modelService.createModelReference(this.uri);
460
+ if (this._isDisposed) {
461
+ return this.textModel;
462
+ }
463
+ if (!this._textModelRef) {
464
+ throw new Error(`Cannot resolve text model for ${this.uri}`);
465
+ }
466
+ this._register(this.textModel.onDidChangeContent(() => this.onDidChangeTextModelContent()));
467
+ }
468
+ return this.textModel;
469
+ }
470
+ cellStartFind(value, options) {
471
+ let cellMatches = [];
472
+ if (this.assertTextModelAttached()) {
473
+ cellMatches = this.textModel.findMatches(value, false, options.regex || false, options.caseSensitive || false, options.wholeWord ? options.wordSeparators || null : null, options.regex || false);
474
+ }
475
+ else {
476
+ const lineCount = this.textBuffer.getLineCount();
477
+ const fullRange = ( new Range(1, 1, lineCount, this.textBuffer.getLineLength(lineCount) + 1));
478
+ const searchParams = ( new SearchParams(
479
+ value,
480
+ options.regex || false,
481
+ options.caseSensitive || false,
482
+ options.wholeWord ? options.wordSeparators || null : null
483
+ ));
484
+ const searchData = searchParams.parseSearchRequest();
485
+ if (!searchData) {
486
+ return null;
487
+ }
488
+ cellMatches = this.textBuffer.findMatchesLineByLine(fullRange, searchData, options.regex || false, 1000);
489
+ }
490
+ return cellMatches;
491
+ }
492
+ dispose() {
493
+ this._isDisposed = true;
494
+ super.dispose();
495
+ dispose(this._editorListeners);
496
+ if (this._undoRedoService.getUriComparisonKey(this.uri) === ( this.uri.toString())) {
497
+ this._undoRedoService.removeElements(this.uri);
498
+ }
499
+ this._textModelRef?.dispose();
500
+ }
501
+ toJSON() {
502
+ return {
503
+ handle: this.handle
504
+ };
505
+ }
506
+ }
507
+ export { BaseCellViewModel };