@codingame/monaco-vscode-api 1.83.15 → 1.85.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/README.md +430 -0
  2. package/api.js +13 -7
  3. package/assets/clear.mp3 +0 -0
  4. package/assets/format.mp3 +0 -0
  5. package/assets/save.mp3 +0 -0
  6. package/contributions.js +3 -0
  7. package/extensions.d.ts +13 -3
  8. package/external/{xterm-addon-image/typings/xterm-addon-image.d.ts → @xterm/addon-image/typings/addon-image.d.ts} +1 -1
  9. package/external/{xterm → @xterm/xterm}/typings/xterm.d.ts +13 -1
  10. package/lifecycle.js +2 -2
  11. package/localExtensionHost.js +6 -3
  12. package/missing-services.js +170 -22
  13. package/monaco-editor-treemending.patch +6884 -18018
  14. package/monaco-treemending.js +2 -2
  15. package/package.json +7 -7
  16. package/service-override/tools/editor.d.ts +8 -8
  17. package/service-override/tools/editor.js +44 -19
  18. package/services.d.ts +2 -2
  19. package/services.js +3 -3
  20. package/vscode/src/vs/base/browser/broadcast.js +6 -5
  21. package/vscode/src/vs/base/browser/dnd.d.ts +6 -0
  22. package/vscode/src/vs/base/browser/mouseEvent.d.ts +1 -1
  23. package/vscode/src/vs/base/browser/touch.d.ts +10 -0
  24. package/vscode/src/vs/base/browser/ui/actionbar/actionbar.d.ts +1 -0
  25. package/vscode/src/vs/base/browser/ui/iconLabel/iconHoverDelegate.d.ts +22 -15
  26. package/vscode/src/vs/base/browser/ui/menu/menubar.js +4 -3
  27. package/vscode/src/vs/base/browser/ui/splitview/paneview.css.js +1 -1
  28. package/vscode/src/vs/base/browser/ui/splitview/paneview.d.ts +3 -0
  29. package/vscode/src/vs/base/browser/ui/splitview/paneview.js +34 -11
  30. package/vscode/src/vs/base/common/actions.d.ts +1 -15
  31. package/vscode/src/vs/base/common/async.d.ts +1 -31
  32. package/vscode/src/vs/base/common/event.d.ts +2 -1
  33. package/vscode/src/vs/base/common/observableInternal/base.d.ts +23 -10
  34. package/vscode/src/vs/base/common/prefixTree.js +140 -0
  35. package/vscode/src/vs/base/common/product.d.ts +16 -2
  36. package/vscode/src/vs/base/common/resourceTree.js +135 -0
  37. package/vscode/src/vs/base/common/skipList.js +1 -0
  38. package/vscode/src/vs/base/common/tfIdf.js +137 -0
  39. package/vscode/src/vs/base/common/types.d.ts +13 -1
  40. package/vscode/src/vs/base/common/verifier.js +62 -0
  41. package/vscode/src/vs/editor/browser/editorBrowser.d.ts +4 -2
  42. package/vscode/src/vs/editor/common/config/editorOptions.d.ts +23 -4
  43. package/vscode/src/vs/editor/common/core/lineRange.d.ts +1 -0
  44. package/vscode/src/vs/editor/common/core/offsetRange.d.ts +3 -0
  45. package/vscode/src/vs/editor/common/core/position.d.ts +1 -0
  46. package/vscode/src/vs/editor/common/editorCommon.d.ts +2 -1
  47. package/vscode/src/vs/editor/common/languages.d.ts +23 -1
  48. package/vscode/src/vs/editor/common/services/languageFeatures.d.ts +2 -1
  49. package/vscode/src/vs/editor/common/services/resolverService.d.ts +11 -2
  50. package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +16 -1
  51. package/vscode/src/vs/platform/action/common/action.d.ts +8 -0
  52. package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +4 -0
  53. package/vscode/src/vs/platform/actions/browser/floatingMenu.js +26 -2
  54. package/vscode/src/vs/platform/actions/common/actions.d.ts +8 -0
  55. package/vscode/src/vs/platform/audioCues/browser/audioCueService.d.ts +6 -0
  56. package/vscode/src/vs/platform/commands/common/commands.d.ts +13 -5
  57. package/vscode/src/vs/platform/dialogs/common/dialogs.d.ts +9 -3
  58. package/vscode/src/vs/platform/dialogs/common/dialogs.js +5 -2
  59. package/vscode/src/vs/platform/editor/common/editor.d.ts +3 -15
  60. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +1 -0
  61. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +3 -15
  62. package/vscode/src/vs/platform/extensionManagement/common/implicitActivationEvents.js +5 -0
  63. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +0 -1
  64. package/vscode/src/vs/platform/files/common/files.d.ts +72 -8
  65. package/vscode/src/vs/platform/files/common/watcher.js +77 -0
  66. package/vscode/src/vs/platform/keybinding/common/keybindingsRegistry.d.ts +2 -2
  67. package/vscode/src/vs/platform/layout/browser/layoutService.d.ts +52 -21
  68. package/vscode/src/vs/platform/request/browser/requestService.js +3 -0
  69. package/vscode/src/vs/platform/request/common/requestIpc.js +17 -0
  70. package/vscode/src/vs/platform/storage/common/storage.js +2 -2
  71. package/vscode/src/vs/platform/telemetry/common/telemetry.d.ts +1 -0
  72. package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +41 -0
  73. package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +12 -7
  74. package/vscode/src/vs/platform/terminal/common/capabilities/{commandDetectionCapability.d.ts → commandDetection/terminalCommand.d.ts} +3 -2
  75. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.js +257 -0
  76. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +651 -0
  77. package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +29 -0
  78. package/vscode/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +48 -0
  79. package/vscode/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +94 -0
  80. package/vscode/src/vs/platform/terminal/common/terminalEnvironment.js +37 -0
  81. package/vscode/src/vs/platform/terminal/common/terminalStrings.js +16 -0
  82. package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +319 -0
  83. package/vscode/src/vs/platform/window/common/window.d.ts +9 -2
  84. package/vscode/src/vs/platform/window/common/window.js +6 -1
  85. package/vscode/src/vs/platform/workspaces/common/workspaces.d.ts +2 -43
  86. package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +113 -81
  87. package/vscode/src/vs/workbench/api/common/extHost.protocol.js +5 -4
  88. package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +25 -3
  89. package/vscode/src/vs/workbench/api/common/extHostChat.js +13 -163
  90. package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +412 -0
  91. package/vscode/src/vs/workbench/api/common/extHostChatProvider.js +79 -11
  92. package/vscode/src/vs/workbench/api/common/extHostCommands.js +13 -12
  93. package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -1
  94. package/vscode/src/vs/workbench/api/common/extHostEditorTabs.js +8 -6
  95. package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +1 -1
  96. package/vscode/src/vs/workbench/api/common/extHostFileSystemEventService.js +36 -19
  97. package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +52 -31
  98. package/vscode/src/vs/workbench/api/common/extHostIssueReporter.js +38 -0
  99. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +28 -3
  100. package/vscode/src/vs/workbench/api/common/extHostLanguages.js +10 -0
  101. package/vscode/src/vs/workbench/api/common/extHostNotebook.js +117 -2
  102. package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +32 -4
  103. package/vscode/src/vs/workbench/api/common/extHostSCM.js +85 -23
  104. package/vscode/src/vs/workbench/api/common/extHostSearch.js +3 -0
  105. package/vscode/src/vs/workbench/api/common/extHostSpeech.js +42 -0
  106. package/vscode/src/vs/workbench/api/common/extHostTask.js +2 -1
  107. package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -0
  108. package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +3 -3
  109. package/vscode/src/vs/workbench/api/common/extHostTesting.js +97 -47
  110. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +115 -16
  111. package/vscode/src/vs/workbench/api/common/extHostTypes.js +66 -36
  112. package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +6 -1
  113. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +182 -75
  114. package/vscode/src/vs/workbench/browser/actions/windowActions.js +176 -4
  115. package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +143 -2
  116. package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +237 -0
  117. package/vscode/src/vs/workbench/browser/composite.d.ts +0 -4
  118. package/vscode/src/vs/workbench/browser/composite.js +5 -4
  119. package/vscode/src/vs/workbench/browser/dnd.js +72 -23
  120. package/vscode/src/vs/workbench/browser/labels.js +7 -3
  121. package/vscode/src/vs/workbench/browser/media/part.css.js +1 -1
  122. package/vscode/src/vs/workbench/browser/panecomposite.d.ts +2 -2
  123. package/vscode/src/vs/workbench/browser/panecomposite.js +2 -0
  124. package/vscode/src/vs/workbench/browser/part.js +33 -2
  125. package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +99 -117
  126. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +173 -33
  127. package/vscode/src/vs/workbench/browser/parts/editor/editor.js +102 -6
  128. package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +256 -17
  129. package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +4 -0
  130. package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +68 -35
  131. package/vscode/src/vs/workbench/browser/parts/editor/editorPlaceholder.js +5 -5
  132. package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +35 -16
  133. package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +348 -0
  134. package/vscode/src/vs/workbench/browser/parts/editor/editorsObserver.js +43 -31
  135. package/vscode/src/vs/workbench/browser/parts/editor/media/editortabscontrol.css.js +4 -0
  136. package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -0
  137. package/vscode/src/vs/workbench/browser/parts/editor/textCodeEditor.js +1 -0
  138. package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +14 -2
  139. package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +4 -4
  140. package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +277 -0
  141. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +5 -2
  142. package/vscode/src/vs/workbench/browser/parts/panel/media/panelpart.css.js +1 -1
  143. package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +3 -38
  144. package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.d.ts +54 -52
  145. package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +2 -1
  146. package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.d.ts +25 -0
  147. package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +258 -0
  148. package/vscode/src/vs/workbench/browser/parts/views/media/paneviewlet.css.js +1 -1
  149. package/vscode/src/vs/workbench/browser/parts/views/viewPane.d.ts +2 -5
  150. package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +157 -117
  151. package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +50 -23
  152. package/vscode/src/vs/workbench/browser/parts/views/viewsService.js +26 -11
  153. package/vscode/src/vs/workbench/browser/parts/views/viewsViewlet.js +10 -6
  154. package/vscode/src/vs/workbench/browser/style.js +2 -1
  155. package/vscode/src/vs/workbench/browser/web.api.d.ts +39 -2
  156. package/vscode/src/vs/workbench/browser/window.js +55 -0
  157. package/vscode/src/vs/workbench/browser/workbench.contribution.js +220 -40
  158. package/vscode/src/vs/workbench/common/activity.js +3 -0
  159. package/vscode/src/vs/workbench/common/contextkeys.js +35 -5
  160. package/vscode/src/vs/workbench/common/contributions.js +4 -3
  161. package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +14 -4
  162. package/vscode/src/vs/workbench/common/editor/diffEditorModel.js +1 -1
  163. package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +22 -19
  164. package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +4 -3
  165. package/vscode/src/vs/workbench/common/editor/editorModel.d.ts +1 -2
  166. package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +22 -4
  167. package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.js +3 -3
  168. package/vscode/src/vs/workbench/common/editor.d.ts +60 -30
  169. package/vscode/src/vs/workbench/common/editor.js +11 -3
  170. package/vscode/src/vs/workbench/common/theme.js +2 -2
  171. package/vscode/src/vs/workbench/common/views.d.ts +4 -4
  172. package/vscode/src/vs/workbench/common/views.js +3 -1
  173. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +97 -8
  174. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +17 -99
  175. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +103 -37
  176. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +2 -3
  177. package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +127 -0
  178. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +71 -0
  179. package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +2 -1
  180. package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +33 -110
  181. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +64 -0
  182. package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +94 -0
  183. package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +6 -1
  184. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +1 -88
  185. package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +4 -4
  186. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -2
  187. package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +3 -1
  188. package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +15 -16
  189. package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +91 -1
  190. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +9 -3
  191. package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +3 -1
  192. package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +2 -3
  193. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +1 -0
  194. package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +9 -1
  195. package/vscode/src/vs/workbench/contrib/debug/common/debug.js +10 -1
  196. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +114 -22
  197. package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +1 -1
  198. package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +4 -1
  199. package/vscode/src/vs/workbench/contrib/files/browser/explorerFileContrib.js +19 -0
  200. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +10 -8
  201. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +62 -10
  202. package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +2 -1
  203. package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +9 -8
  204. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +10 -1
  205. package/vscode/src/vs/workbench/contrib/files/browser/files.d.ts +1 -0
  206. package/vscode/src/vs/workbench/contrib/files/browser/files.js +7 -3
  207. package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +4 -4
  208. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +64 -36
  209. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +42 -17
  210. package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +145 -25
  211. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +423 -0
  212. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +82 -0
  213. package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
  214. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +36 -0
  215. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +3 -1
  216. package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +24 -3
  217. package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +11 -6
  218. package/vscode/src/vs/workbench/contrib/scm/common/scm.js +1 -2
  219. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/searchNotebookHelpers.js +31 -0
  220. package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +61 -41
  221. package/vscode/src/vs/workbench/contrib/search/{browser/searchNotebookHelpers.js → common/cellSearchModel.js} +4 -63
  222. package/vscode/src/vs/workbench/contrib/search/common/searchNotebookHelpers.js +40 -0
  223. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +2 -2
  224. package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +3 -0
  225. package/vscode/src/vs/workbench/contrib/terminal/browser/detachedTerminal.js +92 -0
  226. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +100 -79
  227. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.d.ts +3 -3
  228. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +1 -1
  229. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +25 -0
  230. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcon.js +7 -4
  231. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +64 -0
  232. package/vscode/src/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +36 -0
  233. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +540 -0
  234. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +104 -0
  235. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +518 -0
  236. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +390 -0
  237. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +17 -11
  238. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +814 -0
  239. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm-private.d.ts +5 -2
  240. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +2 -8
  241. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -0
  242. package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +101 -0
  243. package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +30 -0
  244. package/vscode/src/vs/workbench/contrib/testing/common/storedValue.js +36 -0
  245. package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +115 -0
  246. package/vscode/src/vs/workbench/contrib/testing/common/testCoverageService.js +74 -0
  247. package/vscode/src/vs/workbench/contrib/testing/common/testExplorerFilterState.js +116 -0
  248. package/vscode/src/vs/workbench/contrib/testing/common/testProfileService.js +172 -1
  249. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +384 -0
  250. package/vscode/src/vs/workbench/contrib/testing/common/testResultService.js +156 -1
  251. package/vscode/src/vs/workbench/contrib/testing/common/testResultStorage.js +156 -0
  252. package/vscode/src/vs/workbench/contrib/testing/common/testService.js +75 -1
  253. package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +72 -1
  254. package/vscode/src/vs/workbench/contrib/testing/common/testingContextKeys.js +188 -0
  255. package/vscode/src/vs/workbench/contrib/testing/common/testingContinuousRunService.js +102 -0
  256. package/vscode/src/vs/workbench/contrib/testing/common/testingDecorations.js +29 -0
  257. package/vscode/src/vs/workbench/{services/editor/browser/editorDropService.js → contrib/testing/common/testingPeekOpener.js} +2 -2
  258. package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +47 -0
  259. package/vscode/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.js +4 -3
  260. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +8 -9
  261. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput.js +1 -1
  262. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewIconManager.js +5 -2
  263. package/vscode/src/vs/workbench/services/activity/browser/activityService.d.ts +16 -10
  264. package/vscode/src/vs/workbench/services/activity/common/activity.d.ts +14 -1
  265. package/vscode/src/vs/workbench/services/activity/common/activity.js +1 -7
  266. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +9 -28
  267. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +273 -0
  268. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolver.js +1 -0
  269. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +2 -0
  270. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +2 -3
  271. package/vscode/src/vs/workbench/services/editor/browser/editorService.d.ts +7 -5
  272. package/vscode/src/vs/workbench/services/editor/browser/editorService.js +59 -37
  273. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +193 -94
  274. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.js +2 -2
  275. package/vscode/src/vs/workbench/services/editor/common/editorResolverService.d.ts +8 -2
  276. package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +8 -1
  277. package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +62 -16
  278. package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +5 -3
  279. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +3 -2
  280. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +4 -9
  281. package/vscode/src/vs/workbench/services/extensions/common/{extensionHostManager.d.ts → extensionHostManagers.d.ts} +2 -0
  282. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.d.ts +1 -1
  283. package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +9 -0
  284. package/vscode/src/vs/workbench/services/extensions/common/extensions.js +22 -0
  285. package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +14 -3
  286. package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +9 -0
  287. package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +3 -3
  288. package/vscode/src/vs/workbench/services/history/common/history.d.ts +2 -2
  289. package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +49 -18
  290. package/vscode/src/vs/workbench/services/host/browser/host.d.ts +29 -7
  291. package/vscode/src/vs/workbench/services/hover/browser/hover.d.ts +51 -28
  292. package/vscode/src/vs/workbench/services/hover/browser/hoverService.d.ts +5 -2
  293. package/vscode/src/vs/workbench/services/keybinding/browser/unboundCommands.js +2 -2
  294. package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.d.ts +4 -1
  295. package/vscode/src/vs/workbench/services/layout/browser/layoutService.d.ts +40 -36
  296. package/vscode/src/vs/workbench/services/panecomposite/browser/panecomposite.d.ts +0 -6
  297. package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +3 -0
  298. package/vscode/src/vs/workbench/services/progress/browser/progressIndicator.js +2 -2
  299. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +16 -1
  300. package/vscode/src/vs/workbench/services/request/browser/requestService.js +48 -0
  301. package/vscode/src/vs/workbench/services/search/common/searchHelpers.js +4 -4
  302. package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.d.ts +10 -51
  303. package/vscode/src/vs/workbench/services/suggest/browser/media/suggest.css.js +4 -0
  304. package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.js +10 -0
  305. package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.js +98 -0
  306. package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +428 -0
  307. package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +83 -0
  308. package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +32 -1
  309. package/vscode/src/vs/workbench/services/textfile/common/textEditorService.js +1 -5
  310. package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +4 -3
  311. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +9 -3
  312. package/vscode/src/vs/workbench/services/title/browser/titleService.d.ts +18 -0
  313. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorInput.js +18 -3
  314. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorModel.js +16 -7
  315. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.d.ts +6 -0
  316. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +13 -0
  317. package/vscode/src/vs/workbench/services/url/browser/urlService.js +2 -1
  318. package/vscode/src/vs/workbench/services/userActivity/common/userActivityService.js +2 -2
  319. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +9 -0
  320. package/vscode-dts/vscode.proposed.chatAgents2.d.ts +375 -0
  321. package/vscode-dts/vscode.proposed.chatAgents2Additions.d.ts +80 -0
  322. package/vscode-dts/vscode.proposed.chatProvider.d.ts +5 -1
  323. package/vscode-dts/vscode.proposed.chatRequestAccess.d.ts +68 -10
  324. package/vscode-dts/vscode.proposed.chatTab.d.ts +21 -0
  325. package/vscode-dts/vscode.proposed.chatVariables.d.ts +5 -1
  326. package/vscode-dts/vscode.proposed.codeActionAI.d.ts +16 -0
  327. package/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts +7 -0
  328. package/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts +51 -0
  329. package/vscode-dts/vscode.proposed.defaultChatAgent.d.ts +30 -0
  330. package/vscode-dts/vscode.proposed.handleIssueUri.d.ts +26 -0
  331. package/vscode-dts/vscode.proposed.interactive.d.ts +26 -100
  332. package/vscode-dts/vscode.proposed.interactiveUserActions.d.ts +14 -7
  333. package/vscode-dts/vscode.proposed.languageStatusText.d.ts +12 -0
  334. package/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts +63 -0
  335. package/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts +43 -0
  336. package/vscode-dts/vscode.proposed.resolvers.d.ts +100 -1
  337. package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +9 -1
  338. package/vscode-dts/vscode.proposed.scmInputBoxActionButton.d.ts +19 -0
  339. package/vscode-dts/vscode.proposed.scmInputBoxValueProvider.d.ts +25 -0
  340. package/vscode-dts/vscode.proposed.speech.d.ts +35 -0
  341. package/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts +11 -7
  342. package/vscode-dts/vscode.proposed.testCoverage.d.ts +6 -1
  343. package/vscode-dts/vscode.proposed.testingActiveProfile.d.ts +21 -0
  344. package/external/xterm-headless/typings/xterm-headless.d.ts +0 -49
  345. package/vscode/src/vs/platform/backup/common/backup.d.ts +0 -14
  346. package/vscode/src/vs/platform/update/common/update.d.ts +0 -112
  347. package/vscode/src/vs/workbench/api/common/extHostChatAgents.js +0 -62
  348. package/vscode/src/vs/workbench/api/common/extHostChatSlashCommand.js +0 -62
  349. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +0 -56
  350. package/vscode/src/vs/workbench/services/files/common/files.js +0 -4
  351. package/vscode/src/vs/workbench/services/host/browser/browserHostService.d.ts +0 -41
  352. package/vscode/src/vs/workbench/services/title/common/titleService.d.ts +0 -31
  353. package/vscode-dts/vscode.proposed.chatAgents.d.ts +0 -39
  354. package/vscode-dts/vscode.proposed.chatSlashCommands.d.ts +0 -47
  355. package/vscode-dts/vscode.proposed.testMessageContextValue.d.ts +0 -45
  356. /package/external/{xterm-addon-canvas/typings/xterm-addon-canvas.d.ts → @xterm/addon-canvas/typings/addon-canvas.d.ts} +0 -0
  357. /package/external/{xterm-addon-search/typings/xterm-addon-search.d.ts → @xterm/addon-search/typings/addon-search.d.ts} +0 -0
  358. /package/external/{xterm-addon-serialize/typings/xterm-addon-serialize.d.ts → @xterm/addon-serialize/typings/addon-serialize.d.ts} +0 -0
  359. /package/external/{xterm-addon-unicode11/typings/xterm-addon-unicode11.d.ts → @xterm/addon-unicode11/typings/addon-unicode11.d.ts} +0 -0
  360. /package/external/{xterm-addon-webgl/typings/xterm-addon-webgl.d.ts → @xterm/addon-webgl/typings/addon-webgl.d.ts} +0 -0
  361. /package/vscode/src/vs/workbench/services/title/{common → browser}/titleService.js +0 -0
