@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,1485 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { distinct } from 'monaco-editor/esm/vs/base/common/arrays.js';
3
+ import { RunOnceScheduler, DeferredPromise } from 'monaco-editor/esm/vs/base/common/async.js';
4
+ import { decodeBase64, VSBuffer, encodeBase64 } from 'monaco-editor/esm/vs/base/common/buffer.js';
5
+ import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
6
+ import { stringHash } from 'monaco-editor/esm/vs/base/common/hash.js';
7
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
8
+ import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
9
+ import { mixin } from 'monaco-editor/esm/vs/base/common/objects.js';
10
+ import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
11
+ import { isString, isUndefinedOrNull } from 'monaco-editor/esm/vs/base/common/types.js';
12
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
13
+ import { generateUuid } from 'monaco-editor/esm/vs/base/common/uuid.js';
14
+ import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
15
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
16
+ import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
17
+ import { DEBUG_MEMORY_SCHEME } from './debug.js';
18
+ import { getUriFromSource, UNKNOWN_SOURCE_LABEL } from './debugSource.js';
19
+ import { DisassemblyViewInput } from './disassemblyViewInput.js';
20
+ import { ITextFileService } from '../../../services/textfile/common/textfiles.js';
21
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
22
+ import { autorun } from 'monaco-editor/esm/vs/base/common/observable.js';
23
+ import { findLastIdx } from 'monaco-editor/esm/vs/base/common/arraysFind.js';
24
+ class ExpressionContainer {
25
+ static { this.allValues = ( new Map()); }
26
+ static { this.BASE_CHUNK_SIZE = 100; }
27
+ constructor(session, threadId, _reference, id, namedVariables = 0, indexedVariables = 0, memoryReference = undefined, startOfVariables = 0, presentationHint = undefined) {
28
+ this.session = session;
29
+ this.threadId = threadId;
30
+ this._reference = _reference;
31
+ this.id = id;
32
+ this.namedVariables = namedVariables;
33
+ this.indexedVariables = indexedVariables;
34
+ this.memoryReference = memoryReference;
35
+ this.startOfVariables = startOfVariables;
36
+ this.presentationHint = presentationHint;
37
+ this.valueChanged = false;
38
+ this._value = '';
39
+ }
40
+ get reference() {
41
+ return this._reference;
42
+ }
43
+ set reference(value) {
44
+ this._reference = value;
45
+ this.children = undefined;
46
+ }
47
+ async evaluateLazy() {
48
+ if (typeof this.reference === 'undefined') {
49
+ return;
50
+ }
51
+ const response = await this.session.variables(this.reference, this.threadId, undefined, undefined, undefined);
52
+ if (!response || !response.body || !response.body.variables || response.body.variables.length !== 1) {
53
+ return;
54
+ }
55
+ const dummyVar = response.body.variables[0];
56
+ this.reference = dummyVar.variablesReference;
57
+ this._value = dummyVar.value;
58
+ this.namedVariables = dummyVar.namedVariables;
59
+ this.indexedVariables = dummyVar.indexedVariables;
60
+ this.memoryReference = dummyVar.memoryReference;
61
+ this.presentationHint = dummyVar.presentationHint;
62
+ this.adoptLazyResponse(dummyVar);
63
+ }
64
+ adoptLazyResponse(response) {
65
+ }
66
+ getChildren() {
67
+ if (!this.children) {
68
+ this.children = this.doGetChildren();
69
+ }
70
+ return this.children;
71
+ }
72
+ async doGetChildren() {
73
+ if (!this.hasChildren) {
74
+ return [];
75
+ }
76
+ if (!this.getChildrenInChunks) {
77
+ return this.fetchVariables(undefined, undefined, undefined);
78
+ }
79
+ const children = this.namedVariables ? await this.fetchVariables(undefined, undefined, 'named') : [];
80
+ let chunkSize = ExpressionContainer.BASE_CHUNK_SIZE;
81
+ while (!!this.indexedVariables && this.indexedVariables > chunkSize * ExpressionContainer.BASE_CHUNK_SIZE) {
82
+ chunkSize *= ExpressionContainer.BASE_CHUNK_SIZE;
83
+ }
84
+ if (!!this.indexedVariables && this.indexedVariables > chunkSize) {
85
+ const numberOfChunks = Math.ceil(this.indexedVariables / chunkSize);
86
+ for (let i = 0; i < numberOfChunks; i++) {
87
+ const start = (this.startOfVariables || 0) + i * chunkSize;
88
+ const count = Math.min(chunkSize, this.indexedVariables - i * chunkSize);
89
+ children.push(( new Variable(
90
+ this.session,
91
+ this.threadId,
92
+ this,
93
+ this.reference,
94
+ `[${start}..${start + count - 1}]`,
95
+ '',
96
+ '',
97
+ undefined,
98
+ count,
99
+ undefined,
100
+ { kind: 'virtual' },
101
+ undefined,
102
+ undefined,
103
+ true,
104
+ start
105
+ )));
106
+ }
107
+ return children;
108
+ }
109
+ const variables = await this.fetchVariables(this.startOfVariables, this.indexedVariables, 'indexed');
110
+ return children.concat(variables);
111
+ }
112
+ getId() {
113
+ return this.id;
114
+ }
115
+ getSession() {
116
+ return this.session;
117
+ }
118
+ get value() {
119
+ return this._value;
120
+ }
121
+ get hasChildren() {
122
+ return !!this.reference && this.reference > 0 && !this.presentationHint?.lazy;
123
+ }
124
+ async fetchVariables(start, count, filter) {
125
+ try {
126
+ const response = await this.session.variables(this.reference || 0, this.threadId, filter, start, count);
127
+ if (!response || !response.body || !response.body.variables) {
128
+ return [];
129
+ }
130
+ const nameCount = ( new Map());
131
+ const vars = ( response.body.variables.filter(v => !!v).map((v) => {
132
+ if (isString(v.value) && isString(v.name) && typeof v.variablesReference === 'number') {
133
+ const count = nameCount.get(v.name) || 0;
134
+ const idDuplicationIndex = count > 0 ? ( count.toString()) : '';
135
+ nameCount.set(v.name, count + 1);
136
+ return ( new Variable(
137
+ this.session,
138
+ this.threadId,
139
+ this,
140
+ v.variablesReference,
141
+ v.name,
142
+ v.evaluateName,
143
+ v.value,
144
+ v.namedVariables,
145
+ v.indexedVariables,
146
+ v.memoryReference,
147
+ v.presentationHint,
148
+ v.type,
149
+ v.__vscodeVariableMenuContext,
150
+ true,
151
+ 0,
152
+ idDuplicationIndex
153
+ ));
154
+ }
155
+ return ( new Variable(this.session, this.threadId, this, 0, '', undefined, ( nls.localizeWithPath(
156
+ 'vs/workbench/contrib/debug/common/debugModel',
157
+ 'invalidVariableAttributes',
158
+ "Invalid variable attributes"
159
+ )), 0, 0, undefined, { kind: 'virtual' }, undefined, undefined, false));
160
+ }));
161
+ if (this.session.autoExpandLazyVariables) {
162
+ await Promise.all(( vars.map(v => v.presentationHint?.lazy && v.evaluateLazy())));
163
+ }
164
+ return vars;
165
+ }
166
+ catch (e) {
167
+ return [( new Variable(
168
+ this.session,
169
+ this.threadId,
170
+ this,
171
+ 0,
172
+ '',
173
+ undefined,
174
+ e.message,
175
+ 0,
176
+ 0,
177
+ undefined,
178
+ { kind: 'virtual' },
179
+ undefined,
180
+ undefined,
181
+ false
182
+ ))];
183
+ }
184
+ }
185
+ get getChildrenInChunks() {
186
+ return !!this.indexedVariables;
187
+ }
188
+ set value(value) {
189
+ this._value = value;
190
+ this.valueChanged = !!ExpressionContainer.allValues.get(this.getId()) &&
191
+ ExpressionContainer.allValues.get(this.getId()) !== Expression.DEFAULT_VALUE && ExpressionContainer.allValues.get(this.getId()) !== value;
192
+ ExpressionContainer.allValues.set(this.getId(), value);
193
+ }
194
+ toString() {
195
+ return this.value;
196
+ }
197
+ async evaluateExpression(expression, session, stackFrame, context, keepLazyVars = false) {
198
+ if (!session || (!stackFrame && context !== 'repl')) {
199
+ this.value = context === 'repl' ? ( nls.localizeWithPath(
200
+ 'vs/workbench/contrib/debug/common/debugModel',
201
+ 'startDebugFirst',
202
+ "Please start a debug session to evaluate expressions"
203
+ )) : Expression.DEFAULT_VALUE;
204
+ this.reference = 0;
205
+ return false;
206
+ }
207
+ this.session = session;
208
+ try {
209
+ const response = await session.evaluate(expression, stackFrame ? stackFrame.frameId : undefined, context);
210
+ if (response && response.body) {
211
+ this.value = response.body.result || '';
212
+ this.reference = response.body.variablesReference;
213
+ this.namedVariables = response.body.namedVariables;
214
+ this.indexedVariables = response.body.indexedVariables;
215
+ this.memoryReference = response.body.memoryReference;
216
+ this.type = response.body.type || this.type;
217
+ this.presentationHint = response.body.presentationHint;
218
+ if (!keepLazyVars && response.body.presentationHint?.lazy) {
219
+ await this.evaluateLazy();
220
+ }
221
+ return true;
222
+ }
223
+ return false;
224
+ }
225
+ catch (e) {
226
+ this.value = e.message || '';
227
+ this.reference = 0;
228
+ return false;
229
+ }
230
+ }
231
+ }
232
+ function handleSetResponse(expression, response) {
233
+ if (response && response.body) {
234
+ expression.value = response.body.value || '';
235
+ expression.type = response.body.type || expression.type;
236
+ expression.reference = response.body.variablesReference;
237
+ expression.namedVariables = response.body.namedVariables;
238
+ expression.indexedVariables = response.body.indexedVariables;
239
+ }
240
+ }
241
+ class Expression extends ExpressionContainer {
242
+ static { this.DEFAULT_VALUE = ( nls.localizeWithPath(
243
+ 'vs/workbench/contrib/debug/common/debugModel',
244
+ 'notAvailable',
245
+ "not available"
246
+ )); }
247
+ constructor(name, id = generateUuid()) {
248
+ super(undefined, undefined, 0, id);
249
+ this.name = name;
250
+ this.available = false;
251
+ if (name) {
252
+ this.value = Expression.DEFAULT_VALUE;
253
+ }
254
+ }
255
+ async evaluate(session, stackFrame, context, keepLazyVars) {
256
+ this.available = await this.evaluateExpression(this.name, session, stackFrame, context, keepLazyVars);
257
+ }
258
+ toString() {
259
+ return `${this.name}\n${this.value}`;
260
+ }
261
+ async setExpression(value, stackFrame) {
262
+ if (!this.session) {
263
+ return;
264
+ }
265
+ const response = await this.session.setExpression(stackFrame.frameId, this.name, value);
266
+ handleSetResponse(this, response);
267
+ }
268
+ }
269
+ class Variable extends ExpressionContainer {
270
+ constructor(session, threadId, parent, reference, name, evaluateName, value, namedVariables, indexedVariables, memoryReference, presentationHint, type = undefined, variableMenuContext = undefined, available = true, startOfVariables = 0, idDuplicationIndex = '') {
271
+ super(session, threadId, reference, `variable:${parent.getId()}:${name}:${idDuplicationIndex}`, namedVariables, indexedVariables, memoryReference, startOfVariables, presentationHint);
272
+ this.parent = parent;
273
+ this.name = name;
274
+ this.evaluateName = evaluateName;
275
+ this.variableMenuContext = variableMenuContext;
276
+ this.available = available;
277
+ this.value = value || '';
278
+ this.type = type;
279
+ }
280
+ async setVariable(value, stackFrame) {
281
+ if (!this.session) {
282
+ return;
283
+ }
284
+ try {
285
+ if (this.session.capabilities.supportsSetExpression && !this.session.capabilities.supportsSetVariable && this.evaluateName) {
286
+ return this.setExpression(value, stackFrame);
287
+ }
288
+ const response = await this.session.setVariable(this.parent.reference, this.name, value);
289
+ handleSetResponse(this, response);
290
+ }
291
+ catch (err) {
292
+ this.errorMessage = err.message;
293
+ }
294
+ }
295
+ async setExpression(value, stackFrame) {
296
+ if (!this.session || !this.evaluateName) {
297
+ return;
298
+ }
299
+ const response = await this.session.setExpression(stackFrame.frameId, this.evaluateName, value);
300
+ handleSetResponse(this, response);
301
+ }
302
+ toString() {
303
+ return this.name ? `${this.name}: ${this.value}` : this.value;
304
+ }
305
+ adoptLazyResponse(response) {
306
+ this.evaluateName = response.evaluateName;
307
+ }
308
+ toDebugProtocolObject() {
309
+ return {
310
+ name: this.name,
311
+ variablesReference: this.reference || 0,
312
+ memoryReference: this.memoryReference,
313
+ value: this.value,
314
+ evaluateName: this.evaluateName
315
+ };
316
+ }
317
+ }
318
+ class Scope extends ExpressionContainer {
319
+ constructor(stackFrame, id, name, reference, expensive, namedVariables, indexedVariables, range) {
320
+ super(stackFrame.thread.session, stackFrame.thread.threadId, reference, `scope:${name}:${id}`, namedVariables, indexedVariables);
321
+ this.name = name;
322
+ this.expensive = expensive;
323
+ this.range = range;
324
+ }
325
+ toString() {
326
+ return this.name;
327
+ }
328
+ toDebugProtocolObject() {
329
+ return {
330
+ name: this.name,
331
+ variablesReference: this.reference || 0,
332
+ expensive: this.expensive
333
+ };
334
+ }
335
+ }
336
+ class ErrorScope extends Scope {
337
+ constructor(stackFrame, index, message) {
338
+ super(stackFrame, index, message, 0, false);
339
+ }
340
+ toString() {
341
+ return this.name;
342
+ }
343
+ }
344
+ class StackFrame {
345
+ constructor(thread, frameId, source, name, presentationHint, range, index, canRestart, instructionPointerReference) {
346
+ this.thread = thread;
347
+ this.frameId = frameId;
348
+ this.source = source;
349
+ this.name = name;
350
+ this.presentationHint = presentationHint;
351
+ this.range = range;
352
+ this.index = index;
353
+ this.canRestart = canRestart;
354
+ this.instructionPointerReference = instructionPointerReference;
355
+ }
356
+ getId() {
357
+ return `stackframe:${this.thread.getId()}:${this.index}:${this.source.name}`;
358
+ }
359
+ getScopes() {
360
+ if (!this.scopes) {
361
+ this.scopes = this.thread.session.scopes(this.frameId, this.thread.threadId).then(response => {
362
+ if (!response || !response.body || !response.body.scopes) {
363
+ return [];
364
+ }
365
+ const usedIds = ( new Set());
366
+ return ( response.body.scopes.map(rs => {
367
+ let id = 0;
368
+ do {
369
+ id = stringHash(`${rs.name}:${rs.line}:${rs.column}`, id);
370
+ } while (( usedIds.has(id)));
371
+ usedIds.add(id);
372
+ return ( new Scope(
373
+ this,
374
+ id,
375
+ rs.name,
376
+ rs.variablesReference,
377
+ rs.expensive,
378
+ rs.namedVariables,
379
+ rs.indexedVariables,
380
+ rs.line && rs.column && rs.endLine && rs.endColumn ? ( new Range(rs.line, rs.column, rs.endLine, rs.endColumn)) : undefined
381
+ ));
382
+ }));
383
+ }, err => [( new ErrorScope(this, 0, err.message))]);
384
+ }
385
+ return this.scopes;
386
+ }
387
+ async getMostSpecificScopes(range) {
388
+ const scopes = await this.getScopes();
389
+ const nonExpensiveScopes = scopes.filter(s => !s.expensive);
390
+ const haveRangeInfo = ( nonExpensiveScopes.some(s => !!s.range));
391
+ if (!haveRangeInfo) {
392
+ return nonExpensiveScopes;
393
+ }
394
+ const scopesContainingRange = nonExpensiveScopes.filter(scope => scope.range && Range.containsRange(scope.range, range))
395
+ .sort((first, second) => (first.range.endLineNumber - first.range.startLineNumber) - (second.range.endLineNumber - second.range.startLineNumber));
396
+ return scopesContainingRange.length ? scopesContainingRange : nonExpensiveScopes;
397
+ }
398
+ restart() {
399
+ return this.thread.session.restartFrame(this.frameId, this.thread.threadId);
400
+ }
401
+ forgetScopes() {
402
+ this.scopes = undefined;
403
+ }
404
+ toString() {
405
+ const lineNumberToString = typeof this.range.startLineNumber === 'number' ? `:${this.range.startLineNumber}` : '';
406
+ const sourceToString = `${this.source.inMemory ? this.source.name : this.source.uri.fsPath}${lineNumberToString}`;
407
+ return sourceToString === UNKNOWN_SOURCE_LABEL ? this.name : `${this.name} (${sourceToString})`;
408
+ }
409
+ async openInEditor(editorService, preserveFocus, sideBySide, pinned) {
410
+ const threadStopReason = this.thread.stoppedDetails?.reason;
411
+ if (this.instructionPointerReference &&
412
+ (threadStopReason === 'instruction breakpoint' ||
413
+ (threadStopReason === 'step' && this.thread.lastSteppingGranularity === 'instruction') ||
414
+ editorService.activeEditor instanceof DisassemblyViewInput)) {
415
+ return editorService.openEditor(DisassemblyViewInput.instance, { pinned: true, revealIfOpened: true });
416
+ }
417
+ if (this.source.available) {
418
+ return this.source.openInEditor(editorService, this.range, preserveFocus, sideBySide, pinned);
419
+ }
420
+ return undefined;
421
+ }
422
+ equals(other) {
423
+ return (this.name === other.name) && (other.thread === this.thread) && (this.frameId === other.frameId) && (other.source === this.source) && (Range.equalsRange(this.range, other.range));
424
+ }
425
+ }
426
+ class Thread {
427
+ constructor(session, name, threadId) {
428
+ this.session = session;
429
+ this.name = name;
430
+ this.threadId = threadId;
431
+ this.callStackCancellationTokens = [];
432
+ this.reachedEndOfCallStack = false;
433
+ this.callStack = [];
434
+ this.staleCallStack = [];
435
+ this.stopped = false;
436
+ }
437
+ getId() {
438
+ return `thread:${this.session.getId()}:${this.threadId}`;
439
+ }
440
+ clearCallStack() {
441
+ if (this.callStack.length) {
442
+ this.staleCallStack = this.callStack;
443
+ }
444
+ this.callStack = [];
445
+ this.callStackCancellationTokens.forEach(c => c.dispose(true));
446
+ this.callStackCancellationTokens = [];
447
+ }
448
+ getCallStack() {
449
+ return this.callStack;
450
+ }
451
+ getStaleCallStack() {
452
+ return this.staleCallStack;
453
+ }
454
+ getTopStackFrame() {
455
+ const callStack = this.getCallStack();
456
+ const firstAvailableStackFrame = callStack.find(sf => !!(sf &&
457
+ ((this.stoppedDetails?.reason === 'instruction breakpoint' || (this.stoppedDetails?.reason === 'step' && this.lastSteppingGranularity === 'instruction')) && sf.instructionPointerReference) ||
458
+ (sf.source && sf.source.available && sf.source.presentationHint !== 'deemphasize')));
459
+ return firstAvailableStackFrame;
460
+ }
461
+ get stateLabel() {
462
+ if (this.stoppedDetails) {
463
+ return this.stoppedDetails.description ||
464
+ (this.stoppedDetails.reason ? ( nls.localizeWithPath(
465
+ 'vs/workbench/contrib/debug/common/debugModel',
466
+ { key: 'pausedOn', comment: ['indicates reason for program being paused'] },
467
+ "Paused on {0}",
468
+ this.stoppedDetails.reason
469
+ )) : ( nls.localizeWithPath('vs/workbench/contrib/debug/common/debugModel', 'paused', "Paused")));
470
+ }
471
+ return ( nls.localizeWithPath(
472
+ 'vs/workbench/contrib/debug/common/debugModel',
473
+ { key: 'running', comment: ['indicates state'] },
474
+ "Running"
475
+ ));
476
+ }
477
+ async fetchCallStack(levels = 20) {
478
+ if (this.stopped) {
479
+ const start = this.callStack.length;
480
+ const callStack = await this.getCallStackImpl(start, levels);
481
+ this.reachedEndOfCallStack = callStack.length < levels;
482
+ if (start < this.callStack.length) {
483
+ this.callStack.splice(start, this.callStack.length - start);
484
+ }
485
+ this.callStack = this.callStack.concat(callStack || []);
486
+ if (typeof this.stoppedDetails?.totalFrames === 'number' && this.stoppedDetails.totalFrames === this.callStack.length) {
487
+ this.reachedEndOfCallStack = true;
488
+ }
489
+ }
490
+ }
491
+ async getCallStackImpl(startFrame, levels) {
492
+ try {
493
+ const tokenSource = ( new CancellationTokenSource());
494
+ this.callStackCancellationTokens.push(tokenSource);
495
+ const response = await this.session.stackTrace(this.threadId, startFrame, levels, tokenSource.token);
496
+ if (!response || !response.body || tokenSource.token.isCancellationRequested) {
497
+ return [];
498
+ }
499
+ if (this.stoppedDetails) {
500
+ this.stoppedDetails.totalFrames = response.body.totalFrames;
501
+ }
502
+ return ( response.body.stackFrames.map((rsf, index) => {
503
+ const source = this.session.getSource(rsf.source);
504
+ return ( new StackFrame(this, rsf.id, source, rsf.name, rsf.presentationHint, ( new Range(rsf.line, rsf.column, rsf.endLine || rsf.line, rsf.endColumn || rsf.column)), startFrame + index, typeof rsf.canRestart === 'boolean' ? rsf.canRestart : true, rsf.instructionPointerReference));
505
+ }));
506
+ }
507
+ catch (err) {
508
+ if (this.stoppedDetails) {
509
+ this.stoppedDetails.framesErrorMessage = err.message;
510
+ }
511
+ return [];
512
+ }
513
+ }
514
+ get exceptionInfo() {
515
+ if (this.stoppedDetails && this.stoppedDetails.reason === 'exception') {
516
+ if (this.session.capabilities.supportsExceptionInfoRequest) {
517
+ return this.session.exceptionInfo(this.threadId);
518
+ }
519
+ return Promise.resolve({
520
+ description: this.stoppedDetails.text,
521
+ breakMode: null
522
+ });
523
+ }
524
+ return Promise.resolve(undefined);
525
+ }
526
+ next(granularity) {
527
+ return this.session.next(this.threadId, granularity);
528
+ }
529
+ stepIn(granularity) {
530
+ return this.session.stepIn(this.threadId, undefined, granularity);
531
+ }
532
+ stepOut(granularity) {
533
+ return this.session.stepOut(this.threadId, granularity);
534
+ }
535
+ stepBack(granularity) {
536
+ return this.session.stepBack(this.threadId, granularity);
537
+ }
538
+ continue() {
539
+ return this.session.continue(this.threadId);
540
+ }
541
+ pause() {
542
+ return this.session.pause(this.threadId);
543
+ }
544
+ terminate() {
545
+ return this.session.terminateThreads([this.threadId]);
546
+ }
547
+ reverseContinue() {
548
+ return this.session.reverseContinue(this.threadId);
549
+ }
550
+ }
551
+ const getUriForDebugMemory = (sessionId, memoryReference, range, displayName = 'memory') => {
552
+ return ( URI.from({
553
+ scheme: DEBUG_MEMORY_SCHEME,
554
+ authority: sessionId,
555
+ path: '/' + encodeURIComponent(memoryReference) + `/${encodeURIComponent(displayName)}.bin`,
556
+ query: range ? `?range=${range.fromOffset}:${range.toOffset}` : undefined,
557
+ }));
558
+ };
559
+ class MemoryRegion extends Disposable {
560
+ constructor(memoryReference, session) {
561
+ super();
562
+ this.memoryReference = memoryReference;
563
+ this.session = session;
564
+ this.invalidateEmitter = this._register(( new Emitter()));
565
+ this.onDidInvalidate = this.invalidateEmitter.event;
566
+ this.writable = !!this.session.capabilities.supportsWriteMemoryRequest;
567
+ this._register(session.onDidInvalidateMemory(e => {
568
+ if (e.body.memoryReference === memoryReference) {
569
+ this.invalidate(e.body.offset, e.body.count - e.body.offset);
570
+ }
571
+ }));
572
+ }
573
+ async read(fromOffset, toOffset) {
574
+ const length = toOffset - fromOffset;
575
+ const offset = fromOffset;
576
+ const result = await this.session.readMemory(this.memoryReference, offset, length);
577
+ if (result === undefined || !result.body?.data) {
578
+ return [{ type: 1 , offset, length }];
579
+ }
580
+ let data;
581
+ try {
582
+ data = decodeBase64(result.body.data);
583
+ }
584
+ catch {
585
+ return [{ type: 2 , offset, length, error: 'Invalid base64 data from debug adapter' }];
586
+ }
587
+ const unreadable = result.body.unreadableBytes || 0;
588
+ const dataLength = length - unreadable;
589
+ if (data.byteLength < dataLength) {
590
+ const pad = VSBuffer.alloc(dataLength - data.byteLength);
591
+ pad.buffer.fill(0);
592
+ data = VSBuffer.concat([data, pad], dataLength);
593
+ }
594
+ else if (data.byteLength > dataLength) {
595
+ data = data.slice(0, dataLength);
596
+ }
597
+ if (!unreadable) {
598
+ return [{ type: 0 , offset, length, data }];
599
+ }
600
+ return [
601
+ { type: 0 , offset, length: dataLength, data },
602
+ { type: 1 , offset: offset + dataLength, length: unreadable },
603
+ ];
604
+ }
605
+ async write(offset, data) {
606
+ const result = await this.session.writeMemory(this.memoryReference, offset, encodeBase64(data), true);
607
+ const written = result?.body?.bytesWritten ?? data.byteLength;
608
+ this.invalidate(offset, offset + written);
609
+ return written;
610
+ }
611
+ dispose() {
612
+ super.dispose();
613
+ }
614
+ invalidate(fromOffset, toOffset) {
615
+ this.invalidateEmitter.fire({ fromOffset, toOffset });
616
+ }
617
+ }
618
+ class Enablement {
619
+ constructor(enabled, id) {
620
+ this.enabled = enabled;
621
+ this.id = id;
622
+ }
623
+ getId() {
624
+ return this.id;
625
+ }
626
+ }
627
+ function toBreakpointSessionData(data, capabilities) {
628
+ return mixin({
629
+ supportsConditionalBreakpoints: !!capabilities.supportsConditionalBreakpoints,
630
+ supportsHitConditionalBreakpoints: !!capabilities.supportsHitConditionalBreakpoints,
631
+ supportsLogPoints: !!capabilities.supportsLogPoints,
632
+ supportsFunctionBreakpoints: !!capabilities.supportsFunctionBreakpoints,
633
+ supportsDataBreakpoints: !!capabilities.supportsDataBreakpoints,
634
+ supportsInstructionBreakpoints: !!capabilities.supportsInstructionBreakpoints
635
+ }, data);
636
+ }
637
+ class BaseBreakpoint extends Enablement {
638
+ constructor(enabled, hitCondition, condition, logMessage, id) {
639
+ super(enabled, id);
640
+ this.hitCondition = hitCondition;
641
+ this.condition = condition;
642
+ this.logMessage = logMessage;
643
+ this.sessionData = ( new Map());
644
+ if (enabled === undefined) {
645
+ this.enabled = true;
646
+ }
647
+ }
648
+ setSessionData(sessionId, data) {
649
+ if (!data) {
650
+ this.sessionData.delete(sessionId);
651
+ }
652
+ else {
653
+ data.sessionId = sessionId;
654
+ this.sessionData.set(sessionId, data);
655
+ }
656
+ const allData = Array.from(( this.sessionData.values()));
657
+ const verifiedData = distinct(allData.filter(d => d.verified), d => `${d.line}:${d.column}`);
658
+ if (verifiedData.length) {
659
+ this.data = verifiedData.length === 1 ? verifiedData[0] : undefined;
660
+ }
661
+ else {
662
+ this.data = allData.length ? allData[0] : undefined;
663
+ }
664
+ }
665
+ get message() {
666
+ if (!this.data) {
667
+ return undefined;
668
+ }
669
+ return this.data.message;
670
+ }
671
+ get verified() {
672
+ return this.data ? this.data.verified : true;
673
+ }
674
+ get sessionsThatVerified() {
675
+ const sessionIds = [];
676
+ for (const [sessionId, data] of this.sessionData) {
677
+ if (data.verified) {
678
+ sessionIds.push(sessionId);
679
+ }
680
+ }
681
+ return sessionIds;
682
+ }
683
+ getIdFromAdapter(sessionId) {
684
+ const data = this.sessionData.get(sessionId);
685
+ return data ? data.id : undefined;
686
+ }
687
+ getDebugProtocolBreakpoint(sessionId) {
688
+ const data = this.sessionData.get(sessionId);
689
+ if (data) {
690
+ const bp = {
691
+ id: data.id,
692
+ verified: data.verified,
693
+ message: data.message,
694
+ source: data.source,
695
+ line: data.line,
696
+ column: data.column,
697
+ endLine: data.endLine,
698
+ endColumn: data.endColumn,
699
+ instructionReference: data.instructionReference,
700
+ offset: data.offset
701
+ };
702
+ return bp;
703
+ }
704
+ return undefined;
705
+ }
706
+ toJSON() {
707
+ const result = Object.create(null);
708
+ result.id = this.getId();
709
+ result.enabled = this.enabled;
710
+ result.condition = this.condition;
711
+ result.hitCondition = this.hitCondition;
712
+ result.logMessage = this.logMessage;
713
+ return result;
714
+ }
715
+ }
716
+ class Breakpoint extends BaseBreakpoint {
717
+ constructor(_uri, _lineNumber, _column, enabled, condition, hitCondition, logMessage, _adapterData, textFileService, uriIdentityService, logService, id = generateUuid()) {
718
+ super(enabled, hitCondition, condition, logMessage, id);
719
+ this._uri = _uri;
720
+ this._lineNumber = _lineNumber;
721
+ this._column = _column;
722
+ this._adapterData = _adapterData;
723
+ this.textFileService = textFileService;
724
+ this.uriIdentityService = uriIdentityService;
725
+ this.logService = logService;
726
+ }
727
+ get originalUri() {
728
+ return this._uri;
729
+ }
730
+ get lineNumber() {
731
+ return this.verified && this.data && typeof this.data.line === 'number' ? this.data.line : this._lineNumber;
732
+ }
733
+ get verified() {
734
+ if (this.data) {
735
+ return this.data.verified && !this.textFileService.isDirty(this._uri);
736
+ }
737
+ return true;
738
+ }
739
+ get uri() {
740
+ return this.verified && this.data && this.data.source ? getUriFromSource(this.data.source, this.data.source.path, this.data.sessionId, this.uriIdentityService, this.logService) : this._uri;
741
+ }
742
+ get column() {
743
+ return this.verified && this.data && typeof this.data.column === 'number' ? this.data.column : this._column;
744
+ }
745
+ get message() {
746
+ if (this.textFileService.isDirty(this.uri)) {
747
+ return ( nls.localizeWithPath(
748
+ 'vs/workbench/contrib/debug/common/debugModel',
749
+ 'breakpointDirtydHover',
750
+ "Unverified breakpoint. File is modified, please restart debug session."
751
+ ));
752
+ }
753
+ return super.message;
754
+ }
755
+ get adapterData() {
756
+ return this.data && this.data.source && this.data.source.adapterData ? this.data.source.adapterData : this._adapterData;
757
+ }
758
+ get endLineNumber() {
759
+ return this.verified && this.data ? this.data.endLine : undefined;
760
+ }
761
+ get endColumn() {
762
+ return this.verified && this.data ? this.data.endColumn : undefined;
763
+ }
764
+ get sessionAgnosticData() {
765
+ return {
766
+ lineNumber: this._lineNumber,
767
+ column: this._column
768
+ };
769
+ }
770
+ get supported() {
771
+ if (!this.data) {
772
+ return true;
773
+ }
774
+ if (this.logMessage && !this.data.supportsLogPoints) {
775
+ return false;
776
+ }
777
+ if (this.condition && !this.data.supportsConditionalBreakpoints) {
778
+ return false;
779
+ }
780
+ if (this.hitCondition && !this.data.supportsHitConditionalBreakpoints) {
781
+ return false;
782
+ }
783
+ return true;
784
+ }
785
+ setSessionData(sessionId, data) {
786
+ super.setSessionData(sessionId, data);
787
+ if (!this._adapterData) {
788
+ this._adapterData = this.adapterData;
789
+ }
790
+ }
791
+ toJSON() {
792
+ const result = super.toJSON();
793
+ result.uri = this._uri;
794
+ result.lineNumber = this._lineNumber;
795
+ result.column = this._column;
796
+ result.adapterData = this.adapterData;
797
+ return result;
798
+ }
799
+ toString() {
800
+ return `${resources.basenameOrAuthority(this.uri)} ${this.lineNumber}`;
801
+ }
802
+ update(data) {
803
+ if (!isUndefinedOrNull(data.lineNumber)) {
804
+ this._lineNumber = data.lineNumber;
805
+ }
806
+ if (!isUndefinedOrNull(data.column)) {
807
+ this._column = data.column;
808
+ }
809
+ if (!isUndefinedOrNull(data.condition)) {
810
+ this.condition = data.condition;
811
+ }
812
+ if (!isUndefinedOrNull(data.hitCondition)) {
813
+ this.hitCondition = data.hitCondition;
814
+ }
815
+ if (!isUndefinedOrNull(data.logMessage)) {
816
+ this.logMessage = data.logMessage;
817
+ }
818
+ }
819
+ }
820
+ class FunctionBreakpoint extends BaseBreakpoint {
821
+ constructor(name, enabled, hitCondition, condition, logMessage, id = generateUuid()) {
822
+ super(enabled, hitCondition, condition, logMessage, id);
823
+ this.name = name;
824
+ }
825
+ toJSON() {
826
+ const result = super.toJSON();
827
+ result.name = this.name;
828
+ return result;
829
+ }
830
+ get supported() {
831
+ if (!this.data) {
832
+ return true;
833
+ }
834
+ return this.data.supportsFunctionBreakpoints;
835
+ }
836
+ toString() {
837
+ return this.name;
838
+ }
839
+ }
840
+ class DataBreakpoint extends BaseBreakpoint {
841
+ constructor(description, dataId, canPersist, enabled, hitCondition, condition, logMessage, accessTypes, accessType, id = generateUuid()) {
842
+ super(enabled, hitCondition, condition, logMessage, id);
843
+ this.description = description;
844
+ this.dataId = dataId;
845
+ this.canPersist = canPersist;
846
+ this.accessTypes = accessTypes;
847
+ this.accessType = accessType;
848
+ }
849
+ toJSON() {
850
+ const result = super.toJSON();
851
+ result.description = this.description;
852
+ result.dataId = this.dataId;
853
+ result.accessTypes = this.accessTypes;
854
+ result.accessType = this.accessType;
855
+ return result;
856
+ }
857
+ get supported() {
858
+ if (!this.data) {
859
+ return true;
860
+ }
861
+ return this.data.supportsDataBreakpoints;
862
+ }
863
+ toString() {
864
+ return this.description;
865
+ }
866
+ }
867
+ class ExceptionBreakpoint extends BaseBreakpoint {
868
+ constructor(filter, label, enabled, supportsCondition, condition, description, conditionDescription, fallback = false) {
869
+ super(enabled, undefined, condition, undefined, generateUuid());
870
+ this.filter = filter;
871
+ this.label = label;
872
+ this.supportsCondition = supportsCondition;
873
+ this.description = description;
874
+ this.conditionDescription = conditionDescription;
875
+ this.fallback = fallback;
876
+ this.supportedSessions = ( new Set());
877
+ }
878
+ toJSON() {
879
+ const result = Object.create(null);
880
+ result.filter = this.filter;
881
+ result.label = this.label;
882
+ result.enabled = this.enabled;
883
+ result.supportsCondition = this.supportsCondition;
884
+ result.conditionDescription = this.conditionDescription;
885
+ result.condition = this.condition;
886
+ result.fallback = this.fallback;
887
+ result.description = this.description;
888
+ return result;
889
+ }
890
+ setSupportedSession(sessionId, supported) {
891
+ if (supported) {
892
+ this.supportedSessions.add(sessionId);
893
+ }
894
+ else {
895
+ this.supportedSessions.delete(sessionId);
896
+ }
897
+ }
898
+ setFallback(isFallback) {
899
+ this.fallback = isFallback;
900
+ }
901
+ get supported() {
902
+ return true;
903
+ }
904
+ isSupportedSession(sessionId) {
905
+ return sessionId ? ( this.supportedSessions.has(sessionId)) : this.fallback;
906
+ }
907
+ matches(filter) {
908
+ return this.filter === filter.filter && this.label === filter.label && this.supportsCondition === !!filter.supportsCondition && this.conditionDescription === filter.conditionDescription && this.description === filter.description;
909
+ }
910
+ toString() {
911
+ return this.label;
912
+ }
913
+ }
914
+ class InstructionBreakpoint extends BaseBreakpoint {
915
+ constructor(instructionReference, offset, canPersist, enabled, hitCondition, condition, logMessage, address, id = generateUuid()) {
916
+ super(enabled, hitCondition, condition, logMessage, id);
917
+ this.instructionReference = instructionReference;
918
+ this.offset = offset;
919
+ this.canPersist = canPersist;
920
+ this.address = address;
921
+ }
922
+ toJSON() {
923
+ const result = super.toJSON();
924
+ result.instructionReference = this.instructionReference;
925
+ result.offset = this.offset;
926
+ return result;
927
+ }
928
+ get supported() {
929
+ if (!this.data) {
930
+ return true;
931
+ }
932
+ return this.data.supportsInstructionBreakpoints;
933
+ }
934
+ toString() {
935
+ return this.instructionReference;
936
+ }
937
+ }
938
+ class ThreadAndSessionIds {
939
+ constructor(sessionId, threadId) {
940
+ this.sessionId = sessionId;
941
+ this.threadId = threadId;
942
+ }
943
+ getId() {
944
+ return `${this.sessionId}:${this.threadId}`;
945
+ }
946
+ }
947
+ let DebugModel = class DebugModel extends Disposable {
948
+ constructor(debugStorage, textFileService, uriIdentityService, logService) {
949
+ super();
950
+ this.textFileService = textFileService;
951
+ this.uriIdentityService = uriIdentityService;
952
+ this.logService = logService;
953
+ this.schedulers = ( new Map());
954
+ this.breakpointsActivated = true;
955
+ this._onDidChangeBreakpoints = this._register(( new Emitter()));
956
+ this._onDidChangeCallStack = this._register(( new Emitter()));
957
+ this._onDidChangeWatchExpressions = this._register(( new Emitter()));
958
+ this._register(autorun(reader => {
959
+ this.breakpoints = debugStorage.breakpoints.read(reader);
960
+ this.functionBreakpoints = debugStorage.functionBreakpoints.read(reader);
961
+ this.exceptionBreakpoints = debugStorage.exceptionBreakpoints.read(reader);
962
+ this.dataBreakpoints = debugStorage.dataBreakpoints.read(reader);
963
+ this._onDidChangeBreakpoints.fire(undefined);
964
+ }));
965
+ this._register(autorun(reader => {
966
+ this.watchExpressions = debugStorage.watchExpressions.read(reader);
967
+ this._onDidChangeWatchExpressions.fire(undefined);
968
+ }));
969
+ this.instructionBreakpoints = [];
970
+ this.sessions = [];
971
+ }
972
+ getId() {
973
+ return 'root';
974
+ }
975
+ getSession(sessionId, includeInactive = false) {
976
+ if (sessionId) {
977
+ return this.getSessions(includeInactive).find(s => s.getId() === sessionId);
978
+ }
979
+ return undefined;
980
+ }
981
+ getSessions(includeInactive = false) {
982
+ return this.sessions.filter(s => includeInactive || s.state !== 0 );
983
+ }
984
+ addSession(session) {
985
+ this.sessions = this.sessions.filter(s => {
986
+ if (s.getId() === session.getId()) {
987
+ return false;
988
+ }
989
+ if (s.state === 0 && s.configuration.name === session.configuration.name) {
990
+ return false;
991
+ }
992
+ return true;
993
+ });
994
+ let i = 1;
995
+ while (( this.sessions.some(s => s.getLabel() === session.getLabel()))) {
996
+ session.setName(`${session.configuration.name} ${++i}`);
997
+ }
998
+ let index = -1;
999
+ if (session.parentSession) {
1000
+ index = findLastIdx(this.sessions, s => s.parentSession === session.parentSession || s === session.parentSession);
1001
+ }
1002
+ if (index >= 0) {
1003
+ this.sessions.splice(index + 1, 0, session);
1004
+ }
1005
+ else {
1006
+ this.sessions.push(session);
1007
+ }
1008
+ this._onDidChangeCallStack.fire(undefined);
1009
+ }
1010
+ get onDidChangeBreakpoints() {
1011
+ return this._onDidChangeBreakpoints.event;
1012
+ }
1013
+ get onDidChangeCallStack() {
1014
+ return this._onDidChangeCallStack.event;
1015
+ }
1016
+ get onDidChangeWatchExpressions() {
1017
+ return this._onDidChangeWatchExpressions.event;
1018
+ }
1019
+ rawUpdate(data) {
1020
+ const session = this.sessions.find(p => p.getId() === data.sessionId);
1021
+ if (session) {
1022
+ session.rawUpdate(data);
1023
+ this._onDidChangeCallStack.fire(undefined);
1024
+ }
1025
+ }
1026
+ clearThreads(id, removeThreads, reference = undefined) {
1027
+ const session = this.sessions.find(p => p.getId() === id);
1028
+ this.schedulers.forEach(entry => {
1029
+ entry.scheduler.dispose();
1030
+ entry.completeDeferred.complete();
1031
+ });
1032
+ this.schedulers.clear();
1033
+ if (session) {
1034
+ session.clearThreads(removeThreads, reference);
1035
+ this._onDidChangeCallStack.fire(undefined);
1036
+ }
1037
+ }
1038
+ async fetchCallstack(thread, levels) {
1039
+ if (thread.reachedEndOfCallStack) {
1040
+ return;
1041
+ }
1042
+ const totalFrames = thread.stoppedDetails?.totalFrames;
1043
+ const remainingFrames = (typeof totalFrames === 'number') ? (totalFrames - thread.getCallStack().length) : undefined;
1044
+ if (!levels || (remainingFrames && levels > remainingFrames)) {
1045
+ levels = remainingFrames;
1046
+ }
1047
+ if (levels && levels > 0) {
1048
+ await thread.fetchCallStack(levels);
1049
+ this._onDidChangeCallStack.fire();
1050
+ }
1051
+ return;
1052
+ }
1053
+ refreshTopOfCallstack(thread, fetchFullStack = true) {
1054
+ if (thread.session.capabilities.supportsDelayedStackTraceLoading) {
1055
+ let topCallStack = Promise.resolve();
1056
+ const wholeCallStack = ( new Promise((c, e) => {
1057
+ topCallStack = thread.fetchCallStack(1).then(() => {
1058
+ if (!( this.schedulers.has(thread.getId())) && fetchFullStack) {
1059
+ const deferred = ( new DeferredPromise());
1060
+ this.schedulers.set(thread.getId(), {
1061
+ completeDeferred: deferred,
1062
+ scheduler: ( new RunOnceScheduler(() => {
1063
+ thread.fetchCallStack(19).then(() => {
1064
+ const stale = thread.getStaleCallStack();
1065
+ const current = thread.getCallStack();
1066
+ let bottomOfCallStackChanged = stale.length !== current.length;
1067
+ for (let i = 1; i < stale.length && !bottomOfCallStackChanged; i++) {
1068
+ bottomOfCallStackChanged = !stale[i].equals(current[i]);
1069
+ }
1070
+ if (bottomOfCallStackChanged) {
1071
+ this._onDidChangeCallStack.fire();
1072
+ }
1073
+ }).finally(() => {
1074
+ deferred.complete();
1075
+ this.schedulers.delete(thread.getId());
1076
+ });
1077
+ }, 420))
1078
+ });
1079
+ }
1080
+ const entry = this.schedulers.get(thread.getId());
1081
+ entry.scheduler.schedule();
1082
+ entry.completeDeferred.p.then(c, e);
1083
+ this._onDidChangeCallStack.fire();
1084
+ });
1085
+ }));
1086
+ return { topCallStack, wholeCallStack };
1087
+ }
1088
+ const wholeCallStack = thread.fetchCallStack();
1089
+ return { wholeCallStack, topCallStack: wholeCallStack };
1090
+ }
1091
+ getBreakpoints(filter) {
1092
+ if (filter) {
1093
+ const uriStr = filter.uri?.toString();
1094
+ const originalUriStr = filter.originalUri?.toString();
1095
+ return this.breakpoints.filter(bp => {
1096
+ if (uriStr && ( bp.uri.toString()) !== uriStr) {
1097
+ return false;
1098
+ }
1099
+ if (originalUriStr && ( bp.originalUri.toString()) !== originalUriStr) {
1100
+ return false;
1101
+ }
1102
+ if (filter.lineNumber && bp.lineNumber !== filter.lineNumber) {
1103
+ return false;
1104
+ }
1105
+ if (filter.column && bp.column !== filter.column) {
1106
+ return false;
1107
+ }
1108
+ if (filter.enabledOnly && (!this.breakpointsActivated || !bp.enabled)) {
1109
+ return false;
1110
+ }
1111
+ return true;
1112
+ });
1113
+ }
1114
+ return this.breakpoints;
1115
+ }
1116
+ getFunctionBreakpoints() {
1117
+ return this.functionBreakpoints;
1118
+ }
1119
+ getDataBreakpoints() {
1120
+ return this.dataBreakpoints;
1121
+ }
1122
+ getExceptionBreakpoints() {
1123
+ return this.exceptionBreakpoints;
1124
+ }
1125
+ getExceptionBreakpointsForSession(sessionId) {
1126
+ return this.exceptionBreakpoints.filter(ebp => ebp.isSupportedSession(sessionId));
1127
+ }
1128
+ getInstructionBreakpoints() {
1129
+ return this.instructionBreakpoints;
1130
+ }
1131
+ setExceptionBreakpointsForSession(sessionId, data) {
1132
+ if (data) {
1133
+ let didChangeBreakpoints = false;
1134
+ data.forEach(d => {
1135
+ let ebp = this.exceptionBreakpoints.filter((exbp) => exbp.matches(d)).pop();
1136
+ if (!ebp) {
1137
+ didChangeBreakpoints = true;
1138
+ ebp = ( new ExceptionBreakpoint(
1139
+ d.filter,
1140
+ d.label,
1141
+ !!d.default,
1142
+ !!d.supportsCondition,
1143
+ undefined ,
1144
+ d.description,
1145
+ d.conditionDescription
1146
+ ));
1147
+ this.exceptionBreakpoints.push(ebp);
1148
+ }
1149
+ ebp.setSupportedSession(sessionId, true);
1150
+ });
1151
+ if (didChangeBreakpoints) {
1152
+ this._onDidChangeBreakpoints.fire(undefined);
1153
+ }
1154
+ }
1155
+ }
1156
+ removeExceptionBreakpointsForSession(sessionId) {
1157
+ this.exceptionBreakpoints.forEach(ebp => ebp.setSupportedSession(sessionId, false));
1158
+ }
1159
+ setExceptionBreakpointFallbackSession(sessionId) {
1160
+ this.exceptionBreakpoints.forEach(ebp => ebp.setFallback(ebp.isSupportedSession(sessionId)));
1161
+ }
1162
+ setExceptionBreakpointCondition(exceptionBreakpoint, condition) {
1163
+ exceptionBreakpoint.condition = condition;
1164
+ this._onDidChangeBreakpoints.fire(undefined);
1165
+ }
1166
+ areBreakpointsActivated() {
1167
+ return this.breakpointsActivated;
1168
+ }
1169
+ setBreakpointsActivated(activated) {
1170
+ this.breakpointsActivated = activated;
1171
+ this._onDidChangeBreakpoints.fire(undefined);
1172
+ }
1173
+ addBreakpoints(uri, rawData, fireEvent = true) {
1174
+ const newBreakpoints = ( rawData.map(rawBp => ( new Breakpoint(
1175
+ uri,
1176
+ rawBp.lineNumber,
1177
+ rawBp.column,
1178
+ rawBp.enabled === false ? false : true,
1179
+ rawBp.condition,
1180
+ rawBp.hitCondition,
1181
+ rawBp.logMessage,
1182
+ undefined,
1183
+ this.textFileService,
1184
+ this.uriIdentityService,
1185
+ this.logService,
1186
+ rawBp.id
1187
+ ))));
1188
+ this.breakpoints = this.breakpoints.concat(newBreakpoints);
1189
+ this.breakpointsActivated = true;
1190
+ this.sortAndDeDup();
1191
+ if (fireEvent) {
1192
+ this._onDidChangeBreakpoints.fire({ added: newBreakpoints, sessionOnly: false });
1193
+ }
1194
+ return newBreakpoints;
1195
+ }
1196
+ removeBreakpoints(toRemove) {
1197
+ this.breakpoints = this.breakpoints.filter(bp => !( toRemove.some(toRemove => toRemove.getId() === bp.getId())));
1198
+ this._onDidChangeBreakpoints.fire({ removed: toRemove, sessionOnly: false });
1199
+ }
1200
+ updateBreakpoints(data) {
1201
+ const updated = [];
1202
+ this.breakpoints.forEach(bp => {
1203
+ const bpData = data.get(bp.getId());
1204
+ if (bpData) {
1205
+ bp.update(bpData);
1206
+ updated.push(bp);
1207
+ }
1208
+ });
1209
+ this.sortAndDeDup();
1210
+ this._onDidChangeBreakpoints.fire({ changed: updated, sessionOnly: false });
1211
+ }
1212
+ setBreakpointSessionData(sessionId, capabilites, data) {
1213
+ this.breakpoints.forEach(bp => {
1214
+ if (!data) {
1215
+ bp.setSessionData(sessionId, undefined);
1216
+ }
1217
+ else {
1218
+ const bpData = data.get(bp.getId());
1219
+ if (bpData) {
1220
+ bp.setSessionData(sessionId, toBreakpointSessionData(bpData, capabilites));
1221
+ }
1222
+ }
1223
+ });
1224
+ this.functionBreakpoints.forEach(fbp => {
1225
+ if (!data) {
1226
+ fbp.setSessionData(sessionId, undefined);
1227
+ }
1228
+ else {
1229
+ const fbpData = data.get(fbp.getId());
1230
+ if (fbpData) {
1231
+ fbp.setSessionData(sessionId, toBreakpointSessionData(fbpData, capabilites));
1232
+ }
1233
+ }
1234
+ });
1235
+ this.dataBreakpoints.forEach(dbp => {
1236
+ if (!data) {
1237
+ dbp.setSessionData(sessionId, undefined);
1238
+ }
1239
+ else {
1240
+ const dbpData = data.get(dbp.getId());
1241
+ if (dbpData) {
1242
+ dbp.setSessionData(sessionId, toBreakpointSessionData(dbpData, capabilites));
1243
+ }
1244
+ }
1245
+ });
1246
+ this.exceptionBreakpoints.forEach(ebp => {
1247
+ if (!data) {
1248
+ ebp.setSessionData(sessionId, undefined);
1249
+ }
1250
+ else {
1251
+ const ebpData = data.get(ebp.getId());
1252
+ if (ebpData) {
1253
+ ebp.setSessionData(sessionId, toBreakpointSessionData(ebpData, capabilites));
1254
+ }
1255
+ }
1256
+ });
1257
+ this.instructionBreakpoints.forEach(ibp => {
1258
+ if (!data) {
1259
+ ibp.setSessionData(sessionId, undefined);
1260
+ }
1261
+ else {
1262
+ const ibpData = data.get(ibp.getId());
1263
+ if (ibpData) {
1264
+ ibp.setSessionData(sessionId, toBreakpointSessionData(ibpData, capabilites));
1265
+ }
1266
+ }
1267
+ });
1268
+ this._onDidChangeBreakpoints.fire({
1269
+ sessionOnly: true
1270
+ });
1271
+ }
1272
+ getDebugProtocolBreakpoint(breakpointId, sessionId) {
1273
+ const bp = this.breakpoints.find(bp => bp.getId() === breakpointId);
1274
+ if (bp) {
1275
+ return bp.getDebugProtocolBreakpoint(sessionId);
1276
+ }
1277
+ return undefined;
1278
+ }
1279
+ sortAndDeDup() {
1280
+ this.breakpoints = this.breakpoints.sort((first, second) => {
1281
+ if (( first.uri.toString()) !== ( second.uri.toString())) {
1282
+ return resources.basenameOrAuthority(first.uri).localeCompare(resources.basenameOrAuthority(second.uri));
1283
+ }
1284
+ if (first.lineNumber === second.lineNumber) {
1285
+ if (first.column && second.column) {
1286
+ return first.column - second.column;
1287
+ }
1288
+ return 1;
1289
+ }
1290
+ return first.lineNumber - second.lineNumber;
1291
+ });
1292
+ this.breakpoints = distinct(this.breakpoints, bp => `${( bp.uri.toString())}:${bp.lineNumber}:${bp.column}`);
1293
+ }
1294
+ setEnablement(element, enable) {
1295
+ if (element instanceof Breakpoint || element instanceof FunctionBreakpoint || element instanceof ExceptionBreakpoint || element instanceof DataBreakpoint || element instanceof InstructionBreakpoint) {
1296
+ const changed = [];
1297
+ if (element.enabled !== enable && (element instanceof Breakpoint || element instanceof FunctionBreakpoint || element instanceof DataBreakpoint || element instanceof InstructionBreakpoint)) {
1298
+ changed.push(element);
1299
+ }
1300
+ element.enabled = enable;
1301
+ if (enable) {
1302
+ this.breakpointsActivated = true;
1303
+ }
1304
+ this._onDidChangeBreakpoints.fire({ changed: changed, sessionOnly: false });
1305
+ }
1306
+ }
1307
+ enableOrDisableAllBreakpoints(enable) {
1308
+ const changed = [];
1309
+ this.breakpoints.forEach(bp => {
1310
+ if (bp.enabled !== enable) {
1311
+ changed.push(bp);
1312
+ }
1313
+ bp.enabled = enable;
1314
+ });
1315
+ this.functionBreakpoints.forEach(fbp => {
1316
+ if (fbp.enabled !== enable) {
1317
+ changed.push(fbp);
1318
+ }
1319
+ fbp.enabled = enable;
1320
+ });
1321
+ this.dataBreakpoints.forEach(dbp => {
1322
+ if (dbp.enabled !== enable) {
1323
+ changed.push(dbp);
1324
+ }
1325
+ dbp.enabled = enable;
1326
+ });
1327
+ this.instructionBreakpoints.forEach(ibp => {
1328
+ if (ibp.enabled !== enable) {
1329
+ changed.push(ibp);
1330
+ }
1331
+ ibp.enabled = enable;
1332
+ });
1333
+ if (enable) {
1334
+ this.breakpointsActivated = true;
1335
+ }
1336
+ this._onDidChangeBreakpoints.fire({ changed: changed, sessionOnly: false });
1337
+ }
1338
+ addFunctionBreakpoint(functionName, id) {
1339
+ const newFunctionBreakpoint = ( new FunctionBreakpoint(functionName, true, undefined, undefined, undefined, id));
1340
+ this.functionBreakpoints.push(newFunctionBreakpoint);
1341
+ this._onDidChangeBreakpoints.fire({ added: [newFunctionBreakpoint], sessionOnly: false });
1342
+ return newFunctionBreakpoint;
1343
+ }
1344
+ updateFunctionBreakpoint(id, update) {
1345
+ const functionBreakpoint = this.functionBreakpoints.find(fbp => fbp.getId() === id);
1346
+ if (functionBreakpoint) {
1347
+ if (typeof update.name === 'string') {
1348
+ functionBreakpoint.name = update.name;
1349
+ }
1350
+ if (typeof update.condition === 'string') {
1351
+ functionBreakpoint.condition = update.condition;
1352
+ }
1353
+ if (typeof update.hitCondition === 'string') {
1354
+ functionBreakpoint.hitCondition = update.hitCondition;
1355
+ }
1356
+ this._onDidChangeBreakpoints.fire({ changed: [functionBreakpoint], sessionOnly: false });
1357
+ }
1358
+ }
1359
+ removeFunctionBreakpoints(id) {
1360
+ let removed;
1361
+ if (id) {
1362
+ removed = this.functionBreakpoints.filter(fbp => fbp.getId() === id);
1363
+ this.functionBreakpoints = this.functionBreakpoints.filter(fbp => fbp.getId() !== id);
1364
+ }
1365
+ else {
1366
+ removed = this.functionBreakpoints;
1367
+ this.functionBreakpoints = [];
1368
+ }
1369
+ this._onDidChangeBreakpoints.fire({ removed, sessionOnly: false });
1370
+ }
1371
+ addDataBreakpoint(label, dataId, canPersist, accessTypes, accessType, id) {
1372
+ const newDataBreakpoint = ( new DataBreakpoint(
1373
+ label,
1374
+ dataId,
1375
+ canPersist,
1376
+ true,
1377
+ undefined,
1378
+ undefined,
1379
+ undefined,
1380
+ accessTypes,
1381
+ accessType,
1382
+ id
1383
+ ));
1384
+ this.dataBreakpoints.push(newDataBreakpoint);
1385
+ this._onDidChangeBreakpoints.fire({ added: [newDataBreakpoint], sessionOnly: false });
1386
+ }
1387
+ updateDataBreakpoint(id, update) {
1388
+ const dataBreakpoint = this.dataBreakpoints.find(fbp => fbp.getId() === id);
1389
+ if (dataBreakpoint) {
1390
+ if (typeof update.condition === 'string') {
1391
+ dataBreakpoint.condition = update.condition;
1392
+ }
1393
+ if (typeof update.hitCondition === 'string') {
1394
+ dataBreakpoint.hitCondition = update.hitCondition;
1395
+ }
1396
+ this._onDidChangeBreakpoints.fire({ changed: [dataBreakpoint], sessionOnly: false });
1397
+ }
1398
+ }
1399
+ removeDataBreakpoints(id) {
1400
+ let removed;
1401
+ if (id) {
1402
+ removed = this.dataBreakpoints.filter(fbp => fbp.getId() === id);
1403
+ this.dataBreakpoints = this.dataBreakpoints.filter(fbp => fbp.getId() !== id);
1404
+ }
1405
+ else {
1406
+ removed = this.dataBreakpoints;
1407
+ this.dataBreakpoints = [];
1408
+ }
1409
+ this._onDidChangeBreakpoints.fire({ removed, sessionOnly: false });
1410
+ }
1411
+ addInstructionBreakpoint(instructionReference, offset, address, condition, hitCondition) {
1412
+ const newInstructionBreakpoint = ( new InstructionBreakpoint(
1413
+ instructionReference,
1414
+ offset,
1415
+ false,
1416
+ true,
1417
+ hitCondition,
1418
+ condition,
1419
+ undefined,
1420
+ address
1421
+ ));
1422
+ this.instructionBreakpoints.push(newInstructionBreakpoint);
1423
+ this._onDidChangeBreakpoints.fire({ added: [newInstructionBreakpoint], sessionOnly: true });
1424
+ }
1425
+ removeInstructionBreakpoints(instructionReference, offset) {
1426
+ let removed = [];
1427
+ if (instructionReference) {
1428
+ for (let i = 0; i < this.instructionBreakpoints.length; i++) {
1429
+ const ibp = this.instructionBreakpoints[i];
1430
+ if (ibp.instructionReference === instructionReference && (offset === undefined || ibp.offset === offset)) {
1431
+ removed.push(ibp);
1432
+ this.instructionBreakpoints.splice(i--, 1);
1433
+ }
1434
+ }
1435
+ }
1436
+ else {
1437
+ removed = this.instructionBreakpoints;
1438
+ this.instructionBreakpoints = [];
1439
+ }
1440
+ this._onDidChangeBreakpoints.fire({ removed, sessionOnly: false });
1441
+ }
1442
+ getWatchExpressions() {
1443
+ return this.watchExpressions;
1444
+ }
1445
+ addWatchExpression(name) {
1446
+ const we = ( new Expression(name || ''));
1447
+ this.watchExpressions.push(we);
1448
+ this._onDidChangeWatchExpressions.fire(we);
1449
+ return we;
1450
+ }
1451
+ renameWatchExpression(id, newName) {
1452
+ const filtered = this.watchExpressions.filter(we => we.getId() === id);
1453
+ if (filtered.length === 1) {
1454
+ filtered[0].name = newName;
1455
+ this._onDidChangeWatchExpressions.fire(filtered[0]);
1456
+ }
1457
+ }
1458
+ removeWatchExpressions(id = null) {
1459
+ this.watchExpressions = id ? this.watchExpressions.filter(we => we.getId() !== id) : [];
1460
+ this._onDidChangeWatchExpressions.fire(undefined);
1461
+ }
1462
+ moveWatchExpression(id, position) {
1463
+ const we = this.watchExpressions.find(we => we.getId() === id);
1464
+ if (we) {
1465
+ this.watchExpressions = this.watchExpressions.filter(we => we.getId() !== id);
1466
+ this.watchExpressions = this.watchExpressions.slice(0, position).concat(we, this.watchExpressions.slice(position));
1467
+ this._onDidChangeWatchExpressions.fire(undefined);
1468
+ }
1469
+ }
1470
+ sourceIsNotAvailable(uri) {
1471
+ this.sessions.forEach(s => {
1472
+ const source = s.getSourceForUri(uri);
1473
+ if (source) {
1474
+ source.available = false;
1475
+ }
1476
+ });
1477
+ this._onDidChangeCallStack.fire(undefined);
1478
+ }
1479
+ };
1480
+ DebugModel = ( __decorate([
1481
+ ( __param(1, ITextFileService)),
1482
+ ( __param(2, IUriIdentityService)),
1483
+ ( __param(3, ILogService))
1484
+ ], DebugModel));
1485
+ export { BaseBreakpoint, Breakpoint, DataBreakpoint, DebugModel, Enablement, ErrorScope, ExceptionBreakpoint, Expression, ExpressionContainer, FunctionBreakpoint, InstructionBreakpoint, MemoryRegion, Scope, StackFrame, Thread, ThreadAndSessionIds, Variable, getUriForDebugMemory };