@opensumi/ide-debug 2.12.1-next-079c1930

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 (438) hide show
  1. package/lib/browser/assets/breakpoint-conditional-disabled.svg +4 -0
  2. package/lib/browser/assets/breakpoint-conditional-unverified.svg +4 -0
  3. package/lib/browser/assets/breakpoint-conditional.svg +4 -0
  4. package/lib/browser/assets/breakpoint-disabled.svg +4 -0
  5. package/lib/browser/assets/breakpoint-hint.svg +4 -0
  6. package/lib/browser/assets/breakpoint-log-disabled.svg +4 -0
  7. package/lib/browser/assets/breakpoint-log-unverified.svg +4 -0
  8. package/lib/browser/assets/breakpoint-log.svg +4 -0
  9. package/lib/browser/assets/breakpoint-unsupported.svg +4 -0
  10. package/lib/browser/assets/breakpoint-unverified.svg +4 -0
  11. package/lib/browser/assets/breakpoint.svg +4 -0
  12. package/lib/browser/assets/breakpoints-activate-inverse.svg +4 -0
  13. package/lib/browser/assets/breakpoints-activate.svg +4 -0
  14. package/lib/browser/assets/configure-inverse.svg +4 -0
  15. package/lib/browser/assets/configure.svg +4 -0
  16. package/lib/browser/assets/continue-inverse.svg +4 -0
  17. package/lib/browser/assets/current-and-breakpoint.svg +4 -0
  18. package/lib/browser/assets/current-arrow.svg +4 -0
  19. package/lib/browser/assets/remove-all-inverse.svg +4 -0
  20. package/lib/browser/assets/remove-all.svg +4 -0
  21. package/lib/browser/assets/repl-inverse.svg +4 -0
  22. package/lib/browser/assets/repl.svg +4 -0
  23. package/lib/browser/assets/restart-inverse.svg +4 -0
  24. package/lib/browser/assets/stackframe-and-breakpoint.svg +4 -0
  25. package/lib/browser/assets/stackframe-arrow.svg +4 -0
  26. package/lib/browser/assets/start-inverse.svg +4 -0
  27. package/lib/browser/breakpoint/breakpoint-decoration.d.ts +12 -0
  28. package/lib/browser/breakpoint/breakpoint-decoration.d.ts.map +1 -0
  29. package/lib/browser/breakpoint/breakpoint-decoration.js +53 -0
  30. package/lib/browser/breakpoint/breakpoint-decoration.js.map +1 -0
  31. package/lib/browser/breakpoint/breakpoint-manager.d.ts +87 -0
  32. package/lib/browser/breakpoint/breakpoint-manager.d.ts.map +1 -0
  33. package/lib/browser/breakpoint/breakpoint-manager.js +287 -0
  34. package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -0
  35. package/lib/browser/breakpoint/breakpoint-marker.d.ts +37 -0
  36. package/lib/browser/breakpoint/breakpoint-marker.d.ts.map +1 -0
  37. package/lib/browser/breakpoint/breakpoint-marker.js +46 -0
  38. package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -0
  39. package/lib/browser/breakpoint/index.d.ts +4 -0
  40. package/lib/browser/breakpoint/index.d.ts.map +1 -0
  41. package/lib/browser/breakpoint/index.js +7 -0
  42. package/lib/browser/breakpoint/index.js.map +1 -0
  43. package/lib/browser/components/debug-action/index.d.ts +11 -0
  44. package/lib/browser/components/debug-action/index.d.ts.map +1 -0
  45. package/lib/browser/components/debug-action/index.js +15 -0
  46. package/lib/browser/components/debug-action/index.js.map +1 -0
  47. package/lib/browser/components/debug-action/index.module.less +73 -0
  48. package/lib/browser/components/floating-click-widget/index.d.ts +3 -0
  49. package/lib/browser/components/floating-click-widget/index.d.ts.map +1 -0
  50. package/lib/browser/components/floating-click-widget/index.js +17 -0
  51. package/lib/browser/components/floating-click-widget/index.js.map +1 -0
  52. package/lib/browser/components/floating-click-widget/index.module.less +5 -0
  53. package/lib/browser/components/index.d.ts +2 -0
  54. package/lib/browser/components/index.d.ts.map +1 -0
  55. package/lib/browser/components/index.js +5 -0
  56. package/lib/browser/components/index.js.map +1 -0
  57. package/lib/browser/contextkeys/debug-call-stack-item-type-key.d.ts +4 -0
  58. package/lib/browser/contextkeys/debug-call-stack-item-type-key.d.ts.map +1 -0
  59. package/lib/browser/contextkeys/debug-call-stack-item-type-key.js +5 -0
  60. package/lib/browser/contextkeys/debug-call-stack-item-type-key.js.map +1 -0
  61. package/lib/browser/contextkeys/debug-contextkey.service.d.ts +16 -0
  62. package/lib/browser/contextkeys/debug-contextkey.service.d.ts.map +1 -0
  63. package/lib/browser/contextkeys/debug-contextkey.service.js +33 -0
  64. package/lib/browser/contextkeys/debug-contextkey.service.js.map +1 -0
  65. package/lib/browser/contextkeys/index.d.ts +2 -0
  66. package/lib/browser/contextkeys/index.d.ts.map +1 -0
  67. package/lib/browser/contextkeys/index.js +5 -0
  68. package/lib/browser/contextkeys/index.js.map +1 -0
  69. package/lib/browser/debug-configuration-manager.d.ts +86 -0
  70. package/lib/browser/debug-configuration-manager.d.ts.map +1 -0
  71. package/lib/browser/debug-configuration-manager.js +456 -0
  72. package/lib/browser/debug-configuration-manager.js.map +1 -0
  73. package/lib/browser/debug-configuration-model.d.ts +24 -0
  74. package/lib/browser/debug-configuration-model.d.ts.map +1 -0
  75. package/lib/browser/debug-configuration-model.js +55 -0
  76. package/lib/browser/debug-configuration-model.js.map +1 -0
  77. package/lib/browser/debug-contribution.d.ts +207 -0
  78. package/lib/browser/debug-contribution.d.ts.map +1 -0
  79. package/lib/browser/debug-contribution.js +764 -0
  80. package/lib/browser/debug-contribution.js.map +1 -0
  81. package/lib/browser/debug-link-detector.d.ts +13 -0
  82. package/lib/browser/debug-link-detector.d.ts.map +1 -0
  83. package/lib/browser/debug-link-detector.js +196 -0
  84. package/lib/browser/debug-link-detector.js.map +1 -0
  85. package/lib/browser/debug-preferences.d.ts +15 -0
  86. package/lib/browser/debug-preferences.d.ts.map +1 -0
  87. package/lib/browser/debug-preferences.js +57 -0
  88. package/lib/browser/debug-preferences.js.map +1 -0
  89. package/lib/browser/debug-progress.service.d.ts +13 -0
  90. package/lib/browser/debug-progress.service.d.ts.map +1 -0
  91. package/lib/browser/debug-progress.service.js +97 -0
  92. package/lib/browser/debug-progress.service.js.map +1 -0
  93. package/lib/browser/debug-schema-updater.d.ts +10 -0
  94. package/lib/browser/debug-schema-updater.d.ts.map +1 -0
  95. package/lib/browser/debug-schema-updater.js +74 -0
  96. package/lib/browser/debug-schema-updater.js.map +1 -0
  97. package/lib/browser/debug-service.d.ts +11 -0
  98. package/lib/browser/debug-service.d.ts.map +1 -0
  99. package/lib/browser/debug-service.js +43 -0
  100. package/lib/browser/debug-service.js.map +1 -0
  101. package/lib/browser/debug-session-connection.d.ts +107 -0
  102. package/lib/browser/debug-session-connection.d.ts.map +1 -0
  103. package/lib/browser/debug-session-connection.js +267 -0
  104. package/lib/browser/debug-session-connection.js.map +1 -0
  105. package/lib/browser/debug-session-contribution.d.ts +61 -0
  106. package/lib/browser/debug-session-contribution.d.ts.map +1 -0
  107. package/lib/browser/debug-session-contribution.js +116 -0
  108. package/lib/browser/debug-session-contribution.js.map +1 -0
  109. package/lib/browser/debug-session-manager.d.ts +130 -0
  110. package/lib/browser/debug-session-manager.d.ts.map +1 -0
  111. package/lib/browser/debug-session-manager.js +488 -0
  112. package/lib/browser/debug-session-manager.js.map +1 -0
  113. package/lib/browser/debug-session.d.ts +181 -0
  114. package/lib/browser/debug-session.d.ts.map +1 -0
  115. package/lib/browser/debug-session.js +898 -0
  116. package/lib/browser/debug-session.js.map +1 -0
  117. package/lib/browser/debug-style.less +125 -0
  118. package/lib/browser/debugUtils.d.ts +18 -0
  119. package/lib/browser/debugUtils.d.ts.map +1 -0
  120. package/lib/browser/debugUtils.js +91 -0
  121. package/lib/browser/debugUtils.js.map +1 -0
  122. package/lib/browser/editor/debug-breakpoint-widget.d.ts +29 -0
  123. package/lib/browser/editor/debug-breakpoint-widget.d.ts.map +1 -0
  124. package/lib/browser/editor/debug-breakpoint-widget.js +82 -0
  125. package/lib/browser/editor/debug-breakpoint-widget.js.map +1 -0
  126. package/lib/browser/editor/debug-breakpoint-zone-widget.d.ts +60 -0
  127. package/lib/browser/editor/debug-breakpoint-zone-widget.d.ts.map +1 -0
  128. package/lib/browser/editor/debug-breakpoint-zone-widget.js +198 -0
  129. package/lib/browser/editor/debug-breakpoint-zone-widget.js.map +1 -0
  130. package/lib/browser/editor/debug-breakpoint.module.less +29 -0
  131. package/lib/browser/editor/debug-editor-contribution.d.ts +27 -0
  132. package/lib/browser/editor/debug-editor-contribution.d.ts.map +1 -0
  133. package/lib/browser/editor/debug-editor-contribution.js +354 -0
  134. package/lib/browser/editor/debug-editor-contribution.js.map +1 -0
  135. package/lib/browser/editor/debug-expression-provider.d.ts +12 -0
  136. package/lib/browser/editor/debug-expression-provider.d.ts.map +1 -0
  137. package/lib/browser/editor/debug-expression-provider.js +88 -0
  138. package/lib/browser/editor/debug-expression-provider.js.map +1 -0
  139. package/lib/browser/editor/debug-hover-model.d.ts +12 -0
  140. package/lib/browser/editor/debug-hover-model.d.ts.map +1 -0
  141. package/lib/browser/editor/debug-hover-model.js +43 -0
  142. package/lib/browser/editor/debug-hover-model.js.map +1 -0
  143. package/lib/browser/editor/debug-hover-source.d.ts +18 -0
  144. package/lib/browser/editor/debug-hover-source.d.ts.map +1 -0
  145. package/lib/browser/editor/debug-hover-source.js +94 -0
  146. package/lib/browser/editor/debug-hover-source.js.map +1 -0
  147. package/lib/browser/editor/debug-hover-tree.model.service.d.ts +62 -0
  148. package/lib/browser/editor/debug-hover-tree.model.service.d.ts.map +1 -0
  149. package/lib/browser/editor/debug-hover-tree.model.service.js +284 -0
  150. package/lib/browser/editor/debug-hover-tree.model.service.js.map +1 -0
  151. package/lib/browser/editor/debug-hover-widget.d.ts +58 -0
  152. package/lib/browser/editor/debug-hover-widget.d.ts.map +1 -0
  153. package/lib/browser/editor/debug-hover-widget.js +152 -0
  154. package/lib/browser/editor/debug-hover-widget.js.map +1 -0
  155. package/lib/browser/editor/debug-hover.module.less +30 -0
  156. package/lib/browser/editor/debug-hover.view.d.ts +3 -0
  157. package/lib/browser/editor/debug-hover.view.d.ts.map +1 -0
  158. package/lib/browser/editor/debug-hover.view.js +86 -0
  159. package/lib/browser/editor/debug-hover.view.js.map +1 -0
  160. package/lib/browser/editor/debug-model-manager.d.ts +41 -0
  161. package/lib/browser/editor/debug-model-manager.d.ts.map +1 -0
  162. package/lib/browser/editor/debug-model-manager.js +191 -0
  163. package/lib/browser/editor/debug-model-manager.js.map +1 -0
  164. package/lib/browser/editor/debug-model.d.ts +181 -0
  165. package/lib/browser/editor/debug-model.d.ts.map +1 -0
  166. package/lib/browser/editor/debug-model.js +673 -0
  167. package/lib/browser/editor/debug-model.js.map +1 -0
  168. package/lib/browser/editor/debug-run-to-cursor.service.d.ts +19 -0
  169. package/lib/browser/editor/debug-run-to-cursor.service.d.ts.map +1 -0
  170. package/lib/browser/editor/debug-run-to-cursor.service.js +145 -0
  171. package/lib/browser/editor/debug-run-to-cursor.service.js.map +1 -0
  172. package/lib/browser/editor/debug-styles.d.ts +13 -0
  173. package/lib/browser/editor/debug-styles.d.ts.map +1 -0
  174. package/lib/browser/editor/debug-styles.js +60 -0
  175. package/lib/browser/editor/debug-styles.js.map +1 -0
  176. package/lib/browser/editor/evaluatable-expression.d.ts +22 -0
  177. package/lib/browser/editor/evaluatable-expression.d.ts.map +1 -0
  178. package/lib/browser/editor/evaluatable-expression.js +24 -0
  179. package/lib/browser/editor/evaluatable-expression.js.map +1 -0
  180. package/lib/browser/editor/index.d.ts +7 -0
  181. package/lib/browser/editor/index.d.ts.map +1 -0
  182. package/lib/browser/editor/index.js +10 -0
  183. package/lib/browser/editor/index.js.map +1 -0
  184. package/lib/browser/editor/inline-values.d.ts +4 -0
  185. package/lib/browser/editor/inline-values.d.ts.map +1 -0
  186. package/lib/browser/editor/inline-values.js +6 -0
  187. package/lib/browser/editor/inline-values.js.map +1 -0
  188. package/lib/browser/index.d.ts +27 -0
  189. package/lib/browser/index.d.ts.map +1 -0
  190. package/lib/browser/index.js +135 -0
  191. package/lib/browser/index.js.map +1 -0
  192. package/lib/browser/markers/index.d.ts +3 -0
  193. package/lib/browser/markers/index.d.ts.map +1 -0
  194. package/lib/browser/markers/index.js +6 -0
  195. package/lib/browser/markers/index.js.map +1 -0
  196. package/lib/browser/markers/marker-manager.d.ts +62 -0
  197. package/lib/browser/markers/marker-manager.d.ts.map +1 -0
  198. package/lib/browser/markers/marker-manager.js +175 -0
  199. package/lib/browser/markers/marker-manager.js.map +1 -0
  200. package/lib/browser/markers/marker.d.ts +13 -0
  201. package/lib/browser/markers/marker.d.ts.map +1 -0
  202. package/lib/browser/markers/marker.js +3 -0
  203. package/lib/browser/markers/marker.js.map +1 -0
  204. package/lib/browser/model/debug-source.d.ts +46 -0
  205. package/lib/browser/model/debug-source.d.ts.map +1 -0
  206. package/lib/browser/model/debug-source.js +113 -0
  207. package/lib/browser/model/debug-source.js.map +1 -0
  208. package/lib/browser/model/debug-stack-frame.d.ts +30 -0
  209. package/lib/browser/model/debug-stack-frame.d.ts.map +1 -0
  210. package/lib/browser/model/debug-stack-frame.js +85 -0
  211. package/lib/browser/model/debug-stack-frame.js.map +1 -0
  212. package/lib/browser/model/debug-thread.d.ts +46 -0
  213. package/lib/browser/model/debug-thread.d.ts.map +1 -0
  214. package/lib/browser/model/debug-thread.js +140 -0
  215. package/lib/browser/model/debug-thread.js.map +1 -0
  216. package/lib/browser/model/debug-watch.d.ts +39 -0
  217. package/lib/browser/model/debug-watch.d.ts.map +1 -0
  218. package/lib/browser/model/debug-watch.js +97 -0
  219. package/lib/browser/model/debug-watch.js.map +1 -0
  220. package/lib/browser/model/index.d.ts +5 -0
  221. package/lib/browser/model/index.d.ts.map +1 -0
  222. package/lib/browser/model/index.js +8 -0
  223. package/lib/browser/model/index.js.map +1 -0
  224. package/lib/browser/preferences/launch-folder-preference-provider.d.ts +6 -0
  225. package/lib/browser/preferences/launch-folder-preference-provider.d.ts.map +1 -0
  226. package/lib/browser/preferences/launch-folder-preference-provider.js +29 -0
  227. package/lib/browser/preferences/launch-folder-preference-provider.js.map +1 -0
  228. package/lib/browser/preferences/launch-preferences-contribution.d.ts +6 -0
  229. package/lib/browser/preferences/launch-preferences-contribution.d.ts.map +1 -0
  230. package/lib/browser/preferences/launch-preferences-contribution.js +17 -0
  231. package/lib/browser/preferences/launch-preferences-contribution.js.map +1 -0
  232. package/lib/browser/preferences/launch-preferences.d.ts +3 -0
  233. package/lib/browser/preferences/launch-preferences.d.ts.map +1 -0
  234. package/lib/browser/preferences/launch-preferences.js +16 -0
  235. package/lib/browser/preferences/launch-preferences.js.map +1 -0
  236. package/lib/browser/tree/debug-console-tree-node.define.d.ts +29 -0
  237. package/lib/browser/tree/debug-console-tree-node.define.d.ts.map +1 -0
  238. package/lib/browser/tree/debug-console-tree-node.define.js +68 -0
  239. package/lib/browser/tree/debug-console-tree-node.define.js.map +1 -0
  240. package/lib/browser/tree/debug-tree-node.define.d.ts +199 -0
  241. package/lib/browser/tree/debug-tree-node.define.d.ts.map +1 -0
  242. package/lib/browser/tree/debug-tree-node.define.js +583 -0
  243. package/lib/browser/tree/debug-tree-node.define.js.map +1 -0
  244. package/lib/browser/tree/index.d.ts +3 -0
  245. package/lib/browser/tree/index.d.ts.map +1 -0
  246. package/lib/browser/tree/index.js +6 -0
  247. package/lib/browser/tree/index.js.map +1 -0
  248. package/lib/browser/view/breakpoints/debug-breakpoints.module.less +71 -0
  249. package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts +42 -0
  250. package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts.map +1 -0
  251. package/lib/browser/view/breakpoints/debug-breakpoints.service.js +228 -0
  252. package/lib/browser/view/breakpoints/debug-breakpoints.service.js.map +1 -0
  253. package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts +19 -0
  254. package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts.map +1 -0
  255. package/lib/browser/view/breakpoints/debug-breakpoints.view.js +108 -0
  256. package/lib/browser/view/breakpoints/debug-breakpoints.view.js.map +1 -0
  257. package/lib/browser/view/configuration/debug-configuration.module.less +101 -0
  258. package/lib/browser/view/configuration/debug-configuration.service.d.ts +36 -0
  259. package/lib/browser/view/configuration/debug-configuration.service.d.ts.map +1 -0
  260. package/lib/browser/view/configuration/debug-configuration.service.js +186 -0
  261. package/lib/browser/view/configuration/debug-configuration.service.js.map +1 -0
  262. package/lib/browser/view/configuration/debug-configuration.view.d.ts +3 -0
  263. package/lib/browser/view/configuration/debug-configuration.view.d.ts.map +1 -0
  264. package/lib/browser/view/configuration/debug-configuration.view.js +106 -0
  265. package/lib/browser/view/configuration/debug-configuration.view.js.map +1 -0
  266. package/lib/browser/view/configuration/debug-toolbar.service.d.ts +30 -0
  267. package/lib/browser/view/configuration/debug-toolbar.service.d.ts.map +1 -0
  268. package/lib/browser/view/configuration/debug-toolbar.service.js +173 -0
  269. package/lib/browser/view/configuration/debug-toolbar.service.js.map +1 -0
  270. package/lib/browser/view/configuration/debug-toolbar.view.d.ts +7 -0
  271. package/lib/browser/view/configuration/debug-toolbar.view.d.ts.map +1 -0
  272. package/lib/browser/view/configuration/debug-toolbar.view.js +171 -0
  273. package/lib/browser/view/configuration/debug-toolbar.view.js.map +1 -0
  274. package/lib/browser/view/console/debug-console-filter.model.d.ts +8 -0
  275. package/lib/browser/view/console/debug-console-filter.model.d.ts.map +1 -0
  276. package/lib/browser/view/console/debug-console-filter.model.js +53 -0
  277. package/lib/browser/view/console/debug-console-filter.model.js.map +1 -0
  278. package/lib/browser/view/console/debug-console-filter.service.d.ts +23 -0
  279. package/lib/browser/view/console/debug-console-filter.service.d.ts.map +1 -0
  280. package/lib/browser/view/console/debug-console-filter.service.js +66 -0
  281. package/lib/browser/view/console/debug-console-filter.service.js.map +1 -0
  282. package/lib/browser/view/console/debug-console-filter.view.d.ts +6 -0
  283. package/lib/browser/view/console/debug-console-filter.view.d.ts.map +1 -0
  284. package/lib/browser/view/console/debug-console-filter.view.js +63 -0
  285. package/lib/browser/view/console/debug-console-filter.view.js.map +1 -0
  286. package/lib/browser/view/console/debug-console-model.d.ts +18 -0
  287. package/lib/browser/view/console/debug-console-model.d.ts.map +1 -0
  288. package/lib/browser/view/console/debug-console-model.js +52 -0
  289. package/lib/browser/view/console/debug-console-model.js.map +1 -0
  290. package/lib/browser/view/console/debug-console-session.d.ts +32 -0
  291. package/lib/browser/view/console/debug-console-session.d.ts.map +1 -0
  292. package/lib/browser/view/console/debug-console-session.js +113 -0
  293. package/lib/browser/view/console/debug-console-session.js.map +1 -0
  294. package/lib/browser/view/console/debug-console-toolbar.view.d.ts +3 -0
  295. package/lib/browser/view/console/debug-console-toolbar.view.d.ts.map +1 -0
  296. package/lib/browser/view/console/debug-console-toolbar.view.js +20 -0
  297. package/lib/browser/view/console/debug-console-toolbar.view.js.map +1 -0
  298. package/lib/browser/view/console/debug-console-tree.model.service.d.ts +90 -0
  299. package/lib/browser/view/console/debug-console-tree.model.service.d.ts.map +1 -0
  300. package/lib/browser/view/console/debug-console-tree.model.service.js +460 -0
  301. package/lib/browser/view/console/debug-console-tree.model.service.js.map +1 -0
  302. package/lib/browser/view/console/debug-console.contribution.d.ts +20 -0
  303. package/lib/browser/view/console/debug-console.contribution.d.ts.map +1 -0
  304. package/lib/browser/view/console/debug-console.contribution.js +164 -0
  305. package/lib/browser/view/console/debug-console.contribution.js.map +1 -0
  306. package/lib/browser/view/console/debug-console.module.less +321 -0
  307. package/lib/browser/view/console/debug-console.service.d.ts +67 -0
  308. package/lib/browser/view/console/debug-console.service.d.ts.map +1 -0
  309. package/lib/browser/view/console/debug-console.service.js +397 -0
  310. package/lib/browser/view/console/debug-console.service.js.map +1 -0
  311. package/lib/browser/view/console/debug-console.view.d.ts +25 -0
  312. package/lib/browser/view/console/debug-console.view.d.ts.map +1 -0
  313. package/lib/browser/view/console/debug-console.view.js +299 -0
  314. package/lib/browser/view/console/debug-console.view.js.map +1 -0
  315. package/lib/browser/view/debug-view-model.d.ts +54 -0
  316. package/lib/browser/view/debug-view-model.d.ts.map +1 -0
  317. package/lib/browser/view/debug-view-model.js +161 -0
  318. package/lib/browser/view/debug-view-model.js.map +1 -0
  319. package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts +14 -0
  320. package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts.map +1 -0
  321. package/lib/browser/view/frames/debug-call-stack-frame.view.js +143 -0
  322. package/lib/browser/view/frames/debug-call-stack-frame.view.js.map +1 -0
  323. package/lib/browser/view/frames/debug-call-stack-session.view.d.ts +10 -0
  324. package/lib/browser/view/frames/debug-call-stack-session.view.d.ts.map +1 -0
  325. package/lib/browser/view/frames/debug-call-stack-session.view.js +148 -0
  326. package/lib/browser/view/frames/debug-call-stack-session.view.js.map +1 -0
  327. package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts +12 -0
  328. package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts.map +1 -0
  329. package/lib/browser/view/frames/debug-call-stack-thread.view.js +52 -0
  330. package/lib/browser/view/frames/debug-call-stack-thread.view.js.map +1 -0
  331. package/lib/browser/view/frames/debug-call-stack.contribution.d.ts +10 -0
  332. package/lib/browser/view/frames/debug-call-stack.contribution.d.ts.map +1 -0
  333. package/lib/browser/view/frames/debug-call-stack.contribution.js +81 -0
  334. package/lib/browser/view/frames/debug-call-stack.contribution.js.map +1 -0
  335. package/lib/browser/view/frames/debug-call-stack.module.less +195 -0
  336. package/lib/browser/view/frames/debug-call-stack.operation.d.ts +9 -0
  337. package/lib/browser/view/frames/debug-call-stack.operation.d.ts.map +1 -0
  338. package/lib/browser/view/frames/debug-call-stack.operation.js +43 -0
  339. package/lib/browser/view/frames/debug-call-stack.operation.js.map +1 -0
  340. package/lib/browser/view/frames/debug-call-stack.service.d.ts +12 -0
  341. package/lib/browser/view/frames/debug-call-stack.service.d.ts.map +1 -0
  342. package/lib/browser/view/frames/debug-call-stack.service.js +94 -0
  343. package/lib/browser/view/frames/debug-call-stack.service.js.map +1 -0
  344. package/lib/browser/view/frames/debug-call-stack.view.d.ts +6 -0
  345. package/lib/browser/view/frames/debug-call-stack.view.d.ts.map +1 -0
  346. package/lib/browser/view/frames/debug-call-stack.view.js +32 -0
  347. package/lib/browser/view/frames/debug-call-stack.view.js.map +1 -0
  348. package/lib/browser/view/variables/debug-variables-model.d.ts +12 -0
  349. package/lib/browser/view/variables/debug-variables-model.d.ts.map +1 -0
  350. package/lib/browser/view/variables/debug-variables-model.js +43 -0
  351. package/lib/browser/view/variables/debug-variables-model.js.map +1 -0
  352. package/lib/browser/view/variables/debug-variables-tree.model.service.d.ts +65 -0
  353. package/lib/browser/view/variables/debug-variables-tree.model.service.d.ts.map +1 -0
  354. package/lib/browser/view/variables/debug-variables-tree.model.service.js +376 -0
  355. package/lib/browser/view/variables/debug-variables-tree.model.service.js.map +1 -0
  356. package/lib/browser/view/variables/debug-variables.contribution.d.ts +14 -0
  357. package/lib/browser/view/variables/debug-variables.contribution.d.ts.map +1 -0
  358. package/lib/browser/view/variables/debug-variables.contribution.js +155 -0
  359. package/lib/browser/view/variables/debug-variables.contribution.js.map +1 -0
  360. package/lib/browser/view/variables/debug-variables.module.less +176 -0
  361. package/lib/browser/view/variables/debug-variables.view.d.ts +21 -0
  362. package/lib/browser/view/variables/debug-variables.view.d.ts.map +1 -0
  363. package/lib/browser/view/variables/debug-variables.view.js +151 -0
  364. package/lib/browser/view/variables/debug-variables.view.js.map +1 -0
  365. package/lib/browser/view/watch/debug-watch-model.d.ts +12 -0
  366. package/lib/browser/view/watch/debug-watch-model.d.ts.map +1 -0
  367. package/lib/browser/view/watch/debug-watch-model.js +43 -0
  368. package/lib/browser/view/watch/debug-watch-model.js.map +1 -0
  369. package/lib/browser/view/watch/debug-watch-tree.model.service.d.ts +91 -0
  370. package/lib/browser/view/watch/debug-watch-tree.model.service.d.ts.map +1 -0
  371. package/lib/browser/view/watch/debug-watch-tree.model.service.js +480 -0
  372. package/lib/browser/view/watch/debug-watch-tree.model.service.js.map +1 -0
  373. package/lib/browser/view/watch/debug-watch.contribution.d.ts +12 -0
  374. package/lib/browser/view/watch/debug-watch.contribution.d.ts.map +1 -0
  375. package/lib/browser/view/watch/debug-watch.contribution.js +143 -0
  376. package/lib/browser/view/watch/debug-watch.contribution.js.map +1 -0
  377. package/lib/browser/view/watch/debug-watch.module.less +214 -0
  378. package/lib/browser/view/watch/debug-watch.view.d.ts +21 -0
  379. package/lib/browser/view/watch/debug-watch.view.d.ts.map +1 -0
  380. package/lib/browser/view/watch/debug-watch.view.js +194 -0
  381. package/lib/browser/view/watch/debug-watch.view.js.map +1 -0
  382. package/lib/common/constants.d.ts +57 -0
  383. package/lib/common/constants.d.ts.map +1 -0
  384. package/lib/common/constants.js +61 -0
  385. package/lib/common/constants.js.map +1 -0
  386. package/lib/common/debug-configuration.d.ts +56 -0
  387. package/lib/common/debug-configuration.d.ts.map +1 -0
  388. package/lib/common/debug-configuration.js +15 -0
  389. package/lib/common/debug-configuration.js.map +1 -0
  390. package/lib/common/debug-editor.d.ts +4 -0
  391. package/lib/common/debug-editor.d.ts.map +1 -0
  392. package/lib/common/debug-editor.js +5 -0
  393. package/lib/common/debug-editor.js.map +1 -0
  394. package/lib/common/debug-model.d.ts +104 -0
  395. package/lib/common/debug-model.d.ts.map +1 -0
  396. package/lib/common/debug-model.js +10 -0
  397. package/lib/common/debug-model.js.map +1 -0
  398. package/lib/common/debug-progress.d.ts +7 -0
  399. package/lib/common/debug-progress.d.ts.map +1 -0
  400. package/lib/common/debug-progress.js +5 -0
  401. package/lib/common/debug-progress.js.map +1 -0
  402. package/lib/common/debug-schema-updater.d.ts +2 -0
  403. package/lib/common/debug-schema-updater.d.ts.map +1 -0
  404. package/lib/common/debug-schema-updater.js +5 -0
  405. package/lib/common/debug-schema-updater.js.map +1 -0
  406. package/lib/common/debug-service.d.ts +76 -0
  407. package/lib/common/debug-service.d.ts.map +1 -0
  408. package/lib/common/debug-service.js +16 -0
  409. package/lib/common/debug-service.js.map +1 -0
  410. package/lib/common/debug-session-options.d.ts +14 -0
  411. package/lib/common/debug-session-options.d.ts.map +1 -0
  412. package/lib/common/debug-session-options.js +11 -0
  413. package/lib/common/debug-session-options.js.map +1 -0
  414. package/lib/common/debug-session.d.ts +81 -0
  415. package/lib/common/debug-session.d.ts.map +1 -0
  416. package/lib/common/debug-session.js +19 -0
  417. package/lib/common/debug-session.js.map +1 -0
  418. package/lib/common/evaluatable-expression.d.ts +38 -0
  419. package/lib/common/evaluatable-expression.d.ts.map +1 -0
  420. package/lib/common/evaluatable-expression.js +3 -0
  421. package/lib/common/evaluatable-expression.js.map +1 -0
  422. package/lib/common/index.d.ts +12 -0
  423. package/lib/common/index.d.ts.map +1 -0
  424. package/lib/common/index.js +15 -0
  425. package/lib/common/index.js.map +1 -0
  426. package/lib/common/inline-values.d.ts +65 -0
  427. package/lib/common/inline-values.d.ts.map +1 -0
  428. package/lib/common/inline-values.js +4 -0
  429. package/lib/common/inline-values.js.map +1 -0
  430. package/lib/common/types.d.ts +80 -0
  431. package/lib/common/types.d.ts.map +1 -0
  432. package/lib/common/types.js +51 -0
  433. package/lib/common/types.js.map +1 -0
  434. package/lib/index.d.ts +2 -0
  435. package/lib/index.d.ts.map +1 -0
  436. package/lib/index.js +5 -0
  437. package/lib/index.js.map +1 -0
  438. package/package.json +48 -0