@@ -0,0 +1,518 @@
1
+ import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
2
+ import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js';
3
+ import { Disposable, MutableDisposable, dispose, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
4
+ import { timeout } from 'monaco-editor/esm/vs/base/common/async.js';
5
+ import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
6
+ import { TERMINAL_OVERVIEW_RULER_CURSOR_FOREGROUND_COLOR } from '../../common/terminalColorRegistry.js';
7
+ import { getWindow } from 'monaco-editor/esm/vs/base/browser/dom.js';
8
+ var Boundary;
9
+ ( (function(Boundary) {
10
+ Boundary[Boundary["Top"] = 0] = "Top";
11
+ Boundary[Boundary["Bottom"] = 1] = "Bottom";
12
+ })(Boundary || (Boundary = {})));
13
+ let MarkNavigationAddon = class MarkNavigationAddon extends Disposable {
14
+ activate(terminal) {
15
+ this._terminal = terminal;
16
+ this._register(this._terminal.onData(() => {
17
+ this._currentMarker = Boundary.Bottom;
18
+ }));
19
+ }
20
+ constructor(_capabilities, _themeService) {
21
+ super();
22
+ this._capabilities = _capabilities;
23
+ this._themeService = _themeService;
24
+ this._currentMarker = Boundary.Bottom;
25
+ this._selectionStart = null;
26
+ this._isDisposable = false;
27
+ this._commandGuideDecorations = this._register(( new MutableDisposable()));
28
+ }
29
+ _getMarkers(skipEmptyCommands) {
30
+ const commandCapability = this._capabilities.get(2 );
31
+ const partialCommandCapability = this._capabilities.get(3 );
32
+ const markCapability = this._capabilities.get(4 );
33
+ let markers = [];
34
+ if (commandCapability) {
35
+ markers = coalesce(( commandCapability.commands.filter(e => skipEmptyCommands ? e.exitCode !== undefined : true).map(e => e.promptStartMarker ?? e.marker)));
36
+ if (commandCapability.currentCommand?.promptStartMarker && commandCapability.currentCommand.commandExecutedMarker) {
37
+ markers.push(commandCapability.currentCommand?.promptStartMarker);
38
+ }
39
+ }
40
+ else if (partialCommandCapability) {
41
+ markers.push(...partialCommandCapability.commands);
42
+ }
43
+ if (markCapability && !skipEmptyCommands) {
44
+ let next = markCapability.markers().next()?.value;
45
+ const arr = [];
46
+ while (next) {
47
+ arr.push(next);
48
+ next = markCapability.markers().next()?.value;
49
+ }
50
+ markers = arr;
51
+ }
52
+ return markers;
53
+ }
54
+ _findCommand(marker) {
55
+ const commandCapability = this._capabilities.get(2 );
56
+ if (commandCapability) {
57
+ const command = commandCapability.commands.find(e => e.marker?.line === marker.line || e.promptStartMarker?.line === marker.line);
58
+ if (command) {
59
+ return command;
60
+ }
61
+ if (commandCapability.currentCommand) {
62
+ return commandCapability.currentCommand;
63
+ }
64
+ }
65
+ return undefined;
66
+ }
67
+ clearMarker() {
68
+ this._currentMarker = Boundary.Bottom;
69
+ this._resetNavigationDecorations();
70
+ this._selectionStart = null;
71
+ }
72
+ _resetNavigationDecorations() {
73
+ if (this._navigationDecorations) {
74
+ dispose(this._navigationDecorations);
75
+ }
76
+ this._navigationDecorations = [];
77
+ }
78
+ _isEmptyCommand(marker) {
79
+ if (marker === Boundary.Bottom) {
80
+ return true;
81
+ }
82
+ if (marker === Boundary.Top) {
83
+ return !( this._getMarkers(true).map(e => e.line)).includes(0);
84
+ }
85
+ return !this._getMarkers(true).includes(marker);
86
+ }
87
+ scrollToPreviousMark(scrollPosition = 1 , retainSelection = false, skipEmptyCommands = true) {
88
+ if (!this._terminal) {
89
+ return;
90
+ }
91
+ if (!retainSelection) {
92
+ this._selectionStart = null;
93
+ }
94
+ let markerIndex;
95
+ const currentLineY = typeof this._currentMarker === 'object'
96
+ ? this.getTargetScrollLine(this._currentMarker.line, scrollPosition)
97
+ : Math.min(getLine(this._terminal, this._currentMarker), this._terminal.buffer.active.baseY);
98
+ const viewportY = this._terminal.buffer.active.viewportY;
99
+ if (typeof this._currentMarker === 'object' ? !this._isMarkerInViewport(this._terminal, this._currentMarker) : currentLineY !== viewportY) {
100
+ const markersBelowViewport = this._getMarkers(skipEmptyCommands).filter(e => e.line >= viewportY).length;
101
+ markerIndex = this._getMarkers(skipEmptyCommands).length - markersBelowViewport - 1;
102
+ }
103
+ else if (this._currentMarker === Boundary.Bottom) {
104
+ markerIndex = this._getMarkers(skipEmptyCommands).length - 1;
105
+ }
106
+ else if (this._currentMarker === Boundary.Top) {
107
+ markerIndex = -1;
108
+ }
109
+ else if (this._isDisposable) {
110
+ markerIndex = this._findPreviousMarker(skipEmptyCommands);
111
+ this._currentMarker.dispose();
112
+ this._isDisposable = false;
113
+ }
114
+ else {
115
+ if (skipEmptyCommands && this._isEmptyCommand(this._currentMarker)) {
116
+ markerIndex = this._findPreviousMarker(true);
117
+ }
118
+ else {
119
+ markerIndex = this._getMarkers(skipEmptyCommands).indexOf(this._currentMarker) - 1;
120
+ }
121
+ }
122
+ if (markerIndex < 0) {
123
+ this._currentMarker = Boundary.Top;
124
+ this._terminal.scrollToTop();
125
+ this._resetNavigationDecorations();
126
+ return;
127
+ }
128
+ this._currentMarker = this._getMarkers(skipEmptyCommands)[markerIndex];
129
+ this._scrollToCommand(this._currentMarker, scrollPosition);
130
+ }
131
+ scrollToNextMark(scrollPosition = 1 , retainSelection = false, skipEmptyCommands = true) {
132
+ if (!this._terminal) {
133
+ return;
134
+ }
135
+ if (!retainSelection) {
136
+ this._selectionStart = null;
137
+ }
138
+ let markerIndex;
139
+ const currentLineY = typeof this._currentMarker === 'object'
140
+ ? this.getTargetScrollLine(this._currentMarker.line, scrollPosition)
141
+ : Math.min(getLine(this._terminal, this._currentMarker), this._terminal.buffer.active.baseY);
142
+ const viewportY = this._terminal.buffer.active.viewportY;
143
+ if (typeof this._currentMarker === 'object' ? !this._isMarkerInViewport(this._terminal, this._currentMarker) : currentLineY !== viewportY) {
144
+ const markersAboveViewport = this._getMarkers(skipEmptyCommands).filter(e => e.line <= viewportY).length;
145
+ markerIndex = markersAboveViewport;
146
+ }
147
+ else if (this._currentMarker === Boundary.Bottom) {
148
+ markerIndex = this._getMarkers(skipEmptyCommands).length;
149
+ }
150
+ else if (this._currentMarker === Boundary.Top) {
151
+ markerIndex = 0;
152
+ }
153
+ else if (this._isDisposable) {
154
+ markerIndex = this._findNextMarker(skipEmptyCommands);
155
+ this._currentMarker.dispose();
156
+ this._isDisposable = false;
157
+ }
158
+ else {
159
+ if (skipEmptyCommands && this._isEmptyCommand(this._currentMarker)) {
160
+ markerIndex = this._findNextMarker(true);
161
+ }
162
+ else {
163
+ markerIndex = this._getMarkers(skipEmptyCommands).indexOf(this._currentMarker) + 1;
164
+ }
165
+ }
166
+ if (markerIndex >= this._getMarkers(skipEmptyCommands).length) {
167
+ this._currentMarker = Boundary.Bottom;
168
+ this._terminal.scrollToBottom();
169
+ this._resetNavigationDecorations();
170
+ return;
171
+ }
172
+ this._currentMarker = this._getMarkers(skipEmptyCommands)[markerIndex];
173
+ this._scrollToCommand(this._currentMarker, scrollPosition);
174
+ }
175
+ _scrollToCommand(marker, position) {
176
+ const command = this._findCommand(marker);
177
+ if (command) {
178
+ this.revealCommand(command, position);
179
+ }
180
+ else {
181
+ this._scrollToMarker(marker, position);
182
+ }
183
+ }
184
+ _scrollToMarker(start, position, end, hideDecoration) {
185
+ if (!this._terminal) {
186
+ return;
187
+ }
188
+ if (!this._isMarkerInViewport(this._terminal, start)) {
189
+ const line = this.getTargetScrollLine(toLineIndex(start), position);
190
+ this._terminal.scrollToLine(line);
191
+ }
192
+ if (!hideDecoration) {
193
+ this.registerTemporaryDecoration(start, end, true);
194
+ }
195
+ }
196
+ _createMarkerForOffset(marker, offset) {
197
+ if (offset === 0 && isMarker(marker)) {
198
+ return marker;
199
+ }
200
+ else {
201
+ const offsetMarker = this._terminal?.registerMarker(-this._terminal.buffer.active.cursorY + toLineIndex(marker) - this._terminal.buffer.active.baseY + offset);
202
+ if (offsetMarker) {
203
+ return offsetMarker;
204
+ }
205
+ else {
206
+ throw new Error(`Could not register marker with offset ${toLineIndex(marker)}, ${offset}`);
207
+ }
208
+ }
209
+ }
210
+ revealCommand(command, position = 1 ) {
211
+ const marker = 'getOutput' in command ? command.marker : command.commandStartMarker;
212
+ if (!this._terminal || !marker) {
213
+ return;
214
+ }
215
+ const line = toLineIndex(marker);
216
+ const promptRowCount = command.getPromptRowCount();
217
+ const commandRowCount = command.getCommandRowCount();
218
+ this._scrollToMarker(line - (promptRowCount - 1), position, line + (commandRowCount - 1));
219
+ }
220
+ showCommandGuide(command) {
221
+ if (!this._terminal) {
222
+ return;
223
+ }
224
+ if (!command) {
225
+ this._commandGuideDecorations.clear();
226
+ this._activeCommandGuide = undefined;
227
+ return;
228
+ }
229
+ if (this._activeCommandGuide === command) {
230
+ return;
231
+ }
232
+ if (command.marker) {
233
+ this._activeCommandGuide = command;
234
+ const store = this._commandGuideDecorations.value = ( new DisposableStore());
235
+ if (!command.executedMarker || !command.endMarker) {
236
+ return;
237
+ }
238
+ const startLine = command.marker.line - (command.getPromptRowCount() - 1);
239
+ const decorationCount = toLineIndex(command.endMarker) - startLine;
240
+ for (let i = 0; i < decorationCount; i++) {
241
+ const decoration = this._terminal.registerDecoration({
242
+ marker: this._createMarkerForOffset(startLine, i)
243
+ });
244
+ if (decoration) {
245
+ store.add(decoration);
246
+ let renderedElement;
247
+ store.add(decoration.onRender(element => {
248
+ if (!renderedElement) {
249
+ renderedElement = element;
250
+ element.classList.add('terminal-command-guide');
251
+ if (i === 0) {
252
+ element.classList.add('top');
253
+ }
254
+ if (i === decorationCount - 1) {
255
+ element.classList.add('bottom');
256
+ }
257
+ }
258
+ if (this._terminal?.element) {
259
+ element.style.marginLeft = `-${getWindow(this._terminal.element).getComputedStyle(this._terminal.element).paddingLeft}`;
260
+ }
261
+ }));
262
+ }
263
+ }
264
+ }
265
+ }
266
+ registerTemporaryDecoration(marker, endMarker, showOutline) {
267
+ if (!this._terminal) {
268
+ return;
269
+ }
270
+ this._resetNavigationDecorations();
271
+ const color = this._themeService.getColorTheme().getColor(TERMINAL_OVERVIEW_RULER_CURSOR_FOREGROUND_COLOR);
272
+ const startLine = toLineIndex(marker);
273
+ const decorationCount = endMarker ? toLineIndex(endMarker) - startLine + 1 : 1;
274
+ for (let i = 0; i < decorationCount; i++) {
275
+ const decoration = this._terminal.registerDecoration({
276
+ marker: this._createMarkerForOffset(marker, i),
277
+ width: this._terminal.cols,
278
+ overviewRulerOptions: i === 0 ? {
279
+ color: color?.toString() || '#a0a0a0cc'
280
+ } : undefined
281
+ });
282
+ if (decoration) {
283
+ this._navigationDecorations?.push(decoration);
284
+ let renderedElement;
285
+ decoration.onRender(element => {
286
+ if (!renderedElement) {
287
+ renderedElement = element;
288
+ element.classList.add('terminal-scroll-highlight');
289
+ if (showOutline) {
290
+ element.classList.add('terminal-scroll-highlight-outline');
291
+ }
292
+ if (i === 0) {
293
+ element.classList.add('top');
294
+ }
295
+ if (i === decorationCount - 1) {
296
+ element.classList.add('bottom');
297
+ }
298
+ }
299
+ else {
300
+ element.classList.add('terminal-scroll-highlight');
301
+ }
302
+ if (this._terminal?.element) {
303
+ element.style.marginLeft = `-${getWindow(this._terminal.element).getComputedStyle(this._terminal.element).paddingLeft}`;
304
+ }
305
+ });
306
+ decoration.onDispose(() => { this._navigationDecorations = this._navigationDecorations?.filter(d => d !== decoration); });
307
+ if (showOutline) {
308
+ timeout(350).then(() => {
309
+ if (renderedElement) {
310
+ renderedElement.classList.remove('terminal-scroll-highlight-outline');
311
+ }
312
+ });
313
+ }
314
+ }
315
+ }
316
+ }
317
+ scrollToLine(line, position) {
318
+ this._terminal?.scrollToLine(this.getTargetScrollLine(line, position));
319
+ }
320
+ getTargetScrollLine(line, position) {
321
+ if (this._terminal && position === 1 ) {
322
+ return Math.max(line - Math.floor(this._terminal.rows / 4), 0);
323
+ }
324
+ return line;
325
+ }
326
+ _isMarkerInViewport(terminal, marker) {
327
+ const viewportY = terminal.buffer.active.viewportY;
328
+ const line = toLineIndex(marker);
329
+ return line >= viewportY && line < viewportY + terminal.rows;
330
+ }
331
+ scrollToClosestMarker(startMarkerId, endMarkerId, highlight) {
332
+ const detectionCapability = this._capabilities.get(4 );
333
+ if (!detectionCapability) {
334
+ return;
335
+ }
336
+ const startMarker = detectionCapability.getMark(startMarkerId);
337
+ if (!startMarker) {
338
+ return;
339
+ }
340
+ const endMarker = endMarkerId ? detectionCapability.getMark(endMarkerId) : startMarker;
341
+ this._scrollToMarker(startMarker, 0 , endMarker, !highlight);
342
+ }
343
+ selectToPreviousMark() {
344
+ if (!this._terminal) {
345
+ return;
346
+ }
347
+ if (this._selectionStart === null) {
348
+ this._selectionStart = this._currentMarker;
349
+ }
350
+ if (( this._capabilities.has(2 ))) {
351
+ this.scrollToPreviousMark(1 , true, true);
352
+ }
353
+ else {
354
+ this.scrollToPreviousMark(1 , true, false);
355
+ }
356
+ selectLines(this._terminal, this._currentMarker, this._selectionStart);
357
+ }
358
+ selectToNextMark() {
359
+ if (!this._terminal) {
360
+ return;
361
+ }
362
+ if (this._selectionStart === null) {
363
+ this._selectionStart = this._currentMarker;
364
+ }
365
+ if (( this._capabilities.has(2 ))) {
366
+ this.scrollToNextMark(1 , true, true);
367
+ }
368
+ else {
369
+ this.scrollToNextMark(1 , true, false);
370
+ }
371
+ selectLines(this._terminal, this._currentMarker, this._selectionStart);
372
+ }
373
+ selectToPreviousLine() {
374
+ if (!this._terminal) {
375
+ return;
376
+ }
377
+ if (this._selectionStart === null) {
378
+ this._selectionStart = this._currentMarker;
379
+ }
380
+ this.scrollToPreviousLine(this._terminal, 1 , true);
381
+ selectLines(this._terminal, this._currentMarker, this._selectionStart);
382
+ }
383
+ selectToNextLine() {
384
+ if (!this._terminal) {
385
+ return;
386
+ }
387
+ if (this._selectionStart === null) {
388
+ this._selectionStart = this._currentMarker;
389
+ }
390
+ this.scrollToNextLine(this._terminal, 1 , true);
391
+ selectLines(this._terminal, this._currentMarker, this._selectionStart);
392
+ }
393
+ scrollToPreviousLine(xterm, scrollPosition = 1 , retainSelection = false) {
394
+ if (!retainSelection) {
395
+ this._selectionStart = null;
396
+ }
397
+ if (this._currentMarker === Boundary.Top) {
398
+ xterm.scrollToTop();
399
+ return;
400
+ }
401
+ if (this._currentMarker === Boundary.Bottom) {
402
+ this._currentMarker = this._registerMarkerOrThrow(xterm, this._getOffset(xterm) - 1);
403
+ }
404
+ else {
405
+ const offset = this._getOffset(xterm);
406
+ if (this._isDisposable) {
407
+ this._currentMarker.dispose();
408
+ }
409
+ this._currentMarker = this._registerMarkerOrThrow(xterm, offset - 1);
410
+ }
411
+ this._isDisposable = true;
412
+ this._scrollToMarker(this._currentMarker, scrollPosition);
413
+ }
414
+ scrollToNextLine(xterm, scrollPosition = 1 , retainSelection = false) {
415
+ if (!retainSelection) {
416
+ this._selectionStart = null;
417
+ }
418
+ if (this._currentMarker === Boundary.Bottom) {
419
+ xterm.scrollToBottom();
420
+ return;
421
+ }
422
+ if (this._currentMarker === Boundary.Top) {
423
+ this._currentMarker = this._registerMarkerOrThrow(xterm, this._getOffset(xterm) + 1);
424
+ }
425
+ else {
426
+ const offset = this._getOffset(xterm);
427
+ if (this._isDisposable) {
428
+ this._currentMarker.dispose();
429
+ }
430
+ this._currentMarker = this._registerMarkerOrThrow(xterm, offset + 1);
431
+ }
432
+ this._isDisposable = true;
433
+ this._scrollToMarker(this._currentMarker, scrollPosition);
434
+ }
435
+ _registerMarkerOrThrow(xterm, cursorYOffset) {
436
+ const marker = xterm.registerMarker(cursorYOffset);
437
+ if (!marker) {
438
+ throw new Error(`Could not create marker for ${cursorYOffset}`);
439
+ }
440
+ return marker;
441
+ }
442
+ _getOffset(xterm) {
443
+ if (this._currentMarker === Boundary.Bottom) {
444
+ return 0;
445
+ }
446
+ else if (this._currentMarker === Boundary.Top) {
447
+ return 0 - (xterm.buffer.active.baseY + xterm.buffer.active.cursorY);
448
+ }
449
+ else {
450
+ let offset = getLine(xterm, this._currentMarker);
451
+ offset -= xterm.buffer.active.baseY + xterm.buffer.active.cursorY;
452
+ return offset;
453
+ }
454
+ }
455
+ _findPreviousMarker(skipEmptyCommands = false) {
456
+ if (this._currentMarker === Boundary.Top) {
457
+ return 0;
458
+ }
459
+ else if (this._currentMarker === Boundary.Bottom) {
460
+ return this._getMarkers(skipEmptyCommands).length - 1;
461
+ }
462
+ let i;
463
+ for (i = this._getMarkers(skipEmptyCommands).length - 1; i >= 0; i--) {
464
+ if (this._getMarkers(skipEmptyCommands)[i].line < this._currentMarker.line) {
465
+ return i;
466
+ }
467
+ }
468
+ return -1;
469
+ }
470
+ _findNextMarker(skipEmptyCommands = false) {
471
+ if (this._currentMarker === Boundary.Top) {
472
+ return 0;
473
+ }
474
+ else if (this._currentMarker === Boundary.Bottom) {
475
+ return this._getMarkers(skipEmptyCommands).length - 1;
476
+ }
477
+ let i;
478
+ for (i = 0; i < this._getMarkers(skipEmptyCommands).length; i++) {
479
+ if (this._getMarkers(skipEmptyCommands)[i].line > this._currentMarker.line) {
480
+ return i;
481
+ }
482
+ }
483
+ return this._getMarkers(skipEmptyCommands).length;
484
+ }
485
+ };
486
+ MarkNavigationAddon = ( __decorate([
487
+ ( __param(1, IThemeService))
488
+ ], MarkNavigationAddon));
489
+ function getLine(xterm, marker) {
490
+ if (marker === Boundary.Bottom) {
491
+ return xterm.buffer.active.baseY + xterm.rows - 1;
492
+ }
493
+ if (marker === Boundary.Top) {
494
+ return 0;
495
+ }
496
+ return marker.line;
497
+ }
498
+ function selectLines(xterm, start, end) {
499
+ if (end === null) {
500
+ end = Boundary.Bottom;
501
+ }
502
+ let startLine = getLine(xterm, start);
503
+ let endLine = getLine(xterm, end);
504
+ if (startLine > endLine) {
505
+ const temp = startLine;
506
+ startLine = endLine;
507
+ endLine = temp;
508
+ }
509
+ endLine -= 1;
510
+ xterm.selectLines(startLine, endLine);
511
+ }
512
+ function isMarker(value) {
513
+ return typeof value !== 'number';
514
+ }
515
+ function toLineIndex(line) {
516
+ return isMarker(line) ? line.line : line;
517
+ }
518
+ export { MarkNavigationAddon, getLine, selectLines };