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

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