@@ -0,0 +1,898 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DebugSession = void 0;
4
+ const ide_core_browser_1 = require("@opensumi/ide-core-browser");
5
+ const debounce = require("lodash.debounce");
6
+ const common_1 = require("../common");
7
+ const debug_source_1 = require("./model/debug-source");
8
+ const debug_thread_1 = require("./model/debug-thread");
9
+ const breakpoint_1 = require("./breakpoint");
10
+ const ide_core_common_1 = require("@opensumi/ide-core-common");
11
+ class DebugSession {
12
+ constructor(id, options, connection, terminalService, workbenchEditorService, breakpointManager, modelManager, labelProvider, messages, fileSystem, sessionManager) {
13
+ this.id = id;
14
+ this.options = options;
15
+ this.connection = connection;
16
+ this.terminalService = terminalService;
17
+ this.workbenchEditorService = workbenchEditorService;
18
+ this.breakpointManager = breakpointManager;
19
+ this.modelManager = modelManager;
20
+ this.labelProvider = labelProvider;
21
+ this.messages = messages;
22
+ this.fileSystem = fileSystem;
23
+ this.sessionManager = sessionManager;
24
+ this.onDidChangeEmitter = new ide_core_browser_1.Emitter();
25
+ this.onDidChange = this.onDidChangeEmitter.event;
26
+ this._onDidChangeCallStack = new ide_core_browser_1.Emitter();
27
+ this.onDidChangeCallStack = this._onDidChangeCallStack.event;
28
+ this._onVariableChange = new ide_core_browser_1.Emitter();
29
+ this.onVariableChange = this._onVariableChange.event;
30
+ this._onCurrentThreadChange = new ide_core_browser_1.Emitter();
31
+ this.onCurrentThreadChange = this._onCurrentThreadChange.event;
32
+ this._onDidStop = new ide_core_browser_1.Emitter();
33
+ this.onDidStop = this._onDidStop.event;
34
+ this._onDidContinued = new ide_core_browser_1.Emitter();
35
+ this.onDidContinued = this._onDidContinued.event;
36
+ this._onDidThread = new ide_core_browser_1.Emitter();
37
+ this.onDidThread = this._onDidThread.event;
38
+ this._onRequest = new ide_core_browser_1.Emitter();
39
+ this.onRequest = this._onRequest.event;
40
+ this._onDidExitAdapter = new ide_core_browser_1.Emitter();
41
+ this.onDidExitAdapter = this._onDidExitAdapter.event;
42
+ this._onDidProgressStart = new ide_core_browser_1.Emitter();
43
+ this.onDidProgressStart = this._onDidProgressStart.event;
44
+ this._onDidProgressUpdate = new ide_core_browser_1.Emitter();
45
+ this.onDidProgressUpdate = this._onDidProgressUpdate.event;
46
+ this._onDidProgressEnd = new ide_core_browser_1.Emitter();
47
+ this.onDidProgressEnd = this._onDidProgressEnd.event;
48
+ this._onDidInvalidated = new ide_core_browser_1.Emitter();
49
+ this.onDidInvalidated = this._onDidInvalidated.event;
50
+ this._onDidChangeState = new ide_core_browser_1.Emitter();
51
+ this.onDidChangeState = this._onDidChangeState.event;
52
+ this.toDispose = new ide_core_browser_1.DisposableCollection();
53
+ this._capabilities = {};
54
+ this.updateDeffered = null;
55
+ this.exitDeferred = new ide_core_browser_1.Deferred();
56
+ this.cancellationMap = new Map();
57
+ this.toDisposeOnCurrentThread = new ide_core_browser_1.DisposableCollection();
58
+ this.initialized = false;
59
+ /**
60
+ * runtime 时候的临时缓存,每次调试的时候都应该清空,
61
+ * 会等待首次初始化完成
62
+ */
63
+ this.id2Breakpoint = new Map();
64
+ /**
65
+ * 初始化断点信息的锁
66
+ */
67
+ this.settingBreakpoints = null;
68
+ this._multipleThreadPaused = new Map();
69
+ this.sources = new Map();
70
+ this._threads = new Map();
71
+ this.scheduleUpdateThreads = debounce(() => this.updateThreads(undefined), 100);
72
+ this.pendingThreads = Promise.resolve();
73
+ this.terminated = false;
74
+ this.connection.onRequest('runInTerminal', (request) => {
75
+ this.runInTerminal(request);
76
+ });
77
+ this.toDispose.pushAll([
78
+ this.onDidChangeEmitter,
79
+ this.connection,
80
+ // 返回调试配置
81
+ this.on('initialized', () => {
82
+ this.configure();
83
+ }),
84
+ // 更新断点
85
+ this.on('breakpoint', ({ body }) => this.onUpdateBreakpoint(body)),
86
+ this.on('continued', async (event) => {
87
+ const { body: { allThreadsContinued, threadId } } = event;
88
+ this.handleCancellation(threadId);
89
+ if (this.supportsThreadIdCorrespond) {
90
+ if (threadId) {
91
+ this._multipleThreadPaused.delete(threadId);
92
+ }
93
+ else if (allThreadsContinued !== false) {
94
+ this._multipleThreadPaused.clear();
95
+ }
96
+ await this.updateCurrentThread();
97
+ this._onDidContinued.fire(event);
98
+ return;
99
+ }
100
+ // 更新线程
101
+ if (allThreadsContinued !== false) {
102
+ this.clearThreads();
103
+ this._onDidContinued.fire(event);
104
+ return;
105
+ }
106
+ if (threadId) {
107
+ this.clearThread(threadId);
108
+ }
109
+ this.onStateChange();
110
+ this._onDidContinued.fire(event);
111
+ }),
112
+ this.on('stopped', async (event) => {
113
+ const { body } = event;
114
+ this.stoppedDetails = body;
115
+ const { threadId } = body;
116
+ const reportTime = this.sessionManager.reportTime(common_1.DEBUG_REPORT_NAME.DEBUG_STOPPED, {
117
+ sessionId: this.id,
118
+ threadId,
119
+ });
120
+ if (this.supportsThreadIdCorrespond === true) {
121
+ await this.collectPausedThread(body);
122
+ if (body.threadId && this._multipleThreadPaused.has(body.threadId)) {
123
+ const pauseThread = this._multipleThreadPaused.get(body.threadId);
124
+ await this.updateCurrentThread(pauseThread);
125
+ await this.updateCurrentThreadFramesOnFocus();
126
+ }
127
+ }
128
+ else {
129
+ this.updateDeffered = new ide_core_browser_1.Deferred();
130
+ await this.updateThreads(body);
131
+ await this.updateCurrentThreadFramesOnFocus();
132
+ this.updateDeffered.resolve();
133
+ }
134
+ reportTime('stopped');
135
+ // action 结束后需要清除
136
+ const extra = this.sessionManager.getExtra(this.id, threadId);
137
+ if (threadId && extra && extra.action) {
138
+ extra.action = undefined;
139
+ this.sessionManager.setExtra(this.id, `${threadId !== null && threadId !== void 0 ? threadId : ''}`, extra);
140
+ }
141
+ this.onStateChange();
142
+ this._onDidStop.fire(event);
143
+ }),
144
+ this.on('thread', (event) => {
145
+ const { body: { reason, threadId } } = event;
146
+ if (this.supportsThreadIdCorrespond) {
147
+ // 当 supportsThreadIdCorrespond 开启的时候,只有在 DebugState 为 Stopped 的时候才发送 thread dap 事件
148
+ if (this.state === common_1.DebugState.Stopped) {
149
+ this._onDidThread.fire(event);
150
+ }
151
+ return;
152
+ }
153
+ if (reason === 'started') {
154
+ // 队列更新线程
155
+ this.scheduleUpdateThreads();
156
+ }
157
+ else if (reason === 'exited') {
158
+ // 清理线程数据
159
+ this.clearThread(threadId);
160
+ }
161
+ this._onDidThread.fire(event);
162
+ }),
163
+ this.on('terminated', () => {
164
+ this.terminated = true;
165
+ }),
166
+ this.on('exited', (reason) => {
167
+ this.exitDeferred.resolve(reason);
168
+ }),
169
+ this.on('progressStart', (event) => {
170
+ this._onDidProgressStart.fire(event);
171
+ }),
172
+ this.on('progressUpdate', (event) => {
173
+ this._onDidProgressUpdate.fire(event);
174
+ }),
175
+ this.on('progressEnd', (event) => {
176
+ this._onDidProgressEnd.fire(event);
177
+ }),
178
+ this.on('invalidated', async (event) => {
179
+ this._onDidInvalidated.fire(event);
180
+ if (!(event.body.areas && event.body.areas.length === 1 && (event.body.areas[0] === 'variables' || event.body.areas[0] === 'watch'))) {
181
+ this.cancelAllRequests();
182
+ this.clearThreads();
183
+ await this.updateThreads(this.stoppedDetails);
184
+ }
185
+ this.fireDidChange();
186
+ }),
187
+ this.on('capabilities', (event) => this.updateCapabilities(event.body.capabilities)),
188
+ this.breakpointManager.onDidChangeBreakpoints((event) => this.runtimeUpdateBreakpoint(event)),
189
+ this.breakpointManager.onDidChangeExceptionsBreakpoints((args) => {
190
+ if (this.breakpointManager.breakpointsEnabled) {
191
+ this.setExceptionBreakpoints(args);
192
+ }
193
+ }),
194
+ ide_core_common_1.Disposable.create(() => {
195
+ // 清除断点的运行时状态
196
+ this.breakpointManager.clearAllStatus(this.id);
197
+ }),
198
+ ]);
199
+ }
200
+ fireDidChange() {
201
+ this.onDidChangeEmitter.fire(undefined);
202
+ this.onStateChange();
203
+ }
204
+ get capabilities() {
205
+ return this._capabilities;
206
+ }
207
+ get supportsThreadIdCorrespond() {
208
+ return !!this.capabilities.supportsThreadIdCorrespond;
209
+ }
210
+ get configuration() {
211
+ return this.options.configuration;
212
+ }
213
+ get parentSession() {
214
+ return this.options.parentSession;
215
+ }
216
+ get compact() {
217
+ return !!this.options.compact;
218
+ }
219
+ async start() {
220
+ await this.workbenchEditorService.saveAll();
221
+ await this.initialize();
222
+ await this.launchOrAttach();
223
+ }
224
+ async runInTerminal({ arguments: { title, cwd, args, env } }) {
225
+ return this.doRunInTerminal({ name: title, cwd, env }, args.join(' '));
226
+ }
227
+ async doRunInTerminal(options, command) {
228
+ const activeTerminal = this.terminalService.terminals.find((terminal) => terminal.name === options.name && terminal.isActive);
229
+ let processId;
230
+ // 当存在同名终端并且处于激活状态时,复用该终端
231
+ if (activeTerminal) {
232
+ if (command) {
233
+ this.terminalService.sendText(activeTerminal.id, command);
234
+ }
235
+ processId = await this.terminalService.getProcessId(activeTerminal.id);
236
+ }
237
+ else {
238
+ const terminal = await this.terminalService.createTerminal(options);
239
+ terminal.show();
240
+ if (command) {
241
+ this.terminalService.sendText(terminal.id, command);
242
+ processId = await this.terminalService.getProcessId(terminal.id);
243
+ }
244
+ }
245
+ return { processId };
246
+ }
247
+ async initialize() {
248
+ const response = await this.connection.sendRequest('initialize', {
249
+ clientID: 'KatiTian',
250
+ clientName: 'KatiTian IDE',
251
+ adapterID: this.configuration.type,
252
+ locale: 'en-US',
253
+ linesStartAt1: true,
254
+ columnsStartAt1: true,
255
+ pathFormat: 'path',
256
+ supportsVariableType: false,
257
+ supportsVariablePaging: false,
258
+ supportsRunInTerminalRequest: true,
259
+ supportsProgressReporting: true,
260
+ supportsInvalidatedEvent: true,
261
+ }, this.configuration);
262
+ this.updateCapabilities(response.body || {});
263
+ this.onStateChange();
264
+ }
265
+ async launchOrAttach() {
266
+ if (this.parentSession && this.parentSession.state === common_1.DebugState.Inactive) {
267
+ throw (0, ide_core_browser_1.canceled)();
268
+ }
269
+ try {
270
+ if (this.configuration.request === 'attach') {
271
+ await this.sendRequest('attach', this.configuration);
272
+ }
273
+ else {
274
+ await this.sendRequest('launch', this.configuration);
275
+ }
276
+ }
277
+ catch (reason) {
278
+ this.fireExited(reason);
279
+ this.messages.error(reason.message || 'Debug session initialization failed. See console for details.');
280
+ throw reason && reason.message;
281
+ }
282
+ }
283
+ async configure() {
284
+ await this.initBreakpoints();
285
+ // 更新exceptionBreakpoint配置
286
+ this.breakpointManager.setExceptionBreakpoints(this.capabilities.exceptionBreakpointFilters || []);
287
+ if (this.capabilities.supportsConfigurationDoneRequest) {
288
+ await this.sendRequest('configurationDone', {});
289
+ }
290
+ this.initialized = true;
291
+ if (!this.supportsThreadIdCorrespond) {
292
+ await this.updateThreads(undefined);
293
+ }
294
+ }
295
+ async setExceptionBreakpoints(args) {
296
+ return this.sendRequest('setExceptionBreakpoints', args);
297
+ }
298
+ onStateChange() {
299
+ const state = this.state;
300
+ if (this.previousState !== state) {
301
+ this.previousState = state;
302
+ this._onDidChangeState.fire(state);
303
+ }
304
+ }
305
+ /**
306
+ * 运行时的断点修改
307
+ * TODO:// 待重构 @倾一
308
+ * @param body
309
+ */
310
+ async onUpdateBreakpoint(body) {
311
+ let breakpoint;
312
+ if (this.settingBreakpoints) {
313
+ await this.settingBreakpoints.promise;
314
+ }
315
+ try {
316
+ const raw = body.breakpoint;
317
+ switch (body.reason) {
318
+ case 'new':
319
+ if (raw.source && typeof raw.line === 'number' && raw.id && !this.id2Breakpoint.has(raw.id)) {
320
+ const uri = debug_source_1.DebugSource.toUri(raw.source);
321
+ const bp = breakpoint_1.DebugBreakpoint.create(uri, { line: raw.line, column: raw.column });
322
+ bp.status.set(this.id, raw);
323
+ this.addBreakpoint(bp);
324
+ }
325
+ break;
326
+ case 'removed':
327
+ if (raw.id) {
328
+ breakpoint = this.id2Breakpoint.get(raw.id);
329
+ if (breakpoint) {
330
+ this.delBreakpoint(breakpoint);
331
+ }
332
+ }
333
+ break;
334
+ case 'changed':
335
+ if (raw.id) {
336
+ breakpoint = this.id2Breakpoint.get(raw.id);
337
+ if (breakpoint) {
338
+ breakpoint.status.set(this.id, raw);
339
+ this.breakpointManager.updateBreakpoint(breakpoint);
340
+ }
341
+ }
342
+ break;
343
+ default:
344
+ break;
345
+ }
346
+ }
347
+ finally { }
348
+ }
349
+ async setBreakpoints(affected) {
350
+ const promises = [];
351
+ for (const uri of affected) {
352
+ const source = await this.toSource(uri);
353
+ const enableds = this.breakpointManager.getBreakpoints(uri).filter((b) => this.breakpointManager.breakpointsEnabled && b.enabled);
354
+ promises.push(this.sendRequest('setBreakpoints', {
355
+ source: source.raw,
356
+ sourceModified: false,
357
+ lines: enableds.map((breakpoint) => breakpoint.raw.line),
358
+ breakpoints: enableds.map((breakpoint) => breakpoint.raw),
359
+ })
360
+ .then((res) => {
361
+ res.body.breakpoints.forEach((status, index) => {
362
+ var _a, _b;
363
+ if (status.id) {
364
+ this.id2Breakpoint.set(status.id, enableds[index]);
365
+ }
366
+ const enabledBp = enableds[index];
367
+ enabledBp.raw.line = (_a = status.line) !== null && _a !== void 0 ? _a : enabledBp.raw.line;
368
+ enabledBp.raw.column = (_b = status.column) !== null && _b !== void 0 ? _b : enabledBp.raw.column;
369
+ enabledBp.status.set(this.id, status);
370
+ });
371
+ this.breakpointManager.updateBreakpoints(enableds, true);
372
+ this.breakpointManager.resolveBpDeffered();
373
+ return Promise.resolve();
374
+ })
375
+ .catch((error) => {
376
+ if (!(error instanceof Error)) {
377
+ const genericMessage = 'Breakpoint not valid for current debug session';
378
+ const message = error.message ? `${error.message}` : genericMessage;
379
+ enableds.forEach((breakpoint) => {
380
+ breakpoint.status.set(this.id, { verified: false, message });
381
+ this.breakpointManager.updateBreakpoint(breakpoint, true);
382
+ });
383
+ }
384
+ }));
385
+ }
386
+ return await Promise.all(promises);
387
+ }
388
+ delBreakpoint(breakpoint) {
389
+ return this.breakpointManager.delBreakpoint(breakpoint);
390
+ }
391
+ async addBreakpoint(breakpoint, isBpDeferred) {
392
+ if (isBpDeferred) {
393
+ this.breakpointManager.setBpDeffered();
394
+ }
395
+ this.breakpointManager.addBreakpoint(breakpoint);
396
+ return this.breakpointManager.promiseBpDeffered();
397
+ }
398
+ /**
399
+ * 运行时修改断点信息
400
+ */
401
+ async runtimeUpdateBreakpoint(event) {
402
+ const { affected, statusUpdated } = event;
403
+ if (statusUpdated) {
404
+ return;
405
+ }
406
+ return await this.setBreakpoints(affected);
407
+ }
408
+ /**
409
+ * 初始化加载用户的断点信息
410
+ */
411
+ async initBreakpoints() {
412
+ this.settingBreakpoints = new ide_core_browser_1.Deferred();
413
+ this.id2Breakpoint.clear();
414
+ // 当配置为noDebug时,仅运行程序,不设置断点
415
+ if (!this.configuration.noDebug) {
416
+ await this.setBreakpoints(this.breakpointManager.affected.map((str) => ide_core_browser_1.URI.parse(str)));
417
+ }
418
+ this.settingBreakpoints.resolve();
419
+ this.settingBreakpoints = null;
420
+ }
421
+ get currentThread() {
422
+ return this._currentThread;
423
+ }
424
+ set currentThread(thread) {
425
+ this.toDisposeOnCurrentThread.dispose();
426
+ this._currentThread = thread;
427
+ if (thread) {
428
+ this.toDisposeOnCurrentThread.push(thread.onDidChanged(() => this.fireDidChange()));
429
+ }
430
+ }
431
+ get multipleThreadPaused() {
432
+ return this._multipleThreadPaused;
433
+ }
434
+ hasInMultipleThreadPaused(id) {
435
+ return this._multipleThreadPaused.has(id);
436
+ }
437
+ clearThreads() {
438
+ var _a;
439
+ const frontEndTime = this.sessionManager.reportTime(common_1.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME, {
440
+ sessionId: this.id,
441
+ threadId: (_a = this.currentThread) === null || _a === void 0 ? void 0 : _a.id,
442
+ threadAmount: this.threadCount,
443
+ });
444
+ this._threads.forEach((thread) => {
445
+ thread.clear();
446
+ });
447
+ this._onDidChangeCallStack.fire();
448
+ this.collocationThread();
449
+ frontEndTime('clearThreads');
450
+ }
451
+ clearThread(threadId) {
452
+ const frontEndTime = this.sessionManager.reportTime(common_1.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME, {
453
+ sessionId: this.id,
454
+ threadId,
455
+ threadAmount: this.threadCount,
456
+ });
457
+ const thread = this._threads.get(threadId);
458
+ if (thread) {
459
+ thread.clear();
460
+ this._onDidChangeCallStack.fire();
461
+ }
462
+ this.collocationThread();
463
+ frontEndTime('clearThread');
464
+ }
465
+ get state() {
466
+ if (this.connection.disposed) {
467
+ return common_1.DebugState.Inactive;
468
+ }
469
+ if (!this.initialized) {
470
+ return common_1.DebugState.Initializing;
471
+ }
472
+ const thread = this.currentThread;
473
+ if (thread) {
474
+ return thread.stopped ? common_1.DebugState.Stopped : common_1.DebugState.Running;
475
+ }
476
+ else if (this.supportsThreadIdCorrespond) {
477
+ return common_1.DebugState.Running;
478
+ }
479
+ return !!this.stoppedThreads.next().value ? common_1.DebugState.Stopped : common_1.DebugState.Running;
480
+ }
481
+ get currentFrame() {
482
+ return this.currentThread && this.currentThread.currentFrame;
483
+ }
484
+ async getScopes(parent) {
485
+ const { currentFrame } = this;
486
+ return currentFrame ? currentFrame.getScopes(parent) : [];
487
+ }
488
+ get label() {
489
+ if (common_1.InternalDebugSessionOptions.is(this.options) && this.options.id) {
490
+ return this.configuration.name + ' (' + (this.options.id + 1) + ')';
491
+ }
492
+ return this.configuration.name;
493
+ }
494
+ get visible() {
495
+ return this.state > common_1.DebugState.Inactive;
496
+ }
497
+ getSource(raw) {
498
+ const uri = debug_source_1.DebugSource.toUri(raw).toString();
499
+ const source = this.sources.get(uri) || new debug_source_1.DebugSource(this, this.labelProvider, this.modelManager, this.workbenchEditorService, this.fileSystem);
500
+ source.update({ raw });
501
+ this.sources.set(uri, source);
502
+ return source;
503
+ }
504
+ getSourceForUri(uri) {
505
+ return this.sources.get(uri.toString());
506
+ }
507
+ async toSource(uri) {
508
+ const source = this.getSourceForUri(uri);
509
+ if (source) {
510
+ return source;
511
+ }
512
+ return this.getSource(await this.toDebugSource(uri));
513
+ }
514
+ async toDebugSource(uri) {
515
+ if (uri.scheme === debug_source_1.DebugSource.SCHEME) {
516
+ return {
517
+ name: uri.path.toString(),
518
+ sourceReference: Number(uri.query),
519
+ };
520
+ }
521
+ const name = uri.displayName;
522
+ let path = uri.toString();
523
+ if (uri.scheme === 'file') {
524
+ path = await this.fileSystem.getFsPath(path);
525
+ }
526
+ return {
527
+ name,
528
+ path,
529
+ adapterData: undefined,
530
+ sourceReference: undefined,
531
+ };
532
+ }
533
+ get threads() {
534
+ return Array.from(this._threads.values());
535
+ }
536
+ get threadCount() {
537
+ return this._threads.size;
538
+ }
539
+ *getThreads(filter) {
540
+ for (const thread of this.threads) {
541
+ if (filter(thread)) {
542
+ yield thread;
543
+ }
544
+ }
545
+ }
546
+ get runningThreads() {
547
+ return this.getThreads((thread) => !thread.stopped);
548
+ }
549
+ get stoppedThreads() {
550
+ return this.getThreads((thread) => thread.stopped);
551
+ }
552
+ async rawFetchThreads(threadId) {
553
+ const arg = typeof threadId === 'undefined' ? null : { threadId };
554
+ const response = await this.sendRequest('threads', arg);
555
+ if (response && response.body && response.body.threads && Array.isArray(response.body.threads)) {
556
+ return Promise.resolve(response.body.threads);
557
+ }
558
+ return Promise.resolve([]);
559
+ }
560
+ async fetchThreads() {
561
+ const rawThreads = await this.rawFetchThreads();
562
+ const existing = this._threads;
563
+ const threads = [];
564
+ for (const raw of rawThreads) {
565
+ const id = raw.id;
566
+ const thread = existing.get(id) || new debug_thread_1.DebugThread(this);
567
+ threads.push(thread);
568
+ thread.update({ raw });
569
+ }
570
+ return Promise.resolve(threads);
571
+ }
572
+ updateThreads(stoppedDetails) {
573
+ return this.pendingThreads = this.pendingThreads.then(async () => {
574
+ try {
575
+ // java debugger returns an empty body sometimes
576
+ const threads = await this.rawFetchThreads();
577
+ this.doUpdateThreads(threads, stoppedDetails);
578
+ }
579
+ catch (e) {
580
+ // console.error(e);
581
+ }
582
+ });
583
+ }
584
+ doUpdateThreads(rawThreads, stoppedDetails) {
585
+ const frontEndTime = this.sessionManager.reportTime(common_1.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME, {
586
+ sessionId: this.id,
587
+ threadId: stoppedDetails === null || stoppedDetails === void 0 ? void 0 : stoppedDetails.threadId,
588
+ threadAmount: rawThreads.length,
589
+ });
590
+ const threadIds = [];
591
+ rawThreads.forEach((raw) => {
592
+ threadIds.push(raw.id);
593
+ if (!this._threads.has(raw.id)) {
594
+ const thread = new debug_thread_1.DebugThread(this);
595
+ const data = { raw };
596
+ thread.update(data);
597
+ this._threads.set(raw.id, thread);
598
+ }
599
+ else if (raw.name) {
600
+ const oldThread = this._threads.get(raw.id);
601
+ if (oldThread) {
602
+ oldThread.raw.name = raw.name;
603
+ }
604
+ }
605
+ });
606
+ this._threads.forEach((dthread) => {
607
+ var _a;
608
+ const { raw: { id } } = dthread;
609
+ if (threadIds.indexOf(id) === -1) {
610
+ this._threads.delete(id);
611
+ }
612
+ if (stoppedDetails && (stoppedDetails.allThreadsStopped || stoppedDetails.threadId === id)) {
613
+ (_a = this._threads.get(id)) === null || _a === void 0 ? void 0 : _a.update({ stoppedDetails });
614
+ }
615
+ });
616
+ this.collocationThread(stoppedDetails);
617
+ frontEndTime('doUpdateThreads');
618
+ }
619
+ /**
620
+ * 两种更新 currentThread 方式
621
+ * 一. collocationThread: 在 threads 列表里查找
622
+ * 二. updateCurrentThread: 发送 threads DAP 给 debug server,由 server 去查找并返回。前提是 supportsThreadIdCorrespond 必须为 true
623
+ */
624
+ collocationThread(stoppedDetails) {
625
+ var _a;
626
+ const { currentThread } = this;
627
+ let threadId = currentThread && currentThread.raw.id;
628
+ if (stoppedDetails && !stoppedDetails.preserveFocusHint && !!stoppedDetails.threadId) {
629
+ threadId = stoppedDetails.threadId;
630
+ }
631
+ this.currentThread = typeof threadId === 'number' && this._threads.get(threadId) || this._threads.values().next().value;
632
+ if (((_a = this.currentThread) === null || _a === void 0 ? void 0 : _a.raw.id) !== threadId) {
633
+ this.fireDidChange();
634
+ }
635
+ }
636
+ async updateCurrentThread(thread) {
637
+ if (thread) {
638
+ this.currentThread = thread;
639
+ this._onCurrentThreadChange.fire(this.currentThread);
640
+ }
641
+ else {
642
+ this.currentThread = undefined;
643
+ this._onCurrentThreadChange.fire(undefined);
644
+ }
645
+ }
646
+ /**
647
+ * 收集被暂停的线程 map
648
+ */
649
+ async collectPausedThread(stoppedDetails) {
650
+ const threads = await this.rawFetchThreads(stoppedDetails === null || stoppedDetails === void 0 ? void 0 : stoppedDetails.threadId);
651
+ if (threads.length === 0) {
652
+ return new Map();
653
+ }
654
+ const debugThread = stoppedDetails.threadId && this._multipleThreadPaused.has(stoppedDetails.threadId) ? this._multipleThreadPaused.get(stoppedDetails.threadId) : new debug_thread_1.DebugThread(this);
655
+ const data = { raw: threads[0] };
656
+ if (stoppedDetails && (stoppedDetails.allThreadsStopped || stoppedDetails.threadId === threads[0].id)) {
657
+ data.stoppedDetails = stoppedDetails;
658
+ }
659
+ if (debugThread) {
660
+ debugThread.update(data);
661
+ await this.rawFetchFrames(debugThread);
662
+ this._multipleThreadPaused.set(debugThread.raw.id, debugThread);
663
+ }
664
+ return this._multipleThreadPaused;
665
+ }
666
+ async updateCurrentThreadFramesOnFocus() {
667
+ await this.rawFetchFrames(this.currentThread);
668
+ this._onDidChangeCallStack.fire();
669
+ const editor = this.workbenchEditorService.currentEditor;
670
+ const focus = (f) => {
671
+ if (this.stoppedDetails && !this.stoppedDetails.preserveFocusHint) {
672
+ this.currentThread.currentFrame = f;
673
+ }
674
+ };
675
+ if (this.currentThread && !this.currentFrame) {
676
+ // 过滤出有效的 frame source 资源
677
+ const frames = this.currentThread.frames.filter((f) => f && f.source && f.source.raw.presentationHint !== 'deemphasize');
678
+ if (frames.length === 0) {
679
+ return;
680
+ }
681
+ if (editor) {
682
+ const model = editor.monacoEditor.getModel();
683
+ if (model) {
684
+ const uri = ide_core_browser_1.URI.parse(model.uri.toString());
685
+ const curFram = frames.filter((f) => f.source.uri.toString() === uri.toString());
686
+ if (Array.isArray(curFram)) {
687
+ focus(curFram[0]);
688
+ }
689
+ }
690
+ }
691
+ else {
692
+ focus(frames[0]);
693
+ }
694
+ }
695
+ }
696
+ async rawFetchFrames(thread) {
697
+ if (!thread || thread.frameCount) {
698
+ return;
699
+ }
700
+ if (this.capabilities.supportsDelayedStackTraceLoading) {
701
+ await thread.rawFetchFrames(1);
702
+ await thread.rawFetchFrames(19);
703
+ }
704
+ else {
705
+ await thread.rawFetchFrames();
706
+ }
707
+ }
708
+ async terminate(restart) {
709
+ if (!this.terminated && this.capabilities.supportsTerminateRequest && this.configuration.request === 'launch') {
710
+ this.terminated = true;
711
+ this.sendRequest('terminate', { restart });
712
+ if (!await this.exited(1000)) {
713
+ await this.disconnect(restart);
714
+ }
715
+ }
716
+ else {
717
+ await this.disconnect(restart);
718
+ }
719
+ }
720
+ async disconnect(restart) {
721
+ try {
722
+ this.sendRequest('disconnect', { restart });
723
+ }
724
+ catch (reason) {
725
+ this.fireExited(reason);
726
+ return;
727
+ }
728
+ finally {
729
+ this._onDidExitAdapter.fire();
730
+ this.onStateChange();
731
+ }
732
+ const timeout = 500;
733
+ if (!await this.exited(timeout)) {
734
+ this.fireExited(new Error(`timeout after ${timeout} ms`));
735
+ }
736
+ }
737
+ updateCapabilities(capabilities) {
738
+ Object.assign(this._capabilities, capabilities);
739
+ }
740
+ fireExited(reason) {
741
+ this.connection.fire('exited', { reason });
742
+ }
743
+ exited(timeout) {
744
+ return Promise.race([
745
+ this.exitDeferred.promise.then(() => true, () => false),
746
+ new Promise((resolve) => {
747
+ setTimeout(resolve, timeout, false);
748
+ }),
749
+ ]);
750
+ }
751
+ async restart() {
752
+ if (this.capabilities.supportsRestartRequest) {
753
+ this.terminated = false;
754
+ await this.sendRequest('restart', {});
755
+ return true;
756
+ }
757
+ return false;
758
+ }
759
+ dispose() {
760
+ this.toDispose.dispose();
761
+ }
762
+ async evaluate(expression, context) {
763
+ var _a;
764
+ // evaluate muse wait for frames updated
765
+ if (this.updateDeffered) {
766
+ await ((_a = this.updateDeffered) === null || _a === void 0 ? void 0 : _a.promise);
767
+ }
768
+ const frameId = this.currentFrame && this.currentFrame.raw.id;
769
+ const response = await this.sendRequest('evaluate', { expression, frameId, context });
770
+ return response.body;
771
+ }
772
+ async goto(args) {
773
+ if (this.capabilities.supportsGotoTargetsRequest) {
774
+ const res = await this.sendRequest('goto', args);
775
+ return res;
776
+ }
777
+ }
778
+ async cancel(progressId) {
779
+ return this.sendRequest('cancel', { progressId });
780
+ }
781
+ async setVariableValue(args) {
782
+ if (this.capabilities.supportsSetVariable) {
783
+ const res = await this.sendRequest('setVariable', args);
784
+ this._onVariableChange.fire();
785
+ return res;
786
+ }
787
+ }
788
+ async breakpointLocations(uri, line) {
789
+ var _a;
790
+ const source = await this.toSource(uri);
791
+ const response = await this.sendRequest('breakpointLocations', { source: source.raw, line });
792
+ const positions = (((_a = response.body) === null || _a === void 0 ? void 0 : _a.breakpoints) || []).map((item) => ({ lineNumber: item.line, column: item.column || 1 }));
793
+ return Object.values(positions.reduce((obj, p) => (Object.assign(Object.assign({}, obj), { [`${p.lineNumber}:${p.column}`]: p })), {}));
794
+ }
795
+ async sendRequest(command, args, token) {
796
+ var _a, _b, _c;
797
+ if ((!this._capabilities.supportsTerminateRequest && command === 'terminate') ||
798
+ (!this._capabilities.supportsCompletionsRequest && command === 'completions') ||
799
+ (!this._capabilities.supportsTerminateThreadsRequest && command === 'terminateThreads')) {
800
+ throw new Error(`debug: ${command} not supported`);
801
+ }
802
+ let requestToken;
803
+ if (['continue', 'next', 'stepIn', 'stepOut', 'threads'].some((c) => command === c)) {
804
+ this.handleCancellation((_a = this.currentThread) === null || _a === void 0 ? void 0 : _a.raw.id);
805
+ }
806
+ if (['stackTrace', 'scopes', 'variables', 'completions', 'threads'].some((c) => command === c)) {
807
+ requestToken = ((_b = this.currentThread) === null || _b === void 0 ? void 0 : _b.raw.id) ? this.getNewCancellationToken((_c = this.currentThread) === null || _c === void 0 ? void 0 : _c.raw.id, token) : undefined;
808
+ }
809
+ try {
810
+ return await this.connection.sendRequest(command, args, this.configuration, requestToken);
811
+ }
812
+ finally {
813
+ this._onRequest.fire(command);
814
+ }
815
+ }
816
+ async takeCommand(command) {
817
+ return new Promise((resolve) => {
818
+ const disposable = this.onRequest((e) => {
819
+ if (e === command) {
820
+ disposable.dispose();
821
+ resolve();
822
+ }
823
+ });
824
+ });
825
+ }
826
+ sendCustomRequest(command, args) {
827
+ return this.connection.sendCustomRequest(command, args);
828
+ }
829
+ on(kind, listener) {
830
+ return this.connection.on(kind, listener);
831
+ }
832
+ get onDidCustomEvent() {
833
+ return this.connection.onDidCustomEvent;
834
+ }
835
+ // REPL
836
+ hasSeparateRepl() {
837
+ return !this.parentSession || this.options.repl !== 'mergeWithParent';
838
+ }
839
+ // REPL end
840
+ // report service
841
+ reportTime(name, defaults) {
842
+ return this.sessionManager.reportTime(name, defaults);
843
+ }
844
+ // Cancellation
845
+ getNewCancellationToken(threadId, token) {
846
+ const tokenSource = new ide_core_common_1.CancellationTokenSource(token);
847
+ const tokens = this.cancellationMap.get(threadId) || [];
848
+ tokens.push(tokenSource);
849
+ this.cancellationMap.set(threadId, tokens);
850
+ return tokenSource.token;
851
+ }
852
+ cancelAllRequests() {
853
+ this.cancellationMap.forEach((tokens) => tokens.forEach((t) => t.cancel()));
854
+ this.cancellationMap.clear();
855
+ }
856
+ handleCancellation(threadId) {
857
+ if (threadId) {
858
+ const tokens = this.cancellationMap.get(threadId);
859
+ this.cancellationMap.delete(threadId);
860
+ if (tokens) {
861
+ tokens.forEach((t) => t.cancel());
862
+ }
863
+ }
864
+ else {
865
+ this.cancelAllRequests();
866
+ }
867
+ }
868
+ // Cancellation end
869
+ getDebugProtocolBreakpoint(breakpointId) {
870
+ const data = this.breakpointManager.getBreakpoints().find((bp) => bp.id === breakpointId);
871
+ if (data) {
872
+ const status = data.status.get(this.id);
873
+ const bp = {
874
+ id: status === null || status === void 0 ? void 0 : status.id,
875
+ verified: !!(status === null || status === void 0 ? void 0 : status.verified),
876
+ message: status === null || status === void 0 ? void 0 : status.message,
877
+ source: status === null || status === void 0 ? void 0 : status.source,
878
+ line: status === null || status === void 0 ? void 0 : status.line,
879
+ column: status === null || status === void 0 ? void 0 : status.column,
880
+ endLine: status === null || status === void 0 ? void 0 : status.endLine,
881
+ endColumn: status === null || status === void 0 ? void 0 : status.endColumn,
882
+ instructionReference: status === null || status === void 0 ? void 0 : status.instructionReference,
883
+ offset: status === null || status === void 0 ? void 0 : status.offset,
884
+ };
885
+ return bp;
886
+ }
887
+ return undefined;
888
+ }
889
+ currentEditor() {
890
+ var _a;
891
+ return (_a = this.getModel()) === null || _a === void 0 ? void 0 : _a.editor;
892
+ }
893
+ getModel() {
894
+ return this.modelManager.model;
895
+ }
896
+ }
897
+ exports.DebugSession = DebugSession;
898
+ //# sourceMappingURL=debug-session.js.map