@theia/debug 1.67.0-next.56 → 1.67.0-next.59

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 (337) hide show
  1. package/lib/browser/breakpoint/breakpoint-manager.d.ts +91 -0
  2. package/lib/browser/breakpoint/breakpoint-manager.d.ts.map +1 -0
  3. package/lib/browser/breakpoint/breakpoint-manager.js +367 -0
  4. package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -0
  5. package/lib/browser/breakpoint/breakpoint-marker.d.ts +65 -0
  6. package/lib/browser/breakpoint/breakpoint-marker.d.ts.map +1 -0
  7. package/lib/browser/breakpoint/breakpoint-marker.js +102 -0
  8. package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -0
  9. package/lib/browser/breakpoint/debug-data-breakpoint-actions.d.ts +17 -0
  10. package/lib/browser/breakpoint/debug-data-breakpoint-actions.d.ts.map +1 -0
  11. package/lib/browser/breakpoint/debug-data-breakpoint-actions.js +166 -0
  12. package/lib/browser/breakpoint/debug-data-breakpoint-actions.js.map +1 -0
  13. package/lib/browser/console/debug-console-contribution.d.ts +45 -0
  14. package/lib/browser/console/debug-console-contribution.d.ts.map +1 -0
  15. package/lib/browser/console/debug-console-contribution.js +233 -0
  16. package/lib/browser/console/debug-console-contribution.js.map +1 -0
  17. package/lib/browser/console/debug-console-items.d.ts +98 -0
  18. package/lib/browser/console/debug-console-items.d.ts.map +1 -0
  19. package/lib/browser/console/debug-console-items.js +346 -0
  20. package/lib/browser/console/debug-console-items.js.map +1 -0
  21. package/lib/browser/console/debug-console-session.d.ts +32 -0
  22. package/lib/browser/console/debug-console-session.d.ts.map +1 -0
  23. package/lib/browser/console/debug-console-session.js +192 -0
  24. package/lib/browser/console/debug-console-session.js.map +1 -0
  25. package/lib/browser/debug-call-stack-item-type-key.d.ts +4 -0
  26. package/lib/browser/debug-call-stack-item-type-key.d.ts.map +1 -0
  27. package/lib/browser/debug-call-stack-item-type-key.js +20 -0
  28. package/lib/browser/debug-call-stack-item-type-key.js.map +1 -0
  29. package/lib/browser/debug-configuration-manager.d.ts +103 -0
  30. package/lib/browser/debug-configuration-manager.d.ts.map +1 -0
  31. package/lib/browser/debug-configuration-manager.js +545 -0
  32. package/lib/browser/debug-configuration-manager.js.map +1 -0
  33. package/lib/browser/debug-configuration-model.d.ts +30 -0
  34. package/lib/browser/debug-configuration-model.d.ts.map +1 -0
  35. package/lib/browser/debug-configuration-model.js +80 -0
  36. package/lib/browser/debug-configuration-model.js.map +1 -0
  37. package/lib/browser/debug-contribution.d.ts +23 -0
  38. package/lib/browser/debug-contribution.d.ts.map +1 -0
  39. package/lib/browser/debug-contribution.js +20 -0
  40. package/lib/browser/debug-contribution.js.map +1 -0
  41. package/lib/browser/debug-frontend-application-contribution.d.ts +252 -0
  42. package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -0
  43. package/lib/browser/debug-frontend-application-contribution.js +1696 -0
  44. package/lib/browser/debug-frontend-application-contribution.js.map +1 -0
  45. package/lib/browser/debug-frontend-module.d.ts +5 -0
  46. package/lib/browser/debug-frontend-module.d.ts.map +1 -0
  47. package/lib/browser/debug-frontend-module.js +112 -0
  48. package/lib/browser/debug-frontend-module.js.map +1 -0
  49. package/lib/browser/debug-package.spec.d.ts +1 -0
  50. package/lib/browser/debug-package.spec.d.ts.map +1 -0
  51. package/lib/browser/debug-package.spec.js +19 -0
  52. package/lib/browser/debug-package.spec.js.map +1 -0
  53. package/lib/browser/debug-prefix-configuration.d.ts +52 -0
  54. package/lib/browser/debug-prefix-configuration.d.ts.map +1 -0
  55. package/lib/browser/debug-prefix-configuration.js +202 -0
  56. package/lib/browser/debug-prefix-configuration.js.map +1 -0
  57. package/lib/browser/debug-resource.d.ts +15 -0
  58. package/lib/browser/debug-resource.d.ts.map +1 -0
  59. package/lib/browser/debug-resource.js +58 -0
  60. package/lib/browser/debug-resource.js.map +1 -0
  61. package/lib/browser/debug-schema-updater.d.ts +14 -0
  62. package/lib/browser/debug-schema-updater.d.ts.map +1 -0
  63. package/lib/browser/debug-schema-updater.js +161 -0
  64. package/lib/browser/debug-schema-updater.js.map +1 -0
  65. package/lib/browser/debug-session-configuration-label-provider.d.ts +11 -0
  66. package/lib/browser/debug-session-configuration-label-provider.d.ts.map +1 -0
  67. package/lib/browser/debug-session-configuration-label-provider.js +48 -0
  68. package/lib/browser/debug-session-configuration-label-provider.js.map +1 -0
  69. package/lib/browser/debug-session-configuration-label-provider.spec.d.ts +2 -0
  70. package/lib/browser/debug-session-configuration-label-provider.spec.d.ts.map +1 -0
  71. package/lib/browser/debug-session-configuration-label-provider.spec.js +84 -0
  72. package/lib/browser/debug-session-configuration-label-provider.spec.js.map +1 -0
  73. package/lib/browser/debug-session-connection.d.ts +111 -0
  74. package/lib/browser/debug-session-connection.d.ts.map +1 -0
  75. package/lib/browser/debug-session-connection.js +259 -0
  76. package/lib/browser/debug-session-connection.js.map +1 -0
  77. package/lib/browser/debug-session-contribution.d.ts +77 -0
  78. package/lib/browser/debug-session-contribution.d.ts.map +1 -0
  79. package/lib/browser/debug-session-contribution.js +143 -0
  80. package/lib/browser/debug-session-contribution.js.map +1 -0
  81. package/lib/browser/debug-session-manager.d.ts +140 -0
  82. package/lib/browser/debug-session-manager.d.ts.map +1 -0
  83. package/lib/browser/debug-session-manager.js +637 -0
  84. package/lib/browser/debug-session-manager.js.map +1 -0
  85. package/lib/browser/debug-session-options.d.ts +56 -0
  86. package/lib/browser/debug-session-options.d.ts.map +1 -0
  87. package/lib/browser/debug-session-options.js +92 -0
  88. package/lib/browser/debug-session-options.js.map +1 -0
  89. package/lib/browser/debug-session.d.ts +195 -0
  90. package/lib/browser/debug-session.d.ts.map +1 -0
  91. package/lib/browser/debug-session.js +946 -0
  92. package/lib/browser/debug-session.js.map +1 -0
  93. package/lib/browser/debug-tab-bar-decorator.d.ts +17 -0
  94. package/lib/browser/debug-tab-bar-decorator.d.ts.map +1 -0
  95. package/lib/browser/debug-tab-bar-decorator.js +63 -0
  96. package/lib/browser/debug-tab-bar-decorator.js.map +1 -0
  97. package/lib/browser/debug-watch-manager.d.ts +22 -0
  98. package/lib/browser/debug-watch-manager.d.ts.map +1 -0
  99. package/lib/browser/debug-watch-manager.js +86 -0
  100. package/lib/browser/debug-watch-manager.js.map +1 -0
  101. package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.d.ts +7 -0
  102. package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.d.ts.map +1 -0
  103. package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.js +39 -0
  104. package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.js.map +1 -0
  105. package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.d.ts +20 -0
  106. package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.d.ts.map +1 -0
  107. package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.js +111 -0
  108. package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.js.map +1 -0
  109. package/lib/browser/disassembly-view/disassembly-view-contribution.d.ts +25 -0
  110. package/lib/browser/disassembly-view/disassembly-view-contribution.d.ts.map +1 -0
  111. package/lib/browser/disassembly-view/disassembly-view-contribution.js +124 -0
  112. package/lib/browser/disassembly-view/disassembly-view-contribution.js.map +1 -0
  113. package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.d.ts +39 -0
  114. package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.d.ts.map +1 -0
  115. package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.js +213 -0
  116. package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.js.map +1 -0
  117. package/lib/browser/disassembly-view/disassembly-view-table-delegate.d.ts +16 -0
  118. package/lib/browser/disassembly-view/disassembly-view-table-delegate.d.ts.map +1 -0
  119. package/lib/browser/disassembly-view/disassembly-view-table-delegate.js +39 -0
  120. package/lib/browser/disassembly-view/disassembly-view-table-delegate.js.map +1 -0
  121. package/lib/browser/disassembly-view/disassembly-view-utilities.d.ts +38 -0
  122. package/lib/browser/disassembly-view/disassembly-view-utilities.d.ts.map +1 -0
  123. package/lib/browser/disassembly-view/disassembly-view-utilities.js +18 -0
  124. package/lib/browser/disassembly-view/disassembly-view-utilities.js.map +1 -0
  125. package/lib/browser/disassembly-view/disassembly-view-widget.d.ts +61 -0
  126. package/lib/browser/disassembly-view/disassembly-view-widget.d.ts.map +1 -0
  127. package/lib/browser/disassembly-view/disassembly-view-widget.js +446 -0
  128. package/lib/browser/disassembly-view/disassembly-view-widget.js.map +1 -0
  129. package/lib/browser/editor/debug-breakpoint-widget.d.ts +58 -0
  130. package/lib/browser/editor/debug-breakpoint-widget.d.ts.map +1 -0
  131. package/lib/browser/editor/debug-breakpoint-widget.js +270 -0
  132. package/lib/browser/editor/debug-breakpoint-widget.js.map +1 -0
  133. package/lib/browser/editor/debug-editor-model.d.ts +87 -0
  134. package/lib/browser/editor/debug-editor-model.d.ts.map +1 -0
  135. package/lib/browser/editor/debug-editor-model.js +499 -0
  136. package/lib/browser/editor/debug-editor-model.js.map +1 -0
  137. package/lib/browser/editor/debug-editor-service.d.ts +38 -0
  138. package/lib/browser/editor/debug-editor-service.d.ts.map +1 -0
  139. package/lib/browser/editor/debug-editor-service.js +183 -0
  140. package/lib/browser/editor/debug-editor-service.js.map +1 -0
  141. package/lib/browser/editor/debug-editor.d.ts +4 -0
  142. package/lib/browser/editor/debug-editor.d.ts.map +1 -0
  143. package/lib/browser/editor/debug-editor.js +20 -0
  144. package/lib/browser/editor/debug-editor.js.map +1 -0
  145. package/lib/browser/editor/debug-exception-widget.d.ts +30 -0
  146. package/lib/browser/editor/debug-exception-widget.d.ts.map +1 -0
  147. package/lib/browser/editor/debug-exception-widget.js +107 -0
  148. package/lib/browser/editor/debug-exception-widget.js.map +1 -0
  149. package/lib/browser/editor/debug-expression-provider.d.ts +17 -0
  150. package/lib/browser/editor/debug-expression-provider.d.ts.map +1 -0
  151. package/lib/browser/editor/debug-expression-provider.js +107 -0
  152. package/lib/browser/editor/debug-expression-provider.js.map +1 -0
  153. package/lib/browser/editor/debug-hover-source.d.ts +19 -0
  154. package/lib/browser/editor/debug-hover-source.d.ts.map +1 -0
  155. package/lib/browser/editor/debug-hover-source.js +110 -0
  156. package/lib/browser/editor/debug-hover-source.js.map +1 -0
  157. package/lib/browser/editor/debug-hover-widget.d.ts +61 -0
  158. package/lib/browser/editor/debug-hover-widget.d.ts.map +1 -0
  159. package/lib/browser/editor/debug-hover-widget.js +271 -0
  160. package/lib/browser/editor/debug-hover-widget.js.map +1 -0
  161. package/lib/browser/editor/debug-inline-value-decorator.d.ts +20 -0
  162. package/lib/browser/editor/debug-inline-value-decorator.d.ts.map +1 -0
  163. package/lib/browser/editor/debug-inline-value-decorator.js +326 -0
  164. package/lib/browser/editor/debug-inline-value-decorator.js.map +1 -0
  165. package/lib/browser/model/debug-breakpoint.d.ts +48 -0
  166. package/lib/browser/model/debug-breakpoint.d.ts.map +1 -0
  167. package/lib/browser/model/debug-breakpoint.js +111 -0
  168. package/lib/browser/model/debug-breakpoint.js.map +1 -0
  169. package/lib/browser/model/debug-data-breakpoint.d.ts +16 -0
  170. package/lib/browser/model/debug-data-breakpoint.d.ts.map +1 -0
  171. package/lib/browser/model/debug-data-breakpoint.js +75 -0
  172. package/lib/browser/model/debug-data-breakpoint.js.map +1 -0
  173. package/lib/browser/model/debug-function-breakpoint.d.ts +19 -0
  174. package/lib/browser/model/debug-function-breakpoint.d.ts.map +1 -0
  175. package/lib/browser/model/debug-function-breakpoint.js +93 -0
  176. package/lib/browser/model/debug-function-breakpoint.js.map +1 -0
  177. package/lib/browser/model/debug-instruction-breakpoint.d.ts +15 -0
  178. package/lib/browser/model/debug-instruction-breakpoint.d.ts.map +1 -0
  179. package/lib/browser/model/debug-instruction-breakpoint.js +66 -0
  180. package/lib/browser/model/debug-instruction-breakpoint.js.map +1 -0
  181. package/lib/browser/model/debug-source-breakpoint.d.ts +39 -0
  182. package/lib/browser/model/debug-source-breakpoint.d.ts.map +1 -0
  183. package/lib/browser/model/debug-source-breakpoint.js +219 -0
  184. package/lib/browser/model/debug-source-breakpoint.js.map +1 -0
  185. package/lib/browser/model/debug-source.d.ts +25 -0
  186. package/lib/browser/model/debug-source.d.ts.map +1 -0
  187. package/lib/browser/model/debug-source.js +81 -0
  188. package/lib/browser/model/debug-source.js.map +1 -0
  189. package/lib/browser/model/debug-stack-frame.d.ts +45 -0
  190. package/lib/browser/model/debug-stack-frame.d.ts.map +1 -0
  191. package/lib/browser/model/debug-stack-frame.js +157 -0
  192. package/lib/browser/model/debug-stack-frame.js.map +1 -0
  193. package/lib/browser/model/debug-thread.d.ts +68 -0
  194. package/lib/browser/model/debug-thread.d.ts.map +1 -0
  195. package/lib/browser/model/debug-thread.js +262 -0
  196. package/lib/browser/model/debug-thread.js.map +1 -0
  197. package/lib/browser/view/debug-action.d.ts +18 -0
  198. package/lib/browser/view/debug-action.d.ts.map +1 -0
  199. package/lib/browser/view/debug-action.js +44 -0
  200. package/lib/browser/view/debug-action.js.map +1 -0
  201. package/lib/browser/view/debug-breakpoints-source.d.ts +10 -0
  202. package/lib/browser/view/debug-breakpoints-source.d.ts.map +1 -0
  203. package/lib/browser/view/debug-breakpoints-source.js +58 -0
  204. package/lib/browser/view/debug-breakpoints-source.js.map +1 -0
  205. package/lib/browser/view/debug-breakpoints-widget.d.ts +23 -0
  206. package/lib/browser/view/debug-breakpoints-widget.d.ts.map +1 -0
  207. package/lib/browser/view/debug-breakpoints-widget.js +81 -0
  208. package/lib/browser/view/debug-breakpoints-widget.js.map +1 -0
  209. package/lib/browser/view/debug-configuration-select.d.ts +67 -0
  210. package/lib/browser/view/debug-configuration-select.d.ts.map +1 -0
  211. package/lib/browser/view/debug-configuration-select.js +212 -0
  212. package/lib/browser/view/debug-configuration-select.js.map +1 -0
  213. package/lib/browser/view/debug-configuration-widget.d.ts +33 -0
  214. package/lib/browser/view/debug-configuration-widget.d.ts.map +1 -0
  215. package/lib/browser/view/debug-configuration-widget.js +137 -0
  216. package/lib/browser/view/debug-configuration-widget.js.map +1 -0
  217. package/lib/browser/view/debug-exception-breakpoint.d.ts +15 -0
  218. package/lib/browser/view/debug-exception-breakpoint.d.ts.map +1 -0
  219. package/lib/browser/view/debug-exception-breakpoint.js +62 -0
  220. package/lib/browser/view/debug-exception-breakpoint.js.map +1 -0
  221. package/lib/browser/view/debug-session-widget.d.ts +29 -0
  222. package/lib/browser/view/debug-session-widget.d.ts.map +1 -0
  223. package/lib/browser/view/debug-session-widget.js +127 -0
  224. package/lib/browser/view/debug-session-widget.js.map +1 -0
  225. package/lib/browser/view/debug-stack-frames-source.d.ts +18 -0
  226. package/lib/browser/view/debug-stack-frames-source.d.ts.map +1 -0
  227. package/lib/browser/view/debug-stack-frames-source.js +83 -0
  228. package/lib/browser/view/debug-stack-frames-source.js.map +1 -0
  229. package/lib/browser/view/debug-stack-frames-widget.d.ts +25 -0
  230. package/lib/browser/view/debug-stack-frames-widget.d.ts.map +1 -0
  231. package/lib/browser/view/debug-stack-frames-widget.js +152 -0
  232. package/lib/browser/view/debug-stack-frames-widget.js.map +1 -0
  233. package/lib/browser/view/debug-threads-source.d.ts +9 -0
  234. package/lib/browser/view/debug-threads-source.d.ts.map +1 -0
  235. package/lib/browser/view/debug-threads-source.js +56 -0
  236. package/lib/browser/view/debug-threads-source.js.map +1 -0
  237. package/lib/browser/view/debug-threads-widget.d.ts +27 -0
  238. package/lib/browser/view/debug-threads-widget.d.ts.map +1 -0
  239. package/lib/browser/view/debug-threads-widget.js +139 -0
  240. package/lib/browser/view/debug-threads-widget.js.map +1 -0
  241. package/lib/browser/view/debug-toolbar-widget.d.ts +34 -0
  242. package/lib/browser/view/debug-toolbar-widget.d.ts.map +1 -0
  243. package/lib/browser/view/debug-toolbar-widget.js +139 -0
  244. package/lib/browser/view/debug-toolbar-widget.js.map +1 -0
  245. package/lib/browser/view/debug-variables-source.d.ts +10 -0
  246. package/lib/browser/view/debug-variables-source.d.ts.map +1 -0
  247. package/lib/browser/view/debug-variables-source.js +53 -0
  248. package/lib/browser/view/debug-variables-source.js.map +1 -0
  249. package/lib/browser/view/debug-variables-widget.d.ts +28 -0
  250. package/lib/browser/view/debug-variables-widget.d.ts.map +1 -0
  251. package/lib/browser/view/debug-variables-widget.js +152 -0
  252. package/lib/browser/view/debug-variables-widget.js.map +1 -0
  253. package/lib/browser/view/debug-view-model.d.ts +55 -0
  254. package/lib/browser/view/debug-view-model.d.ts.map +1 -0
  255. package/lib/browser/view/debug-view-model.js +215 -0
  256. package/lib/browser/view/debug-view-model.js.map +1 -0
  257. package/lib/browser/view/debug-watch-expression.d.ts +33 -0
  258. package/lib/browser/view/debug-watch-expression.d.ts.map +1 -0
  259. package/lib/browser/view/debug-watch-expression.js +93 -0
  260. package/lib/browser/view/debug-watch-expression.js.map +1 -0
  261. package/lib/browser/view/debug-watch-source.d.ts +10 -0
  262. package/lib/browser/view/debug-watch-source.d.ts.map +1 -0
  263. package/lib/browser/view/debug-watch-source.js +51 -0
  264. package/lib/browser/view/debug-watch-source.js.map +1 -0
  265. package/lib/browser/view/debug-watch-widget.d.ts +17 -0
  266. package/lib/browser/view/debug-watch-widget.d.ts.map +1 -0
  267. package/lib/browser/view/debug-watch-widget.js +71 -0
  268. package/lib/browser/view/debug-watch-widget.js.map +1 -0
  269. package/lib/browser/view/debug-widget.d.ts +24 -0
  270. package/lib/browser/view/debug-widget.d.ts.map +1 -0
  271. package/lib/browser/view/debug-widget.js +101 -0
  272. package/lib/browser/view/debug-widget.js.map +1 -0
  273. package/lib/common/debug-adapter-contribution-registry.d.ts +60 -0
  274. package/lib/common/debug-adapter-contribution-registry.d.ts.map +1 -0
  275. package/lib/common/debug-adapter-contribution-registry.js +205 -0
  276. package/lib/common/debug-adapter-contribution-registry.js.map +1 -0
  277. package/lib/common/debug-adapter-session.d.ts +19 -0
  278. package/lib/common/debug-adapter-session.d.ts.map +1 -0
  279. package/lib/common/debug-adapter-session.js +79 -0
  280. package/lib/common/debug-adapter-session.js.map +1 -0
  281. package/lib/common/debug-common.d.ts +2 -0
  282. package/lib/common/debug-common.d.ts.map +1 -0
  283. package/lib/common/debug-common.js +21 -0
  284. package/lib/common/debug-common.js.map +1 -0
  285. package/lib/common/debug-compound.d.ts +15 -0
  286. package/lib/common/debug-compound.d.ts.map +1 -0
  287. package/lib/common/debug-compound.js +28 -0
  288. package/lib/common/debug-compound.js.map +1 -0
  289. package/lib/common/debug-configuration.d.ts +77 -0
  290. package/lib/common/debug-configuration.d.ts.map +1 -0
  291. package/lib/common/debug-configuration.js +32 -0
  292. package/lib/common/debug-configuration.js.map +1 -0
  293. package/lib/common/debug-model.d.ts +153 -0
  294. package/lib/common/debug-model.d.ts.map +1 -0
  295. package/lib/common/debug-model.js +36 -0
  296. package/lib/common/debug-model.js.map +1 -0
  297. package/lib/common/debug-preferences.d.ts +18 -0
  298. package/lib/common/debug-preferences.d.ts.map +1 -0
  299. package/lib/common/debug-preferences.js +89 -0
  300. package/lib/common/debug-preferences.js.map +1 -0
  301. package/lib/common/debug-service.d.ts +124 -0
  302. package/lib/common/debug-service.d.ts.map +1 -0
  303. package/lib/common/debug-service.js +67 -0
  304. package/lib/common/debug-service.js.map +1 -0
  305. package/lib/common/debug-uri-utils.d.ts +24 -0
  306. package/lib/common/debug-uri-utils.d.ts.map +1 -0
  307. package/lib/common/debug-uri-utils.js +27 -0
  308. package/lib/common/debug-uri-utils.js.map +1 -0
  309. package/lib/common/inline-debug-adapter.d.ts +19 -0
  310. package/lib/common/inline-debug-adapter.d.ts.map +1 -0
  311. package/lib/common/inline-debug-adapter.js +45 -0
  312. package/lib/common/inline-debug-adapter.js.map +1 -0
  313. package/lib/common/launch-preferences.d.ts +6 -0
  314. package/lib/common/launch-preferences.d.ts.map +1 -0
  315. package/lib/common/launch-preferences.js +37 -0
  316. package/lib/common/launch-preferences.js.map +1 -0
  317. package/lib/node/debug-adapter-factory.d.ts +20 -0
  318. package/lib/node/debug-adapter-factory.d.ts.map +1 -0
  319. package/lib/node/debug-adapter-factory.js +89 -0
  320. package/lib/node/debug-adapter-factory.js.map +1 -0
  321. package/lib/node/debug-adapter-session-manager.d.ts +38 -0
  322. package/lib/node/debug-adapter-session-manager.d.ts.map +1 -0
  323. package/lib/node/debug-adapter-session-manager.js +104 -0
  324. package/lib/node/debug-adapter-session-manager.js.map +1 -0
  325. package/lib/node/debug-backend-module.d.ts +4 -0
  326. package/lib/node/debug-backend-module.d.ts.map +1 -0
  327. package/lib/node/debug-backend-module.js +45 -0
  328. package/lib/node/debug-backend-module.js.map +1 -0
  329. package/lib/node/debug-service-impl.d.ts +31 -0
  330. package/lib/node/debug-service-impl.d.ts.map +1 -0
  331. package/lib/node/debug-service-impl.js +117 -0
  332. package/lib/node/debug-service-impl.js.map +1 -0
  333. package/lib/node/stream-debug-adapter.d.ts +41 -0
  334. package/lib/node/stream-debug-adapter.d.ts.map +1 -0
  335. package/lib/node/stream-debug-adapter.js +113 -0
  336. package/lib/node/stream-debug-adapter.js.map +1 -0
  337. package/package.json +15 -15
@@ -0,0 +1,946 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 Red Hat, Inc. and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DebugSession = exports.formatMessage = exports.debugStateContextValue = exports.DebugState = void 0;
19
+ /* eslint-disable @typescript-eslint/no-explicit-any */
20
+ const React = require("@theia/core/shared/react");
21
+ const common_1 = require("@theia/core/lib/common");
22
+ const debug_thread_1 = require("./model/debug-thread");
23
+ const debug_source_1 = require("./model/debug-source");
24
+ const debug_source_breakpoint_1 = require("./model/debug-source-breakpoint");
25
+ const debounce = require("p-debounce");
26
+ const uri_1 = require("@theia/core/lib/common/uri");
27
+ const breakpoint_manager_1 = require("./breakpoint/breakpoint-manager");
28
+ const debug_session_options_1 = require("./debug-session-options");
29
+ const debug_common_1 = require("../common/debug-common");
30
+ const breakpoint_marker_1 = require("./breakpoint/breakpoint-marker");
31
+ const debug_function_breakpoint_1 = require("./model/debug-function-breakpoint");
32
+ const promise_util_1 = require("@theia/core/lib/common/promise-util");
33
+ const debug_instruction_breakpoint_1 = require("./model/debug-instruction-breakpoint");
34
+ const core_1 = require("@theia/core");
35
+ const test_service_1 = require("@theia/test/lib/browser/test-service");
36
+ const debug_data_breakpoint_1 = require("./model/debug-data-breakpoint");
37
+ var DebugState;
38
+ (function (DebugState) {
39
+ DebugState[DebugState["Inactive"] = 0] = "Inactive";
40
+ DebugState[DebugState["Initializing"] = 1] = "Initializing";
41
+ DebugState[DebugState["Running"] = 2] = "Running";
42
+ DebugState[DebugState["Stopped"] = 3] = "Stopped";
43
+ })(DebugState || (exports.DebugState = DebugState = {}));
44
+ /**
45
+ * The mapped string values must not change as they are used for the `debugState` when context closure.
46
+ * For more details see the `Debugger contexts` section of the [official doc](https://code.visualstudio.com/api/references/when-clause-contexts#available-contexts).
47
+ */
48
+ function debugStateContextValue(state) {
49
+ switch (state) {
50
+ case DebugState.Initializing: return 'initializing';
51
+ case DebugState.Stopped: return 'stopped';
52
+ case DebugState.Running: return 'running';
53
+ default: return 'inactive';
54
+ }
55
+ }
56
+ exports.debugStateContextValue = debugStateContextValue;
57
+ const formatMessageRegexp = /\{([^}]+)\}/g;
58
+ /**
59
+ * Returns a formatted message string. The format is compatible with {@link DebugProtocol.Message.format}.
60
+ * @param format A format string for the message. Embedded variables have the form `{name}`.
61
+ * @param variables An object used as a dictionary for looking up the variables in the format string.
62
+ */
63
+ function formatMessage(format, variables) {
64
+ return variables ? format.replace(formatMessageRegexp, (match, group) => variables.hasOwnProperty(group) ? variables[group] : match) : format;
65
+ }
66
+ exports.formatMessage = formatMessage;
67
+ // FIXME: make injectable to allow easily inject services
68
+ class DebugSession {
69
+ fireDidChange() {
70
+ this.onDidChangeEmitter.fire(undefined);
71
+ }
72
+ get onDidFocusStackFrame() {
73
+ return this.onDidFocusStackFrameEmitter.event;
74
+ }
75
+ get onDidFocusThread() {
76
+ return this.onDidFocusThreadEmitter.event;
77
+ }
78
+ fireDidChangeBreakpoints(uri) {
79
+ this.onDidChangeBreakpointsEmitter.fire(uri);
80
+ }
81
+ constructor(id, options, parentSession, testService, testRun, sessionManager, connection, terminalServer, editorManager, breakpoints, labelProvider, messages, fileService, debugContributionProvider, workspaceService,
82
+ /**
83
+ * Number of millis after a `stop` request times out. It's 5 seconds by default.
84
+ */
85
+ stopTimeout = 5000) {
86
+ this.id = id;
87
+ this.options = options;
88
+ this.parentSession = parentSession;
89
+ this.connection = connection;
90
+ this.terminalServer = terminalServer;
91
+ this.editorManager = editorManager;
92
+ this.breakpoints = breakpoints;
93
+ this.labelProvider = labelProvider;
94
+ this.messages = messages;
95
+ this.fileService = fileService;
96
+ this.debugContributionProvider = debugContributionProvider;
97
+ this.workspaceService = workspaceService;
98
+ this.stopTimeout = stopTimeout;
99
+ this.deferredOnDidConfigureCapabilities = new promise_util_1.Deferred();
100
+ this.onDidChangeEmitter = new common_1.Emitter();
101
+ this.onDidChange = this.onDidChangeEmitter.event;
102
+ this.onDidFocusStackFrameEmitter = new common_1.Emitter();
103
+ this.onDidFocusThreadEmitter = new common_1.Emitter();
104
+ this.onDidChangeBreakpointsEmitter = new common_1.Emitter();
105
+ this.onDidChangeBreakpoints = this.onDidChangeBreakpointsEmitter.event;
106
+ this.childSessions = new Map();
107
+ this.toDispose = new common_1.DisposableCollection();
108
+ this.isStopping = false;
109
+ this._capabilities = {};
110
+ this.sources = new Map();
111
+ this._threads = new Map();
112
+ this.toDisposeOnCurrentThread = new common_1.DisposableCollection();
113
+ /**
114
+ * The `send('initialize')` request could resolve later than `on('initialized')` emits the event.
115
+ * Hence, the `configure` would use the empty object `capabilities`.
116
+ * Using the empty `capabilities` could result in missing exception breakpoint filters, as
117
+ * always `capabilities.exceptionBreakpointFilters` is falsy. This deferred promise works
118
+ * around this timing issue. https://github.com/eclipse-theia/theia/issues/11886
119
+ */
120
+ this.didReceiveCapabilities = new promise_util_1.Deferred();
121
+ this.initialized = false;
122
+ this.scheduleUpdateThreads = debounce(() => this.updateThreads(undefined), 100);
123
+ this.pendingThreads = Promise.resolve();
124
+ this._breakpoints = new Map();
125
+ this.updatingBreakpoints = false;
126
+ this.connection.onRequest('runInTerminal', (request) => this.runInTerminal(request));
127
+ this.connection.onDidClose(() => {
128
+ this.toDispose.dispose();
129
+ });
130
+ this.registerDebugContributions(options.configuration.type, this.connection);
131
+ if (parentSession) {
132
+ parentSession.childSessions.set(id, this);
133
+ this.toDispose.push(common_1.Disposable.create(() => {
134
+ var _a, _b;
135
+ (_b = (_a = this.parentSession) === null || _a === void 0 ? void 0 : _a.childSessions) === null || _b === void 0 ? void 0 : _b.delete(id);
136
+ }));
137
+ }
138
+ if (testRun) {
139
+ try {
140
+ const run = test_service_1.TestServices.withTestRun(testService, testRun.controllerId, testRun.runId);
141
+ run.onDidChangeProperty(evt => {
142
+ if (evt.isRunning === false) {
143
+ sessionManager.terminateSession(this);
144
+ }
145
+ });
146
+ }
147
+ catch (err) {
148
+ console.error(err);
149
+ }
150
+ }
151
+ this.connection.onDidClose(() => this.toDispose.dispose());
152
+ this.toDispose.pushAll([
153
+ this.onDidChangeEmitter,
154
+ this.onDidChangeBreakpointsEmitter,
155
+ common_1.Disposable.create(() => {
156
+ this.clearBreakpoints();
157
+ this.doUpdateThreads([]);
158
+ }),
159
+ this.connection,
160
+ this.connection.on('initialized', () => this.configure()),
161
+ this.connection.on('breakpoint', ({ body }) => this.updateBreakpoint(body)),
162
+ this.connection.on('continued', e => this.handleContinued(e)),
163
+ this.connection.on('stopped', e => this.handleStopped(e)),
164
+ this.connection.on('thread', e => this.handleThread(e)),
165
+ this.connection.on('capabilities', event => this.updateCapabilities(event.body.capabilities)),
166
+ this.breakpoints.onDidChangeMarkers(uri => this.updateBreakpoints({ uri, sourceModified: true }))
167
+ ]);
168
+ }
169
+ get onDispose() {
170
+ return this.toDispose.onDispose;
171
+ }
172
+ get configuration() {
173
+ return this.options.configuration;
174
+ }
175
+ get capabilities() {
176
+ return this._capabilities;
177
+ }
178
+ getSource(raw) {
179
+ const uri = debug_source_1.DebugSource.toUri(raw).toString();
180
+ const source = this.sources.get(uri) || new debug_source_1.DebugSource(this, this.editorManager, this.labelProvider);
181
+ source.update({ raw });
182
+ this.sources.set(uri, source);
183
+ return source;
184
+ }
185
+ getSourceForUri(uri) {
186
+ return this.sources.get(uri.toString());
187
+ }
188
+ async toSource(uri) {
189
+ const source = this.getSourceForUri(uri);
190
+ if (source) {
191
+ return source;
192
+ }
193
+ return this.getSource(await this.toDebugSource(uri));
194
+ }
195
+ async toDebugSource(uri) {
196
+ if (uri.scheme === debug_source_1.DebugSource.SCHEME) {
197
+ return {
198
+ name: uri.path.toString(),
199
+ sourceReference: Number(uri.query)
200
+ };
201
+ }
202
+ const name = uri.displayName;
203
+ let path;
204
+ const underlying = await this.fileService.toUnderlyingResource(uri);
205
+ if (underlying.scheme === 'file') {
206
+ path = await this.fileService.fsPath(underlying);
207
+ }
208
+ else {
209
+ path = uri.toString();
210
+ }
211
+ return { name, path };
212
+ }
213
+ get threads() {
214
+ return this._threads.values();
215
+ }
216
+ get threadCount() {
217
+ return this._threads.size;
218
+ }
219
+ *getThreads(filter) {
220
+ for (const thread of this.threads) {
221
+ if (filter(thread)) {
222
+ yield thread;
223
+ }
224
+ }
225
+ }
226
+ get runningThreads() {
227
+ return this.getThreads(thread => !thread.stopped);
228
+ }
229
+ get stoppedThreads() {
230
+ return this.getThreads(thread => thread.stopped);
231
+ }
232
+ async pauseAll() {
233
+ const promises = [];
234
+ for (const thread of this.runningThreads) {
235
+ promises.push((async () => {
236
+ try {
237
+ await thread.pause();
238
+ }
239
+ catch (e) {
240
+ console.error('pauseAll failed:', e);
241
+ }
242
+ })());
243
+ }
244
+ await Promise.all(promises);
245
+ }
246
+ async continueAll() {
247
+ const promises = [];
248
+ for (const thread of this.stoppedThreads) {
249
+ promises.push((async () => {
250
+ try {
251
+ await thread.continue();
252
+ }
253
+ catch (e) {
254
+ console.error('continueAll failed:', e);
255
+ }
256
+ })());
257
+ }
258
+ await Promise.all(promises);
259
+ }
260
+ get currentFrame() {
261
+ return this.currentThread && this.currentThread.currentFrame;
262
+ }
263
+ get currentThread() {
264
+ return this._currentThread;
265
+ }
266
+ set currentThread(thread) {
267
+ var _a;
268
+ if (((_a = this._currentThread) === null || _a === void 0 ? void 0 : _a.id) === (thread === null || thread === void 0 ? void 0 : thread.id)) {
269
+ return;
270
+ }
271
+ this.toDisposeOnCurrentThread.dispose();
272
+ this._currentThread = thread;
273
+ this.onDidFocusThreadEmitter.fire(thread);
274
+ this.fireDidChange();
275
+ if (thread) {
276
+ this.toDisposeOnCurrentThread.push(thread.onDidChanged(() => this.fireDidChange()));
277
+ this.toDisposeOnCurrentThread.push(thread.onDidFocusStackFrame(frame => this.onDidFocusStackFrameEmitter.fire(frame)));
278
+ // If this thread is missing stack frame information, then load that.
279
+ this.updateFrames();
280
+ }
281
+ }
282
+ get state() {
283
+ if (this.connection.disposed) {
284
+ return DebugState.Inactive;
285
+ }
286
+ if (!this.initialized) {
287
+ return DebugState.Initializing;
288
+ }
289
+ const thread = this.currentThread;
290
+ if (thread) {
291
+ return thread.stopped ? DebugState.Stopped : DebugState.Running;
292
+ }
293
+ return !!this.stoppedThreads.next().value ? DebugState.Stopped : DebugState.Running;
294
+ }
295
+ async getScopes() {
296
+ const { currentFrame } = this;
297
+ return currentFrame ? currentFrame.getScopes() : [];
298
+ }
299
+ showMessage(messageType, message) {
300
+ this.messages.showMessage({
301
+ type: messageType,
302
+ text: message,
303
+ options: {
304
+ timeout: 10000
305
+ }
306
+ });
307
+ }
308
+ async start() {
309
+ await this.initialize();
310
+ await this.launchOrAttach();
311
+ }
312
+ async initialize() {
313
+ try {
314
+ const response = await this.connection.sendRequest('initialize', {
315
+ clientID: 'Theia',
316
+ clientName: core_1.nls.localize('theia/debug/TheiaIDE', 'Theia IDE'),
317
+ adapterID: this.configuration.type,
318
+ locale: 'en-US',
319
+ linesStartAt1: true,
320
+ columnsStartAt1: true,
321
+ pathFormat: 'path',
322
+ supportsVariableType: false,
323
+ supportsVariablePaging: false,
324
+ supportsRunInTerminalRequest: true
325
+ });
326
+ this.updateCapabilities((response === null || response === void 0 ? void 0 : response.body) || {});
327
+ this.didReceiveCapabilities.resolve();
328
+ }
329
+ catch (err) {
330
+ this.didReceiveCapabilities.reject(err);
331
+ throw err;
332
+ }
333
+ }
334
+ async launchOrAttach() {
335
+ try {
336
+ await this.sendRequest(this.configuration.request, this.configuration);
337
+ }
338
+ catch (reason) {
339
+ this.showMessage(common_1.MessageType.Error, reason.message || core_1.nls.localize('theia/debug/debugSessionInitializationFailed', 'Debug session initialization failed. See console for details.'));
340
+ throw reason;
341
+ }
342
+ }
343
+ async configure() {
344
+ await this.didReceiveCapabilities.promise;
345
+ if (this.capabilities.exceptionBreakpointFilters) {
346
+ const exceptionBreakpoints = [];
347
+ for (const filter of this.capabilities.exceptionBreakpointFilters) {
348
+ const origin = this.breakpoints.getExceptionBreakpoint(filter.filter);
349
+ exceptionBreakpoints.push(breakpoint_marker_1.ExceptionBreakpoint.create(filter, origin));
350
+ }
351
+ this.breakpoints.setExceptionBreakpoints(exceptionBreakpoints);
352
+ }
353
+ // mark as initialized, so updated breakpoints are shown in editor
354
+ this.initialized = true;
355
+ await this.updateBreakpoints({ sourceModified: false });
356
+ if (this.capabilities.supportsConfigurationDoneRequest) {
357
+ await this.sendRequest('configurationDone', {});
358
+ }
359
+ await this.updateThreads(undefined);
360
+ }
361
+ canTerminate() {
362
+ return !!this.capabilities.supportsTerminateRequest;
363
+ }
364
+ canRestart() {
365
+ return !!this.capabilities.supportsRestartRequest;
366
+ }
367
+ async restart() {
368
+ if (this.canRestart()) {
369
+ await this.sendRequest('restart', {});
370
+ }
371
+ }
372
+ async stop(isRestart, callback) {
373
+ if (!this.isStopping) {
374
+ this.isStopping = true;
375
+ if (this.canTerminate()) {
376
+ const terminated = this.waitFor('terminated', this.stopTimeout);
377
+ try {
378
+ await this.connection.sendRequest('terminate', { restart: isRestart }, this.stopTimeout);
379
+ await terminated;
380
+ }
381
+ catch (e) {
382
+ this.handleTerminateError(e);
383
+ }
384
+ }
385
+ else {
386
+ const terminateDebuggee = this.initialized && this.capabilities.supportTerminateDebuggee;
387
+ try {
388
+ await this.sendRequest('disconnect', { restart: isRestart, terminateDebuggee }, this.stopTimeout);
389
+ }
390
+ catch (e) {
391
+ this.handleDisconnectError(e);
392
+ }
393
+ }
394
+ callback();
395
+ }
396
+ }
397
+ /**
398
+ * Invoked when sending the `terminate` request to the debugger is rejected or timed out.
399
+ */
400
+ handleTerminateError(err) {
401
+ console.error('Did not receive terminated event in time', err);
402
+ }
403
+ /**
404
+ * Invoked when sending the `disconnect` request to the debugger is rejected or timed out.
405
+ */
406
+ handleDisconnectError(err) {
407
+ console.error('Error on disconnect', err);
408
+ }
409
+ async disconnect(isRestart, callback) {
410
+ if (!this.isStopping) {
411
+ this.isStopping = true;
412
+ await this.sendRequest('disconnect', { restart: isRestart });
413
+ callback();
414
+ }
415
+ }
416
+ async completions(text, column, line) {
417
+ const frameId = this.currentFrame && this.currentFrame.raw.id;
418
+ const response = await this.sendRequest('completions', { frameId, text, column, line });
419
+ return response.body.targets;
420
+ }
421
+ async evaluate(expression, context) {
422
+ const frameId = this.currentFrame && this.currentFrame.raw.id;
423
+ const response = await this.sendRequest('evaluate', { expression, frameId, context });
424
+ return response.body;
425
+ }
426
+ sendRequest(command, args, timeout) {
427
+ return this.connection.sendRequest(command, args, timeout);
428
+ }
429
+ sendCustomRequest(command, args) {
430
+ return this.connection.sendCustomRequest(command, args);
431
+ }
432
+ on(kind, listener) {
433
+ return this.connection.on(kind, listener);
434
+ }
435
+ waitFor(kind, ms) {
436
+ return (0, promise_util_1.waitForEvent)(this.connection.onEvent(kind), ms).then();
437
+ }
438
+ get onDidCustomEvent() {
439
+ return this.connection.onDidCustomEvent;
440
+ }
441
+ async runInTerminal({ arguments: { title, cwd, args, env } }) {
442
+ const terminal = await this.doCreateTerminal({ title, cwd, env, useServerTitle: false });
443
+ const { processId } = terminal;
444
+ await terminal.executeCommand({ cwd, args, env });
445
+ return { processId: await processId };
446
+ }
447
+ async doCreateTerminal(options) {
448
+ let terminal = undefined;
449
+ for (const t of this.terminalServer.all) {
450
+ if ((t.title.label === options.title || t.title.caption === options.title) && (await t.hasChildProcesses()) === false) {
451
+ terminal = t;
452
+ break;
453
+ }
454
+ }
455
+ if (!terminal) {
456
+ terminal = await this.terminalServer.newTerminal(options);
457
+ await terminal.start();
458
+ }
459
+ this.terminalServer.open(terminal);
460
+ return terminal;
461
+ }
462
+ clearThreads() {
463
+ for (const thread of this.threads) {
464
+ thread.clear();
465
+ }
466
+ this.updateCurrentThread();
467
+ }
468
+ clearThread(threadId) {
469
+ const thread = this._threads.get(threadId);
470
+ if (thread) {
471
+ thread.clear();
472
+ }
473
+ this.updateCurrentThread();
474
+ }
475
+ updateThreads(stoppedDetails) {
476
+ return this.pendingThreads = this.pendingThreads.then(async () => {
477
+ try {
478
+ const response = await this.sendRequest('threads', {});
479
+ // java debugger returns an empty body sometimes
480
+ const threads = response && response.body && response.body.threads || [];
481
+ this.doUpdateThreads(threads, stoppedDetails);
482
+ }
483
+ catch (e) {
484
+ console.error('updateThreads failed:', e);
485
+ }
486
+ });
487
+ }
488
+ doUpdateThreads(threads, stoppedDetails) {
489
+ const existing = this._threads;
490
+ this._threads = new Map();
491
+ for (const raw of threads) {
492
+ const id = raw.id;
493
+ const thread = existing.get(id) || new debug_thread_1.DebugThread(this);
494
+ this._threads.set(id, thread);
495
+ const data = { raw };
496
+ if (stoppedDetails) {
497
+ if (stoppedDetails.threadId === id) {
498
+ data.stoppedDetails = stoppedDetails;
499
+ }
500
+ else if (stoppedDetails.allThreadsStopped) {
501
+ data.stoppedDetails = {
502
+ // When a debug adapter notifies us that all threads are stopped,
503
+ // we do not know why the others are stopped, so we should default
504
+ // to something generic.
505
+ reason: '',
506
+ };
507
+ }
508
+ }
509
+ thread.update(data);
510
+ }
511
+ this.updateCurrentThread(stoppedDetails);
512
+ }
513
+ updateCurrentThread(stoppedDetails) {
514
+ const { currentThread } = this;
515
+ let threadId = currentThread && currentThread.raw.id;
516
+ if (stoppedDetails && !stoppedDetails.preserveFocusHint && !!stoppedDetails.threadId) {
517
+ threadId = stoppedDetails.threadId;
518
+ }
519
+ this.currentThread = typeof threadId === 'number' && this._threads.get(threadId)
520
+ || this._threads.values().next().value;
521
+ }
522
+ async updateFrames() {
523
+ const thread = this._currentThread;
524
+ if (!thread || thread.pendingFrameCount || thread.frameCount) {
525
+ return;
526
+ }
527
+ if (this.capabilities.supportsDelayedStackTraceLoading) {
528
+ await thread.fetchFrames(1);
529
+ await thread.fetchFrames(19);
530
+ }
531
+ else {
532
+ await thread.fetchFrames();
533
+ }
534
+ }
535
+ updateCapabilities(capabilities) {
536
+ Object.assign(this._capabilities, capabilities);
537
+ this.deferredOnDidConfigureCapabilities.resolve();
538
+ }
539
+ get breakpointUris() {
540
+ return this._breakpoints.keys();
541
+ }
542
+ getSourceBreakpoints(uri) {
543
+ const breakpoints = [];
544
+ for (const breakpoint of this.getBreakpoints(uri)) {
545
+ if (breakpoint instanceof debug_source_breakpoint_1.DebugSourceBreakpoint) {
546
+ breakpoints.push(breakpoint);
547
+ }
548
+ }
549
+ return breakpoints;
550
+ }
551
+ getFunctionBreakpoints() {
552
+ return this.getBreakpoints(breakpoint_manager_1.BreakpointManager.FUNCTION_URI).filter((breakpoint) => breakpoint instanceof debug_function_breakpoint_1.DebugFunctionBreakpoint);
553
+ }
554
+ getInstructionBreakpoints() {
555
+ if (this.capabilities.supportsInstructionBreakpoints) {
556
+ return this.getBreakpoints(breakpoint_manager_1.BreakpointManager.INSTRUCTION_URI)
557
+ .filter((breakpoint) => breakpoint instanceof debug_instruction_breakpoint_1.DebugInstructionBreakpoint);
558
+ }
559
+ return this.breakpoints.getInstructionBreakpoints().map(origin => new debug_instruction_breakpoint_1.DebugInstructionBreakpoint(origin, this.asDebugBreakpointOptions()));
560
+ }
561
+ getDataBreakpoints() {
562
+ if (this.capabilities.supportsDataBreakpoints) {
563
+ return this.getBreakpoints(breakpoint_manager_1.BreakpointManager.DATA_URI)
564
+ .filter((breakpoint) => breakpoint instanceof debug_data_breakpoint_1.DebugDataBreakpoint);
565
+ }
566
+ return this.breakpoints.getDataBreakpoints().map(origin => new debug_data_breakpoint_1.DebugDataBreakpoint(origin, this.asDebugBreakpointOptions()));
567
+ }
568
+ getBreakpoints(uri) {
569
+ if (uri) {
570
+ return this._breakpoints.get(uri.toString()) || [];
571
+ }
572
+ const result = [];
573
+ for (const breakpoints of this._breakpoints.values()) {
574
+ result.push(...breakpoints);
575
+ }
576
+ return result;
577
+ }
578
+ getBreakpoint(id) {
579
+ for (const breakpoints of this._breakpoints.values()) {
580
+ const breakpoint = breakpoints.find(b => b.id === id);
581
+ if (breakpoint) {
582
+ return breakpoint;
583
+ }
584
+ }
585
+ return undefined;
586
+ }
587
+ clearBreakpoints() {
588
+ const uris = [...this._breakpoints.keys()];
589
+ this._breakpoints.clear();
590
+ for (const uri of uris) {
591
+ this.fireDidChangeBreakpoints(new uri_1.default(uri));
592
+ }
593
+ }
594
+ updateBreakpoint(body) {
595
+ this.updatingBreakpoints = true;
596
+ try {
597
+ const raw = body.breakpoint;
598
+ if (body.reason === 'new') {
599
+ if (raw.source && typeof raw.line === 'number') {
600
+ const uri = debug_source_1.DebugSource.toUri(raw.source);
601
+ const origin = breakpoint_marker_1.SourceBreakpoint.create(uri, { line: raw.line, column: raw.column });
602
+ if (this.breakpoints.addBreakpoint(origin)) {
603
+ const breakpoints = this.getSourceBreakpoints(uri);
604
+ const breakpoint = new debug_source_breakpoint_1.DebugSourceBreakpoint(origin, this.asDebugBreakpointOptions());
605
+ breakpoint.update({ raw });
606
+ breakpoints.push(breakpoint);
607
+ this.setSourceBreakpoints(uri, breakpoints);
608
+ }
609
+ }
610
+ }
611
+ if (body.reason === 'removed' && typeof raw.id === 'number') {
612
+ const toRemove = this.findBreakpoint(b => b.idFromAdapter === raw.id);
613
+ if (toRemove) {
614
+ toRemove.remove();
615
+ const breakpoints = this.getBreakpoints(toRemove.uri);
616
+ const index = breakpoints.indexOf(toRemove);
617
+ if (index !== -1) {
618
+ breakpoints.splice(index, 1);
619
+ this.setBreakpoints(toRemove.uri, breakpoints);
620
+ }
621
+ }
622
+ }
623
+ if (body.reason === 'changed' && typeof raw.id === 'number') {
624
+ const toUpdate = this.findBreakpoint(b => b.idFromAdapter === raw.id);
625
+ if (toUpdate) {
626
+ toUpdate.update({ raw });
627
+ if (toUpdate instanceof debug_source_breakpoint_1.DebugSourceBreakpoint) {
628
+ const sourceBreakpoints = this.getSourceBreakpoints(toUpdate.uri);
629
+ // in order to dedup again if a debugger converted line breakpoint to inline breakpoint
630
+ // i.e. assigned a column to a line breakpoint
631
+ this.setSourceBreakpoints(toUpdate.uri, sourceBreakpoints);
632
+ }
633
+ else {
634
+ this.fireDidChangeBreakpoints(toUpdate.uri);
635
+ }
636
+ }
637
+ }
638
+ }
639
+ finally {
640
+ this.updatingBreakpoints = false;
641
+ }
642
+ }
643
+ findBreakpoint(match) {
644
+ for (const [, breakpoints] of this._breakpoints) {
645
+ for (const breakpoint of breakpoints) {
646
+ if (match(breakpoint)) {
647
+ return breakpoint;
648
+ }
649
+ }
650
+ }
651
+ return undefined;
652
+ }
653
+ async updateBreakpoints(options) {
654
+ if (this.updatingBreakpoints) {
655
+ return;
656
+ }
657
+ const { uri, sourceModified } = options;
658
+ await this.deferredOnDidConfigureCapabilities.promise;
659
+ for (const affectedUri of this.getAffectedUris(uri)) {
660
+ if (affectedUri.toString() === breakpoint_manager_1.BreakpointManager.EXCEPTION_URI.toString()) {
661
+ await this.sendExceptionBreakpoints();
662
+ }
663
+ else if (affectedUri.toString() === breakpoint_manager_1.BreakpointManager.FUNCTION_URI.toString()) {
664
+ await this.sendFunctionBreakpoints(affectedUri);
665
+ }
666
+ else if (affectedUri.toString() === breakpoint_manager_1.BreakpointManager.INSTRUCTION_URI.toString()) {
667
+ await this.sendInstructionBreakpoints();
668
+ }
669
+ else if (affectedUri.isEqual(breakpoint_manager_1.BreakpointManager.DATA_URI)) {
670
+ await this.sendDataBreakpoints();
671
+ }
672
+ else {
673
+ await this.sendSourceBreakpoints(affectedUri, sourceModified);
674
+ }
675
+ }
676
+ }
677
+ async sendExceptionBreakpoints() {
678
+ const filters = [];
679
+ const filterOptions = this.capabilities.supportsExceptionFilterOptions ? [] : undefined;
680
+ for (const breakpoint of this.breakpoints.getExceptionBreakpoints()) {
681
+ if (breakpoint.enabled) {
682
+ if (filterOptions) {
683
+ filterOptions.push({
684
+ filterId: breakpoint.raw.filter,
685
+ condition: breakpoint.condition
686
+ });
687
+ }
688
+ else {
689
+ filters.push(breakpoint.raw.filter);
690
+ }
691
+ }
692
+ }
693
+ await this.sendRequest('setExceptionBreakpoints', { filters, filterOptions });
694
+ }
695
+ async sendFunctionBreakpoints(affectedUri) {
696
+ const all = this.breakpoints.getFunctionBreakpoints().map(origin => new debug_function_breakpoint_1.DebugFunctionBreakpoint(origin, this.asDebugBreakpointOptions()));
697
+ const enabled = all.filter(b => b.enabled);
698
+ if (this.capabilities.supportsFunctionBreakpoints) {
699
+ try {
700
+ const response = await this.sendRequest('setFunctionBreakpoints', {
701
+ breakpoints: enabled.map(b => b.origin.raw)
702
+ });
703
+ // Apparently, `body` and `breakpoints` can be missing.
704
+ // https://github.com/eclipse-theia/theia/issues/11885
705
+ // https://github.com/microsoft/vscode/blob/80004351ccf0884b58359f7c8c801c91bb827d83/src/vs/workbench/contrib/debug/browser/debugSession.ts#L448-L449
706
+ if (response && response.body) {
707
+ response.body.breakpoints.forEach((raw, index) => {
708
+ // node debug adapter returns more breakpoints sometimes
709
+ if (enabled[index]) {
710
+ enabled[index].update({ raw });
711
+ }
712
+ });
713
+ }
714
+ }
715
+ catch (error) {
716
+ // could be error or promise rejection of DebugProtocol.SetFunctionBreakpoints
717
+ if (error instanceof Error) {
718
+ console.error(`Error setting breakpoints: ${error.message}`);
719
+ }
720
+ else {
721
+ // handle adapters that send failed DebugProtocol.SetFunctionBreakpoints for invalid breakpoints
722
+ const genericMessage = 'Function breakpoint not valid for current debug session';
723
+ const message = error.message ? `${error.message}` : genericMessage;
724
+ console.warn(`Could not handle function breakpoints: ${message}, disabling...`);
725
+ enabled.forEach(b => b.update({
726
+ raw: {
727
+ verified: false,
728
+ message
729
+ }
730
+ }));
731
+ }
732
+ }
733
+ }
734
+ this.setBreakpoints(affectedUri, all);
735
+ }
736
+ async sendSourceBreakpoints(affectedUri, sourceModified) {
737
+ const source = await this.toSource(affectedUri);
738
+ const known = this._breakpoints.get(affectedUri.toString());
739
+ const all = this.breakpoints.findMarkers({ uri: affectedUri }).map(({ data }) => {
740
+ var _a;
741
+ return (_a = known === null || known === void 0 ? void 0 : known.find((candidate) => candidate instanceof debug_source_breakpoint_1.DebugSourceBreakpoint && candidate.origin.id === data.id)) !== null && _a !== void 0 ? _a : new debug_source_breakpoint_1.DebugSourceBreakpoint(data, this.asDebugBreakpointOptions());
742
+ });
743
+ const enabled = all.filter(b => b.enabled);
744
+ try {
745
+ const breakpoints = enabled.map(({ origin }) => origin.raw);
746
+ const response = await this.sendRequest('setBreakpoints', {
747
+ source: source.raw,
748
+ sourceModified,
749
+ breakpoints,
750
+ lines: breakpoints.map(({ line }) => line)
751
+ });
752
+ response.body.breakpoints.forEach((raw, index) => {
753
+ // node debug adapter returns more breakpoints sometimes
754
+ if (enabled[index]) {
755
+ enabled[index].update({ raw });
756
+ }
757
+ });
758
+ }
759
+ catch (error) {
760
+ // could be error or promise rejection of DebugProtocol.SetBreakpointsResponse
761
+ if (error instanceof Error) {
762
+ console.error(`Error setting breakpoints: ${error.message}`);
763
+ }
764
+ else {
765
+ // handle adapters that send failed DebugProtocol.SetBreakpointsResponse for invalid breakpoints
766
+ const genericMessage = 'Breakpoint not valid for current debug session';
767
+ const message = error.message ? `${error.message}` : genericMessage;
768
+ console.warn(`Could not handle breakpoints for ${affectedUri}: ${message}, disabling...`);
769
+ enabled.forEach(b => b.update({
770
+ raw: {
771
+ verified: false,
772
+ message
773
+ }
774
+ }));
775
+ }
776
+ }
777
+ this.setSourceBreakpoints(affectedUri, all);
778
+ }
779
+ async sendInstructionBreakpoints() {
780
+ if (!this.capabilities.supportsInstructionBreakpoints) {
781
+ return;
782
+ }
783
+ const all = this.breakpoints.getInstructionBreakpoints().map(breakpoint => new debug_instruction_breakpoint_1.DebugInstructionBreakpoint(breakpoint, this.asDebugBreakpointOptions()));
784
+ const enabled = all.filter(breakpoint => breakpoint.enabled);
785
+ try {
786
+ const response = await this.sendRequest('setInstructionBreakpoints', {
787
+ breakpoints: enabled.map(renderable => renderable.origin),
788
+ });
789
+ response.body.breakpoints.forEach((raw, index) => { var _a; return (_a = enabled[index]) === null || _a === void 0 ? void 0 : _a.update({ raw }); });
790
+ }
791
+ catch {
792
+ enabled.forEach(breakpoint => breakpoint.update({ raw: { verified: false } }));
793
+ }
794
+ this.setBreakpoints(breakpoint_manager_1.BreakpointManager.INSTRUCTION_URI, all);
795
+ }
796
+ async sendDataBreakpoints() {
797
+ if (!this.capabilities.supportsDataBreakpoints) {
798
+ return;
799
+ }
800
+ const known = this._breakpoints.get(breakpoint_manager_1.BreakpointManager.DATA_URI.toString());
801
+ const all = this.breakpoints.getDataBreakpoints().map(bp => {
802
+ var _a;
803
+ return (_a = known === null || known === void 0 ? void 0 : known.find((candidate) => candidate instanceof debug_data_breakpoint_1.DebugDataBreakpoint && candidate.id === bp.id)) !== null && _a !== void 0 ? _a : new debug_data_breakpoint_1.DebugDataBreakpoint(bp, this.asDebugBreakpointOptions());
804
+ });
805
+ const enabled = all.filter(bp => bp.enabled);
806
+ try {
807
+ const response = await this.sendRequest('setDataBreakpoints', {
808
+ breakpoints: enabled.map(({ origin }) => origin.raw)
809
+ });
810
+ response.body.breakpoints.forEach((raw, index) => enabled[index].update({ raw }));
811
+ }
812
+ catch {
813
+ enabled.forEach(breakpoint => breakpoint.update({ raw: { verified: false } }));
814
+ }
815
+ this.setBreakpoints(breakpoint_manager_1.BreakpointManager.DATA_URI, all);
816
+ }
817
+ setBreakpoints(uri, breakpoints) {
818
+ this._breakpoints.set(uri.toString(), breakpoints);
819
+ this.fireDidChangeBreakpoints(uri);
820
+ }
821
+ setSourceBreakpoints(uri, breakpoints) {
822
+ const distinct = this.dedupSourceBreakpoints(breakpoints);
823
+ this.setBreakpoints(uri, distinct);
824
+ }
825
+ dedupSourceBreakpoints(all) {
826
+ const positions = new Map();
827
+ for (const breakpoint of all) {
828
+ let primary = positions.get(breakpoint.renderPosition()) || breakpoint;
829
+ if (primary !== breakpoint) {
830
+ let secondary = breakpoint;
831
+ if (secondary.raw && secondary.raw.line === secondary.origin.raw.line && secondary.raw.column === secondary.origin.raw.column) {
832
+ [primary, secondary] = [breakpoint, primary];
833
+ }
834
+ primary.origins.push(...secondary.origins);
835
+ }
836
+ positions.set(primary.renderPosition(), primary);
837
+ }
838
+ return [...positions.values()];
839
+ }
840
+ *getAffectedUris(uri) {
841
+ if (uri) {
842
+ yield uri;
843
+ }
844
+ else {
845
+ for (const uriString of this.breakpoints.getUris()) {
846
+ yield new uri_1.default(uriString);
847
+ }
848
+ yield breakpoint_manager_1.BreakpointManager.FUNCTION_URI;
849
+ yield breakpoint_manager_1.BreakpointManager.EXCEPTION_URI;
850
+ yield breakpoint_manager_1.BreakpointManager.DATA_URI;
851
+ }
852
+ }
853
+ asDebugBreakpointOptions() {
854
+ const { labelProvider, breakpoints, editorManager } = this;
855
+ return { labelProvider, breakpoints, editorManager, session: this };
856
+ }
857
+ get label() {
858
+ const suffixes = [];
859
+ if (debug_session_options_1.InternalDebugSessionOptions.is(this.options) && this.options.id) {
860
+ suffixes.push(String(this.options.id + 1));
861
+ }
862
+ if (this.workspaceService.isMultiRootWorkspaceOpened && this.options.workspaceFolderUri) {
863
+ suffixes.push(this.labelProvider.getName(new uri_1.default(this.options.workspaceFolderUri)));
864
+ }
865
+ return suffixes.length === 0 ? this.configuration.name : this.configuration.name + ` (${suffixes.join(' - ')})`;
866
+ }
867
+ get visible() {
868
+ return this.state > DebugState.Inactive;
869
+ }
870
+ render() {
871
+ let label = '';
872
+ const state = this.state === DebugState.Stopped ? core_1.nls.localizeByDefault('Paused') : core_1.nls.localizeByDefault('Running');
873
+ const child = this.getSingleChildSession();
874
+ if (child && child.configuration.compact) {
875
+ // Inlines the name of the child debug session
876
+ label = `: ${child.label}`;
877
+ }
878
+ return React.createElement("div", { className: 'theia-debug-session', title: 'Session' },
879
+ React.createElement("span", { className: 'label' }, this.label + label),
880
+ React.createElement("span", { className: 'status' }, state));
881
+ }
882
+ *getElements() {
883
+ const child = this.getSingleChildSession();
884
+ if (child && child.configuration.compact) {
885
+ // Inlines the elements of the child debug session
886
+ return yield* child.getElements();
887
+ }
888
+ yield* this.threads;
889
+ yield* this.childSessions.values();
890
+ }
891
+ getSingleChildSession() {
892
+ if (this._threads.size === 0 && this.childSessions.size === 1) {
893
+ const child = this.childSessions.values().next().value;
894
+ return child;
895
+ }
896
+ return undefined;
897
+ }
898
+ async handleContinued({ body: { allThreadsContinued, threadId } }) {
899
+ if (allThreadsContinued !== false) {
900
+ this.clearThreads();
901
+ }
902
+ else {
903
+ this.clearThread(threadId);
904
+ }
905
+ }
906
+ ;
907
+ async handleStopped({ body }) {
908
+ // Update thread list
909
+ await this.updateThreads(body);
910
+ // Update current thread's frames immediately
911
+ await this.updateFrames();
912
+ }
913
+ ;
914
+ async handleThread({ body: { reason, threadId } }) {
915
+ if (reason === 'started') {
916
+ this.scheduleUpdateThreads();
917
+ }
918
+ else if (reason === 'exited') {
919
+ this._threads.delete(threadId);
920
+ this.updateCurrentThread();
921
+ }
922
+ }
923
+ ;
924
+ registerDebugContributions(configType, connection) {
925
+ for (const contrib of this.debugContributionProvider.getContributions()) {
926
+ contrib.register(configType, connection);
927
+ }
928
+ }
929
+ ;
930
+ /**
931
+ * Returns the top-most parent session that is responsible for the console. If this session uses a {@link DebugConsoleMode.Separate separate console}
932
+ * or does not have any parent session, undefined is returned.
933
+ */
934
+ findConsoleParent() {
935
+ if (this.configuration.consoleMode !== debug_common_1.DebugConsoleMode.MergeWithParent) {
936
+ return undefined;
937
+ }
938
+ let debugSession = this;
939
+ do {
940
+ debugSession = debugSession.parentSession;
941
+ } while ((debugSession === null || debugSession === void 0 ? void 0 : debugSession.parentSession) && debugSession.configuration.consoleMode === debug_common_1.DebugConsoleMode.MergeWithParent);
942
+ return debugSession;
943
+ }
944
+ }
945
+ exports.DebugSession = DebugSession;
946
+ //# sourceMappingURL=debug-session.js.map