@opensumi/ide-debug 2.21.10-rc-1671677903.0 → 2.21.10

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 (330) hide show
  1. package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
  2. package/lib/browser/breakpoint/breakpoint-marker.d.ts +1 -1
  3. package/lib/browser/breakpoint/breakpoint-marker.d.ts.map +1 -1
  4. package/lib/browser/breakpoint/breakpoint-marker.js +2 -3
  5. package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -1
  6. package/lib/browser/contextkeys/debug-call-stack-item-type-key.d.ts +1 -1
  7. package/lib/browser/contextkeys/debug-call-stack-item-type-key.d.ts.map +1 -1
  8. package/lib/browser/contextkeys/debug-contextkey.service.js.map +1 -1
  9. package/lib/browser/debug-configuration-manager.d.ts +2 -2
  10. package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
  11. package/lib/browser/debug-configuration-manager.js +1 -1
  12. package/lib/browser/debug-configuration-manager.js.map +1 -1
  13. package/lib/browser/debug-contribution.d.ts +147 -2
  14. package/lib/browser/debug-contribution.d.ts.map +1 -1
  15. package/lib/browser/debug-contribution.js +197 -48
  16. package/lib/browser/debug-contribution.js.map +1 -1
  17. package/lib/browser/debug-exception-widget.js.map +1 -1
  18. package/lib/browser/debug-link-detector.js.map +1 -1
  19. package/lib/browser/debug-memory.js +4 -4
  20. package/lib/browser/debug-memory.js.map +1 -1
  21. package/lib/browser/debug-preferences.d.ts +1 -1
  22. package/lib/browser/debug-preferences.d.ts.map +1 -1
  23. package/lib/browser/debug-progress.service.js.map +1 -1
  24. package/lib/browser/debug-schema-updater.js.map +1 -1
  25. package/lib/browser/debug-service.js.map +1 -1
  26. package/lib/browser/debug-session-connection.d.ts +3 -2
  27. package/lib/browser/debug-session-connection.d.ts.map +1 -1
  28. package/lib/browser/debug-session-connection.js.map +1 -1
  29. package/lib/browser/debug-session-contribution.js.map +1 -1
  30. package/lib/browser/debug-session-manager.d.ts +4 -3
  31. package/lib/browser/debug-session-manager.d.ts.map +1 -1
  32. package/lib/browser/debug-session-manager.js +8 -7
  33. package/lib/browser/debug-session-manager.js.map +1 -1
  34. package/lib/browser/debug-session.d.ts +4 -3
  35. package/lib/browser/debug-session.d.ts.map +1 -1
  36. package/lib/browser/debug-session.js +11 -15
  37. package/lib/browser/debug-session.js.map +1 -1
  38. package/lib/browser/debugUtils.js +4 -4
  39. package/lib/browser/debugUtils.js.map +1 -1
  40. package/lib/browser/editor/debug-breakpoint-widget.js.map +1 -1
  41. package/lib/browser/editor/debug-breakpoint-zone-widget.js +7 -7
  42. package/lib/browser/editor/debug-breakpoint-zone-widget.js.map +1 -1
  43. package/lib/browser/editor/debug-editor-contribution.d.ts +2 -2
  44. package/lib/browser/editor/debug-editor-contribution.d.ts.map +1 -1
  45. package/lib/browser/editor/debug-editor-contribution.js +4 -3
  46. package/lib/browser/editor/debug-editor-contribution.js.map +1 -1
  47. package/lib/browser/editor/debug-expression-provider.js.map +1 -1
  48. package/lib/browser/editor/debug-hover-model.js.map +1 -1
  49. package/lib/browser/editor/debug-hover-source.d.ts +1 -1
  50. package/lib/browser/editor/debug-hover-source.d.ts.map +1 -1
  51. package/lib/browser/editor/debug-hover-source.js.map +1 -1
  52. package/lib/browser/editor/debug-hover-tree.model.service.js.map +1 -1
  53. package/lib/browser/editor/debug-hover-widget.js.map +1 -1
  54. package/lib/browser/editor/debug-model-manager.d.ts +9 -2
  55. package/lib/browser/editor/debug-model-manager.d.ts.map +1 -1
  56. package/lib/browser/editor/debug-model-manager.js +15 -8
  57. package/lib/browser/editor/debug-model-manager.js.map +1 -1
  58. package/lib/browser/editor/debug-model.d.ts +2 -2
  59. package/lib/browser/editor/debug-model.d.ts.map +1 -1
  60. package/lib/browser/editor/debug-model.js +27 -27
  61. package/lib/browser/editor/debug-model.js.map +1 -1
  62. package/lib/browser/editor/debug-run-to-cursor.service.js +7 -7
  63. package/lib/browser/editor/debug-run-to-cursor.service.js.map +1 -1
  64. package/lib/browser/editor/evaluatable-expression.js.map +1 -1
  65. package/lib/browser/index.d.ts +14 -0
  66. package/lib/browser/index.d.ts.map +1 -1
  67. package/lib/browser/index.js +24 -8
  68. package/lib/browser/index.js.map +1 -1
  69. package/lib/browser/markers/marker-manager.js.map +1 -1
  70. package/lib/browser/model/debug-source.d.ts +3 -3
  71. package/lib/browser/model/debug-source.d.ts.map +1 -1
  72. package/lib/browser/model/debug-source.js.map +1 -1
  73. package/lib/browser/model/debug-thread.d.ts +1 -1
  74. package/lib/browser/model/debug-thread.d.ts.map +1 -1
  75. package/lib/browser/model/debug-watch.d.ts.map +1 -1
  76. package/lib/browser/model/debug-watch.js +2 -1
  77. package/lib/browser/model/debug-watch.js.map +1 -1
  78. package/lib/browser/preferences/launch-folder-preference-provider.d.ts +2 -2
  79. package/lib/browser/preferences/launch-folder-preference-provider.d.ts.map +1 -1
  80. package/lib/browser/preferences/launch-folder-preference-provider.js +2 -2
  81. package/lib/browser/preferences/launch-folder-preference-provider.js.map +1 -1
  82. package/lib/browser/preferences/launch-preferences-contribution.js.map +1 -1
  83. package/lib/browser/tree/debug-console-tree-node.define.js +6 -6
  84. package/lib/browser/tree/debug-console-tree-node.define.js.map +1 -1
  85. package/lib/browser/tree/debug-tree-node.define.js +18 -18
  86. package/lib/browser/tree/debug-tree-node.define.js.map +1 -1
  87. package/lib/browser/view/breakpoints/debug-breakpoints.service.js +3 -3
  88. package/lib/browser/view/breakpoints/debug-breakpoints.service.js.map +1 -1
  89. package/lib/browser/view/configuration/debug-configuration.module.less +5 -5
  90. package/lib/browser/view/configuration/debug-configuration.service.d.ts +2 -1
  91. package/lib/browser/view/configuration/debug-configuration.service.d.ts.map +1 -1
  92. package/lib/browser/view/configuration/debug-configuration.service.js.map +1 -1
  93. package/lib/browser/view/configuration/debug-configuration.view.d.ts.map +1 -1
  94. package/lib/browser/view/configuration/debug-configuration.view.js +1 -1
  95. package/lib/browser/view/configuration/debug-configuration.view.js.map +1 -1
  96. package/lib/browser/view/configuration/debug-toolbar.service.js.map +1 -1
  97. package/lib/browser/view/configuration/debug-toolbar.view.js +2 -2
  98. package/lib/browser/view/configuration/debug-toolbar.view.js.map +1 -1
  99. package/lib/browser/view/console/debug-console-filter.model.js.map +1 -1
  100. package/lib/browser/view/console/debug-console-filter.service.js.map +1 -1
  101. package/lib/browser/view/console/debug-console-model.js.map +1 -1
  102. package/lib/browser/view/console/debug-console-session.d.ts +2 -3
  103. package/lib/browser/view/console/debug-console-session.d.ts.map +1 -1
  104. package/lib/browser/view/console/debug-console-session.js.map +1 -1
  105. package/lib/browser/view/console/debug-console-tree.model.service.d.ts +1 -1
  106. package/lib/browser/view/console/debug-console-tree.model.service.d.ts.map +1 -1
  107. package/lib/browser/view/console/debug-console-tree.model.service.js.map +1 -1
  108. package/lib/browser/view/console/debug-console.contribution.d.ts.map +1 -1
  109. package/lib/browser/view/console/debug-console.contribution.js +23 -21
  110. package/lib/browser/view/console/debug-console.contribution.js.map +1 -1
  111. package/lib/browser/view/console/debug-console.module.less +1 -2
  112. package/lib/browser/view/console/debug-console.service.js +7 -7
  113. package/lib/browser/view/console/debug-console.service.js.map +1 -1
  114. package/lib/browser/view/console/debug-console.view.d.ts +1 -1
  115. package/lib/browser/view/console/debug-console.view.d.ts.map +1 -1
  116. package/lib/browser/view/console/debug-console.view.js +3 -15
  117. package/lib/browser/view/console/debug-console.view.js.map +1 -1
  118. package/lib/browser/view/debug-view-model.js.map +1 -1
  119. package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts.map +1 -1
  120. package/lib/browser/view/frames/debug-call-stack-frame.view.js +24 -25
  121. package/lib/browser/view/frames/debug-call-stack-frame.view.js.map +1 -1
  122. package/lib/browser/view/frames/debug-call-stack-session.view.d.ts.map +1 -1
  123. package/lib/browser/view/frames/debug-call-stack-session.view.js +5 -8
  124. package/lib/browser/view/frames/debug-call-stack-session.view.js.map +1 -1
  125. package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts.map +1 -1
  126. package/lib/browser/view/frames/debug-call-stack-thread.view.js +7 -12
  127. package/lib/browser/view/frames/debug-call-stack-thread.view.js.map +1 -1
  128. package/lib/browser/view/frames/debug-call-stack.contribution.js +5 -5
  129. package/lib/browser/view/frames/debug-call-stack.contribution.js.map +1 -1
  130. package/lib/browser/view/frames/debug-call-stack.service.js.map +1 -1
  131. package/lib/browser/view/variables/debug-variables-model.js.map +1 -1
  132. package/lib/browser/view/variables/debug-variables-tree.model.service.d.ts +1 -1
  133. package/lib/browser/view/variables/debug-variables-tree.model.service.d.ts.map +1 -1
  134. package/lib/browser/view/variables/debug-variables-tree.model.service.js.map +1 -1
  135. package/lib/browser/view/variables/debug-variables.contribution.d.ts.map +1 -1
  136. package/lib/browser/view/variables/debug-variables.contribution.js +13 -12
  137. package/lib/browser/view/variables/debug-variables.contribution.js.map +1 -1
  138. package/lib/browser/view/variables/debug-variables.module.less +1 -2
  139. package/lib/browser/view/variables/debug-variables.view.d.ts +1 -1
  140. package/lib/browser/view/variables/debug-variables.view.d.ts.map +1 -1
  141. package/lib/browser/view/variables/debug-variables.view.js +1 -1
  142. package/lib/browser/view/variables/debug-variables.view.js.map +1 -1
  143. package/lib/browser/view/watch/debug-watch-model.js.map +1 -1
  144. package/lib/browser/view/watch/debug-watch-tree.model.service.d.ts +2 -2
  145. package/lib/browser/view/watch/debug-watch-tree.model.service.d.ts.map +1 -1
  146. package/lib/browser/view/watch/debug-watch-tree.model.service.js.map +1 -1
  147. package/lib/browser/view/watch/debug-watch.contribution.d.ts.map +1 -1
  148. package/lib/browser/view/watch/debug-watch.contribution.js +19 -21
  149. package/lib/browser/view/watch/debug-watch.contribution.js.map +1 -1
  150. package/lib/browser/view/watch/debug-watch.module.less +1 -2
  151. package/lib/browser/view/watch/debug-watch.view.d.ts +1 -1
  152. package/lib/browser/view/watch/debug-watch.view.d.ts.map +1 -1
  153. package/lib/browser/view/watch/debug-watch.view.js +1 -1
  154. package/lib/browser/view/watch/debug-watch.view.js.map +1 -1
  155. package/lib/common/debug-breakpoint.d.ts +3 -3
  156. package/lib/common/debug-breakpoint.d.ts.map +1 -1
  157. package/lib/common/debug-configuration.d.ts +1 -1
  158. package/lib/common/debug-configuration.d.ts.map +1 -1
  159. package/lib/common/debug-editor.d.ts +1 -1
  160. package/lib/common/debug-editor.d.ts.map +1 -1
  161. package/lib/common/debug-model.d.ts +4 -19
  162. package/lib/common/debug-model.d.ts.map +1 -1
  163. package/lib/common/debug-model.js +6 -14
  164. package/lib/common/debug-model.js.map +1 -1
  165. package/lib/common/debug-service.d.ts +1 -1
  166. package/lib/common/debug-service.d.ts.map +1 -1
  167. package/lib/common/debug-session.d.ts +1 -1
  168. package/lib/common/debug-session.d.ts.map +1 -1
  169. package/lib/common/index.d.ts +0 -2
  170. package/lib/common/index.d.ts.map +1 -1
  171. package/lib/common/index.js +0 -2
  172. package/lib/common/index.js.map +1 -1
  173. package/lib/common/inline-values.d.ts +1 -1
  174. package/lib/common/inline-values.d.ts.map +1 -1
  175. package/lib/common/terminal.js +10 -10
  176. package/lib/common/terminal.js.map +1 -1
  177. package/package.json +25 -24
  178. package/lib/common/commands.d.ts +0 -46
  179. package/lib/common/commands.d.ts.map +0 -1
  180. package/lib/common/commands.js +0 -149
  181. package/lib/common/commands.js.map +0 -1
  182. package/lib/common/debug-console.d.ts +0 -18
  183. package/lib/common/debug-console.d.ts.map +0 -1
  184. package/lib/common/debug-console.js +0 -5
  185. package/lib/common/debug-console.js.map +0 -1
  186. package/src/browser/assets/breakpoint-conditional-disabled.svg +0 -4
  187. package/src/browser/assets/breakpoint-conditional-unverified.svg +0 -4
  188. package/src/browser/assets/breakpoint-conditional.svg +0 -4
  189. package/src/browser/assets/breakpoint-disabled.svg +0 -4
  190. package/src/browser/assets/breakpoint-hint.svg +0 -4
  191. package/src/browser/assets/breakpoint-log-disabled.svg +0 -4
  192. package/src/browser/assets/breakpoint-log-unverified.svg +0 -4
  193. package/src/browser/assets/breakpoint-log.svg +0 -4
  194. package/src/browser/assets/breakpoint-unsupported.svg +0 -4
  195. package/src/browser/assets/breakpoint-unverified.svg +0 -4
  196. package/src/browser/assets/breakpoint.svg +0 -4
  197. package/src/browser/assets/breakpoints-activate-inverse.svg +0 -4
  198. package/src/browser/assets/breakpoints-activate.svg +0 -4
  199. package/src/browser/assets/configure-inverse.svg +0 -4
  200. package/src/browser/assets/configure.svg +0 -4
  201. package/src/browser/assets/continue-inverse.svg +0 -4
  202. package/src/browser/assets/current-and-breakpoint.svg +0 -4
  203. package/src/browser/assets/current-arrow.svg +0 -4
  204. package/src/browser/assets/remove-all-inverse.svg +0 -4
  205. package/src/browser/assets/remove-all.svg +0 -4
  206. package/src/browser/assets/repl-inverse.svg +0 -4
  207. package/src/browser/assets/repl.svg +0 -4
  208. package/src/browser/assets/restart-inverse.svg +0 -4
  209. package/src/browser/assets/stackframe-and-breakpoint.svg +0 -4
  210. package/src/browser/assets/stackframe-arrow.svg +0 -4
  211. package/src/browser/assets/start-inverse.svg +0 -4
  212. package/src/browser/breakpoint/breakpoint-decoration.ts +0 -57
  213. package/src/browser/breakpoint/breakpoint-manager.ts +0 -348
  214. package/src/browser/breakpoint/breakpoint-marker.ts +0 -70
  215. package/src/browser/breakpoint/index.ts +0 -3
  216. package/src/browser/components/debug-action/index.module.less +0 -73
  217. package/src/browser/components/debug-action/index.tsx +0 -40
  218. package/src/browser/components/debug-exception-widget.less +0 -42
  219. package/src/browser/components/floating-click-widget/index.module.less +0 -5
  220. package/src/browser/components/floating-click-widget/index.tsx +0 -21
  221. package/src/browser/components/index.ts +0 -1
  222. package/src/browser/contextkeys/debug-call-stack-item-type-key.ts +0 -4
  223. package/src/browser/contextkeys/debug-contextkey.service.ts +0 -54
  224. package/src/browser/contextkeys/index.ts +0 -1
  225. package/src/browser/debug-ansi-handle.ts +0 -521
  226. package/src/browser/debug-configuration-manager.ts +0 -513
  227. package/src/browser/debug-configuration-model.ts +0 -66
  228. package/src/browser/debug-contribution.ts +0 -757
  229. package/src/browser/debug-exception-widget.tsx +0 -89
  230. package/src/browser/debug-link-detector.ts +0 -234
  231. package/src/browser/debug-memory.ts +0 -220
  232. package/src/browser/debug-preferences.ts +0 -70
  233. package/src/browser/debug-progress.service.ts +0 -122
  234. package/src/browser/debug-schema-updater.ts +0 -67
  235. package/src/browser/debug-service.ts +0 -42
  236. package/src/browser/debug-session-connection.ts +0 -331
  237. package/src/browser/debug-session-contribution.ts +0 -57
  238. package/src/browser/debug-session-manager.ts +0 -622
  239. package/src/browser/debug-session.ts +0 -1181
  240. package/src/browser/debug-style.less +0 -128
  241. package/src/browser/debugUtils.ts +0 -110
  242. package/src/browser/editor/debug-breakpoint-widget.ts +0 -99
  243. package/src/browser/editor/debug-breakpoint-zone-widget.tsx +0 -262
  244. package/src/browser/editor/debug-breakpoint.module.less +0 -31
  245. package/src/browser/editor/debug-editor-contribution.ts +0 -589
  246. package/src/browser/editor/debug-expression-provider.ts +0 -101
  247. package/src/browser/editor/debug-hover-model.ts +0 -38
  248. package/src/browser/editor/debug-hover-source.ts +0 -107
  249. package/src/browser/editor/debug-hover-tree.model.service.ts +0 -332
  250. package/src/browser/editor/debug-hover-widget.tsx +0 -200
  251. package/src/browser/editor/debug-hover.module.less +0 -29
  252. package/src/browser/editor/debug-hover.view.tsx +0 -147
  253. package/src/browser/editor/debug-model-manager.ts +0 -219
  254. package/src/browser/editor/debug-model.ts +0 -853
  255. package/src/browser/editor/debug-run-to-cursor.service.ts +0 -180
  256. package/src/browser/editor/debug-styles.ts +0 -66
  257. package/src/browser/editor/evaluatable-expression.ts +0 -47
  258. package/src/browser/editor/index.ts +0 -6
  259. package/src/browser/index.ts +0 -119
  260. package/src/browser/markers/index.ts +0 -2
  261. package/src/browser/markers/marker-manager.ts +0 -201
  262. package/src/browser/markers/marker.ts +0 -20
  263. package/src/browser/model/debug-source.ts +0 -144
  264. package/src/browser/model/debug-stack-frame.ts +0 -111
  265. package/src/browser/model/debug-thread.ts +0 -186
  266. package/src/browser/model/debug-watch.ts +0 -129
  267. package/src/browser/model/index.ts +0 -4
  268. package/src/browser/preferences/launch-folder-preference-provider.ts +0 -23
  269. package/src/browser/preferences/launch-preferences-contribution.ts +0 -9
  270. package/src/browser/preferences/launch-preferences.ts +0 -16
  271. package/src/browser/tree/debug-console-tree-node.define.tsx +0 -76
  272. package/src/browser/tree/debug-tree-node.define.ts +0 -768
  273. package/src/browser/tree/index.ts +0 -2
  274. package/src/browser/view/breakpoints/debug-breakpoints.module.less +0 -72
  275. package/src/browser/view/breakpoints/debug-breakpoints.service.ts +0 -217
  276. package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +0 -174
  277. package/src/browser/view/configuration/debug-configuration.module.less +0 -110
  278. package/src/browser/view/configuration/debug-configuration.service.ts +0 -170
  279. package/src/browser/view/configuration/debug-configuration.view.tsx +0 -252
  280. package/src/browser/view/configuration/debug-toolbar.service.ts +0 -167
  281. package/src/browser/view/configuration/debug-toolbar.view.tsx +0 -335
  282. package/src/browser/view/console/debug-console-filter.model.ts +0 -49
  283. package/src/browser/view/console/debug-console-filter.service.ts +0 -81
  284. package/src/browser/view/console/debug-console-filter.view.tsx +0 -78
  285. package/src/browser/view/console/debug-console-model.ts +0 -48
  286. package/src/browser/view/console/debug-console-session.ts +0 -165
  287. package/src/browser/view/console/debug-console-toolbar.view.tsx +0 -28
  288. package/src/browser/view/console/debug-console-tree.model.service.ts +0 -550
  289. package/src/browser/view/console/debug-console.contribution.ts +0 -179
  290. package/src/browser/view/console/debug-console.module.less +0 -373
  291. package/src/browser/view/console/debug-console.service.ts +0 -433
  292. package/src/browser/view/console/debug-console.view.tsx +0 -511
  293. package/src/browser/view/debug-view-model.ts +0 -182
  294. package/src/browser/view/frames/debug-call-stack-frame.view.tsx +0 -230
  295. package/src/browser/view/frames/debug-call-stack-session.view.tsx +0 -253
  296. package/src/browser/view/frames/debug-call-stack-thread.view.tsx +0 -103
  297. package/src/browser/view/frames/debug-call-stack.contribution.ts +0 -88
  298. package/src/browser/view/frames/debug-call-stack.module.less +0 -193
  299. package/src/browser/view/frames/debug-call-stack.operation.tsx +0 -97
  300. package/src/browser/view/frames/debug-call-stack.service.ts +0 -105
  301. package/src/browser/view/frames/debug-call-stack.view.tsx +0 -43
  302. package/src/browser/view/variables/debug-variables-model.ts +0 -38
  303. package/src/browser/view/variables/debug-variables-tree.model.service.ts +0 -467
  304. package/src/browser/view/variables/debug-variables.contribution.ts +0 -243
  305. package/src/browser/view/variables/debug-variables.module.less +0 -149
  306. package/src/browser/view/variables/debug-variables.view.tsx +0 -303
  307. package/src/browser/view/watch/debug-watch-model.ts +0 -38
  308. package/src/browser/view/watch/debug-watch-tree.model.service.ts +0 -567
  309. package/src/browser/view/watch/debug-watch.contribution.ts +0 -170
  310. package/src/browser/view/watch/debug-watch.module.less +0 -189
  311. package/src/browser/view/watch/debug-watch.view.tsx +0 -337
  312. package/src/common/commands.ts +0 -146
  313. package/src/common/constants.ts +0 -81
  314. package/src/common/debug-breakpoint.ts +0 -43
  315. package/src/common/debug-configuration.ts +0 -68
  316. package/src/common/debug-console.ts +0 -20
  317. package/src/common/debug-editor.ts +0 -4
  318. package/src/common/debug-hover.ts +0 -31
  319. package/src/common/debug-model.ts +0 -272
  320. package/src/common/debug-progress.ts +0 -8
  321. package/src/common/debug-schema-updater.ts +0 -1
  322. package/src/common/debug-service.ts +0 -176
  323. package/src/common/debug-session-options.ts +0 -19
  324. package/src/common/debug-session.ts +0 -200
  325. package/src/common/evaluatable-expression.ts +0 -43
  326. package/src/common/index.ts +0 -16
  327. package/src/common/inline-values.ts +0 -77
  328. package/src/common/terminal.ts +0 -163
  329. package/src/common/types.ts +0 -86
  330. package/src/index.ts +0 -1
@@ -1,768 +0,0 @@
1
- import { TreeNode, CompositeTreeNode, ITree, ITreeNodeOrCompositeTreeNode } from '@opensumi/ide-components';
2
- import { MessageType, localize } from '@opensumi/ide-core-browser';
3
- import { IRange, isDefined } from '@opensumi/ide-core-common';
4
- import { Range } from '@opensumi/monaco-editor-core/esm/vs/editor/common/core/range';
5
- import { DebugProtocol } from '@opensumi/vscode-debugprotocol/lib/debugProtocol';
6
-
7
- import { DebugSession } from '../debug-session';
8
-
9
- import { AnsiConsoleNode } from './debug-console-tree-node.define';
10
-
11
- const UNDEFINED_VALUE = 'undefined';
12
-
13
- export class ExpressionTreeService {
14
- constructor(private session?: DebugSession, private source?: DebugProtocol.Source, private line?: number | string) {}
15
-
16
- async resolveChildren(
17
- parent?: ExpressionContainer,
18
- ): Promise<(ExpressionContainer | ExpressionNode | DebugVirtualVariable)[]> {
19
- if (DebugVariableRoot.is(parent) && !parent.variablesReference && !parent.presetChildren) {
20
- return (await this.session?.getScopes(parent)) || [];
21
- }
22
- return await this.doResolve(parent);
23
- }
24
-
25
- protected async doResolve(
26
- parent?: ExpressionContainer,
27
- ): Promise<(ExpressionContainer | DebugVirtualVariable | ExpressionNode)[]> {
28
- const result: (ExpressionContainer | DebugVirtualVariable)[] = [];
29
- if (!parent) {
30
- return result;
31
- }
32
- if (Array.isArray(parent.presetChildren)) {
33
- return parent.presetChildren;
34
- }
35
- if (!this.session || this.session.terminated) {
36
- return result;
37
- }
38
- const { variablesReference, startOfVariables, indexedVariables } = parent;
39
- if (parent.namedVariables) {
40
- await this.fetch(result, variablesReference, 'named', parent);
41
- }
42
- if (indexedVariables) {
43
- let chunkSize = ExpressionContainer.BASE_CHUNK_SIZE;
44
- while (indexedVariables > chunkSize * ExpressionContainer.BASE_CHUNK_SIZE) {
45
- chunkSize *= ExpressionContainer.BASE_CHUNK_SIZE;
46
- }
47
- if (indexedVariables > chunkSize) {
48
- const numberOfChunks = Math.ceil(indexedVariables / chunkSize);
49
- for (let i = 0; i < numberOfChunks; i++) {
50
- const start = parent.startOfVariables + i * chunkSize;
51
- const count = Math.min(chunkSize, indexedVariables - i * chunkSize);
52
- result.push(
53
- new DebugVirtualVariable(
54
- {
55
- session: this.session,
56
- variablesReference: parent.variablesReference,
57
- namedVariables: 0,
58
- indexedVariables: count,
59
- startOfVariables: start,
60
- name: `[${start}..${start + count - 1}]`,
61
- },
62
- parent,
63
- ),
64
- );
65
- }
66
- return result;
67
- }
68
- }
69
- await this.fetch(result, variablesReference, 'indexed', parent, startOfVariables, indexedVariables);
70
- return result;
71
- }
72
-
73
- protected fetch(
74
- result: any,
75
- variablesReference: number,
76
- filter: 'named',
77
- parent?: ExpressionContainer,
78
- ): Promise<void>;
79
- protected fetch(
80
- result: any,
81
- variablesReference: number,
82
- filter: 'indexed',
83
- parent: ExpressionContainer,
84
- start: number,
85
- count?: number,
86
- ): Promise<void>;
87
- protected async fetch(
88
- result: any,
89
- variablesReference: number,
90
- filter: 'indexed' | 'named',
91
- parent?: ExpressionContainer,
92
- start?: number,
93
- count?: number,
94
- ): Promise<void> {
95
- try {
96
- const response = await this.session!.sendRequest('variables', { variablesReference, filter, start, count });
97
- const { variables } = response.body;
98
- for (const variable of variables) {
99
- if (variable.variablesReference) {
100
- result.push(new DebugVariableContainer(this.session, variable, parent, this.source, this.line));
101
- } else {
102
- result.push(new DebugVariable((this as any).session, variable, parent));
103
- }
104
- }
105
- } catch (e) {
106
- result.push({
107
- severity: MessageType.Error,
108
- visible: !!e.message,
109
- message: e.message,
110
- });
111
- }
112
- }
113
-
114
- sortComparator(a: ITreeNodeOrCompositeTreeNode, b: ITreeNodeOrCompositeTreeNode) {
115
- // 当存在 variablesReference 属性时,默认按大小进行排序
116
- if (isDefined((a as any).variablesReference) && isDefined((b as any).variablesReference)) {
117
- return (a as any).variablesReference - (b as any).variablesReference;
118
- }
119
- if (a.constructor === b.constructor) {
120
- return a.name > b.name ? 1 : a.name < b.name ? -1 : 0;
121
- }
122
- return CompositeTreeNode.is(a) ? 1 : CompositeTreeNode.is(b) ? -1 : 0;
123
- }
124
- }
125
-
126
- export class DebugConsoleTreeService extends ExpressionTreeService {
127
- // 按照默认次序排序
128
- sortComparator(a: ITreeNodeOrCompositeTreeNode, b: ITreeNodeOrCompositeTreeNode) {
129
- if (!a) {
130
- return 1;
131
- }
132
- if (!b) {
133
- return -1;
134
- }
135
- return 0;
136
- }
137
- }
138
-
139
- export class ExpressionNode extends TreeNode {
140
- public source: DebugProtocol.Source | undefined;
141
- public line: number | string | undefined;
142
- public variablesReference: number;
143
- public namedVariables: number | undefined;
144
- public indexedVariables: number | undefined;
145
- public memoryReference: string | undefined;
146
-
147
- constructor(options: ExpressionNode.Options, parent?: ExpressionContainer) {
148
- super(new ExpressionTreeService(options.session, options.source, options.line) as ITree, parent, undefined, {
149
- name: String(options.session?.id),
150
- });
151
- this.variablesReference = options.variablesReference || 0;
152
- this.namedVariables = options.namedVariables;
153
- this.indexedVariables = options.indexedVariables;
154
- this.memoryReference = options.memoryReference;
155
- this.source = options.source;
156
- this.line = options.line;
157
- }
158
-
159
- get badge() {
160
- return this.source ? `${this.source.name}:${this.line}` : '';
161
- }
162
-
163
- get displayName() {
164
- return this.name;
165
- }
166
- }
167
-
168
- export namespace ExpressionNode {
169
- export interface Options {
170
- session: DebugSession | undefined;
171
- variablesReference: number;
172
- namedVariables?: number;
173
- indexedVariables?: number;
174
- startOfVariables?: number;
175
- memoryReference?: string;
176
- source?: DebugProtocol.Source;
177
- line?: number | string;
178
- }
179
- }
180
-
181
- export class ExpressionContainer extends CompositeTreeNode {
182
- public static readonly BASE_CHUNK_SIZE = 100;
183
-
184
- protected readonly session: DebugSession | undefined;
185
- public variablesReference: number;
186
- public namedVariables: number | undefined;
187
- public indexedVariables: number | undefined;
188
- public startOfVariables: number;
189
- public memoryReference: string | undefined;
190
-
191
- public source: DebugProtocol.Source | undefined;
192
- public line: number | string | undefined;
193
-
194
- public presetChildren: (ExpressionContainer | ExpressionNode)[];
195
-
196
- constructor(options: ExpressionContainer.Options, parent?: ExpressionContainer, tree?: ITree, name?: string) {
197
- super(
198
- tree || (new ExpressionTreeService(options.session, options.source, options.line) as ITree),
199
- parent,
200
- undefined,
201
- { name: name || options.session?.id },
202
- );
203
- this.session = options.session;
204
- this.variablesReference = options.variablesReference || 0;
205
- this.namedVariables = options.namedVariables;
206
- this.indexedVariables = options.indexedVariables;
207
- this.startOfVariables = options.startOfVariables || 0;
208
- this.memoryReference = options.memoryReference;
209
- this.source = options.source;
210
- this.line = options.line;
211
- }
212
-
213
- get badge() {
214
- return this.source ? `${this.source.name}:${this.line}` : '';
215
- }
216
-
217
- get displayName() {
218
- return this.name;
219
- }
220
-
221
- get path(): string {
222
- /**
223
- * 默认实现中,path 是通过 name 进行组装
224
- * 而在调试场景中,为了保证每个节点的唯一性,需要为每个节点指定唯一的 path 值
225
- * 故这里使用 id 作为 path 值
226
- */
227
- return String(this.id);
228
- }
229
- }
230
-
231
- export namespace ExpressionContainer {
232
- export interface Options {
233
- session: DebugSession | undefined;
234
- variablesReference?: number;
235
- namedVariables?: number;
236
- indexedVariables?: number;
237
- startOfVariables?: number;
238
- memoryReference?: string;
239
- source?: DebugProtocol.Source;
240
- line?: number | string;
241
- }
242
- }
243
-
244
- export namespace DebugVirtualVariable {
245
- export interface Options extends ExpressionContainer.Options {
246
- name: string;
247
- }
248
- }
249
-
250
- /**
251
- * 临时的变量节点,如数组节点需要通过该节点插件成[0..100]
252
- */
253
- export class DebugVirtualVariable extends ExpressionContainer {
254
- private _name: string;
255
-
256
- constructor(options: DebugVirtualVariable.Options, parent?: ExpressionContainer) {
257
- super(options, parent, undefined, options.name);
258
- this._name = options.name;
259
- }
260
- }
261
-
262
- export class DebugVariable extends ExpressionNode {
263
- constructor(
264
- public readonly session: DebugSession | undefined,
265
- /**
266
- * https://code.visualstudio.com/updates/v1_49#_contributable-context-menu-for-variables-view
267
- */
268
- public readonly variable: DebugProtocol.Variable & { __vscodeVariableMenuContext?: string },
269
- parent?: ExpressionContainer,
270
- ) {
271
- super(
272
- {
273
- session,
274
- variablesReference: variable.variablesReference,
275
- namedVariables: variable.namedVariables,
276
- indexedVariables: variable.indexedVariables,
277
- memoryReference: variable.memoryReference,
278
- },
279
- parent,
280
- );
281
- }
282
-
283
- get variableMenuContext(): string {
284
- return this.variable.__vscodeVariableMenuContext || '';
285
- }
286
-
287
- toDebugProtocolObject(): DebugProtocol.Variable {
288
- return {
289
- name: this.name,
290
- variablesReference: this.variable.variablesReference || 0,
291
- value: this.value,
292
- evaluateName: this.evaluateName,
293
- memoryReference: this.memoryReference,
294
- };
295
- }
296
-
297
- get name(): string {
298
- if (this.variable) {
299
- if (this.variable.name) {
300
- return this.variable.name;
301
- } else if (this.variable.evaluateName) {
302
- const isSymbolExpression = /\["(.+)"]/.exec(this.variable.evaluateName);
303
- if (isSymbolExpression) {
304
- return isSymbolExpression[1];
305
- } else {
306
- const evaluateProps = this.variable.evaluateName.split('.');
307
- return evaluateProps[evaluateProps.length - 1];
308
- }
309
- }
310
- }
311
- return String(this.id);
312
- }
313
-
314
- get evaluateName(): string {
315
- return this.variable?.evaluateName || '';
316
- }
317
-
318
- get description(): string {
319
- return this.value || UNDEFINED_VALUE;
320
- }
321
-
322
- protected _value: string | undefined;
323
- get value(): string {
324
- return this._value || this.variable.value;
325
- }
326
-
327
- protected _type: string | undefined;
328
- get variableType(): string | undefined {
329
- return this._type || this.variable.type;
330
- }
331
-
332
- get supportSetVariable(): boolean {
333
- return !!this.session && !!this.session.capabilities.supportsSetVariable;
334
- }
335
-
336
- async setValue(value: string): Promise<void> {
337
- if (!this.session || this.session.terminated) {
338
- return;
339
- }
340
- const { name, parent } = this;
341
- const variablesReference = (parent as DebugScope).variablesReference;
342
- try {
343
- const response = await this.session.sendRequest('setVariable', { variablesReference, name, value });
344
- this._value = response.body.value;
345
- this._type = response.body.type;
346
- this.variablesReference = response.body.variablesReference || 0;
347
- this.namedVariables = response.body.namedVariables;
348
- this.indexedVariables = response.body.indexedVariables;
349
- } catch (error) {
350
- throw error;
351
- }
352
- }
353
-
354
- public getRawScope(): DebugProtocol.Scope | undefined {
355
- let parent = this.parent;
356
- while (parent !== undefined && !(parent instanceof DebugScope)) {
357
- parent = parent?.parent;
358
- }
359
- return parent!.getRawScope();
360
- }
361
- }
362
-
363
- export class DebugVariableContainer extends ExpressionContainer {
364
- static BOOLEAN_REGEX = /^true|false$/i;
365
- static STRING_REGEX = /^(['"]).*\1$/;
366
-
367
- constructor(
368
- public readonly session: DebugSession | undefined,
369
- public readonly variable: DebugProtocol.Variable & { __vscodeVariableMenuContext?: string },
370
- parent: ExpressionContainer | undefined,
371
- source?: DebugProtocol.Source,
372
- line?: string | number,
373
- ) {
374
- super(
375
- {
376
- session,
377
- variablesReference: variable.variablesReference,
378
- namedVariables: variable.namedVariables,
379
- indexedVariables: variable.indexedVariables,
380
- memoryReference: variable.memoryReference,
381
- source,
382
- line,
383
- },
384
- parent,
385
- undefined,
386
- variable?.name ||
387
- (variable.evaluateName
388
- ? /\["(.+)"]/.exec(variable.evaluateName)
389
- ? /\["(.+)"]/.exec(variable.evaluateName)![1]
390
- : variable.evaluateName.split('.')[variable.evaluateName.split('.').length - 1]
391
- : ''),
392
- );
393
- }
394
-
395
- get variableMenuContext(): string {
396
- return this.variable.__vscodeVariableMenuContext || '';
397
- }
398
-
399
- toDebugProtocolObject(): DebugProtocol.Variable {
400
- return {
401
- name: this.name,
402
- variablesReference: this.variable.variablesReference || 0,
403
- value: this.value,
404
- evaluateName: this.evaluateName,
405
- memoryReference: this.memoryReference,
406
- };
407
- }
408
-
409
- get name(): string {
410
- if (this.variable) {
411
- if (this.variable.name) {
412
- return this.variable.name;
413
- } else if (this.variable.evaluateName) {
414
- const isSymbolExpression = /\["(.+)"]/.exec(this.variable.evaluateName);
415
- if (isSymbolExpression) {
416
- return isSymbolExpression[1];
417
- } else {
418
- const evaluateProps = this.variable.evaluateName.split('.');
419
- return evaluateProps[evaluateProps.length - 1];
420
- }
421
- }
422
- }
423
- return String(this.id);
424
- }
425
-
426
- get evaluateName(): string {
427
- return this.variable?.evaluateName || '';
428
- }
429
-
430
- get description(): string {
431
- return this._value || this.variable.value || UNDEFINED_VALUE;
432
- }
433
-
434
- get tooltip(): string {
435
- return this.variableType || this.description;
436
- }
437
-
438
- protected _variableType: string | undefined;
439
- get variableType(): string | undefined {
440
- return this._variableType || this.variable.type;
441
- }
442
-
443
- protected _value: string | undefined;
444
- get value(): string {
445
- return this._value || this.variable.value;
446
- }
447
-
448
- get supportSetVariable(): boolean {
449
- return !!this.session && !!this.session.capabilities.supportsSetVariable;
450
- }
451
-
452
- async setValue(value: string): Promise<void> {
453
- if (!this.session || this.session.terminated) {
454
- return;
455
- }
456
- const { name, parent } = this;
457
- if (!parent) {
458
- return;
459
- }
460
- const variablesReference = (parent as DebugScope).variablesReference;
461
- try {
462
- const response = await this.session.sendRequest('setVariable', { variablesReference, name, value });
463
- this._value = response.body.value;
464
- this._variableType = response.body.type;
465
- this.variablesReference = response.body.variablesReference || 0;
466
- this.namedVariables = response.body.namedVariables;
467
- this.indexedVariables = response.body.indexedVariables;
468
- } catch (error) {
469
- throw error;
470
- }
471
- }
472
-
473
- public getRawScope(): DebugProtocol.Scope | undefined {
474
- let parent = this.parent;
475
- while (parent !== undefined && !(parent instanceof DebugScope)) {
476
- parent = parent?.parent;
477
- }
478
- return parent!.getRawScope();
479
- }
480
- }
481
-
482
- export class DebugScope extends ExpressionContainer {
483
- constructor(
484
- protected readonly raw: DebugProtocol.Scope,
485
- protected readonly session: DebugSession,
486
- parent?: ExpressionContainer,
487
- ) {
488
- super(
489
- {
490
- session,
491
- variablesReference: raw.variablesReference,
492
- namedVariables: raw.namedVariables,
493
- indexedVariables: raw.indexedVariables,
494
- },
495
- parent,
496
- undefined,
497
- raw.name,
498
- );
499
- }
500
-
501
- public getRawScope(): DebugProtocol.Scope {
502
- return this.raw;
503
- }
504
-
505
- public range(): IRange | undefined {
506
- const rs = this.getRawScope();
507
- return rs.line && rs.column && rs.endLine && rs.endColumn
508
- ? new Range(rs.line, rs.column, rs.endLine, rs.endColumn)
509
- : undefined;
510
- }
511
- }
512
-
513
- export class DebugWatchNode extends ExpressionContainer {
514
- static notAvailable = localize('debug.watch.notAvailable');
515
-
516
- static is(node?: any): node is DebugWatchNode {
517
- return !!node && !!(node as DebugWatchNode).expression;
518
- }
519
-
520
- private _description: string;
521
- private _available: boolean;
522
- private raw: DebugProtocol.EvaluateResponse['body'];
523
-
524
- constructor(
525
- public readonly session: DebugSession | undefined,
526
- public readonly expression: string,
527
- parent: ExpressionContainer | undefined,
528
- ) {
529
- super(
530
- {
531
- session,
532
- },
533
- parent,
534
- undefined,
535
- expression,
536
- );
537
- }
538
-
539
- get description() {
540
- return this._available ? this._description || UNDEFINED_VALUE : DebugWatchNode.notAvailable;
541
- }
542
-
543
- get available() {
544
- return this._available;
545
- }
546
-
547
- public getRawWatch(): DebugProtocol.EvaluateResponse['body'] {
548
- return this.raw;
549
- }
550
-
551
- async evaluate(context = 'watch'): Promise<void> {
552
- if (this.session) {
553
- try {
554
- this._available = true;
555
- const { expression } = this;
556
- const body = await this.session.evaluate(expression, context);
557
- if (body) {
558
- this.name = this.expression;
559
- this._description = body.result;
560
- this.variablesReference = body.variablesReference;
561
- this.namedVariables = body.namedVariables;
562
- this.indexedVariables = body.indexedVariables;
563
- this.memoryReference = body.memoryReference;
564
- this.raw = body;
565
- }
566
- } catch (err) {
567
- this.name = this.expression;
568
- this._description = err.message;
569
- }
570
- } else {
571
- this.name = this.expression;
572
- this._available = false;
573
- }
574
- }
575
-
576
- async getClipboardValue() {
577
- if (this.session && this.session.capabilities.supportsValueFormattingOptions) {
578
- try {
579
- const { expression } = this;
580
- const body = await this.session.evaluate(expression, 'clipboard');
581
- if (body) {
582
- return body.result;
583
- }
584
- } catch (err) {
585
- return '';
586
- }
587
- } else {
588
- return this._description;
589
- }
590
- }
591
- }
592
-
593
- export class DebugConsoleVariableContainer extends DebugVariableContainer {
594
- static is(node?: any): node is DebugConsoleVariableContainer {
595
- return !!node && (node as DebugConsoleVariableContainer).uniqueID === DebugConsoleVariableContainer.uniqueID;
596
- }
597
-
598
- static uniqueID = 'DebugConsoleVariable';
599
-
600
- get uniqueID() {
601
- return DebugConsoleVariableContainer.uniqueID;
602
- }
603
-
604
- get description() {
605
- if (this.variable) {
606
- return this.variable.value;
607
- }
608
- return UNDEFINED_VALUE;
609
- }
610
-
611
- get tooltip() {
612
- if (this.variable) {
613
- return this.variable.value;
614
- }
615
- return '';
616
- }
617
- }
618
-
619
- export class DebugConsoleNode extends ExpressionContainer {
620
- static is(node?: any): node is DebugConsoleNode {
621
- return !!node && !!(node as DebugConsoleNode).expression;
622
- }
623
-
624
- private _available: boolean;
625
- private _description: string;
626
-
627
- get available() {
628
- return this._available;
629
- }
630
-
631
- constructor(
632
- public readonly session: DebugSession | undefined,
633
- public readonly expression: string,
634
- parent: ExpressionContainer | undefined,
635
- ) {
636
- super(
637
- {
638
- session,
639
- },
640
- parent,
641
- undefined,
642
- expression,
643
- );
644
- }
645
-
646
- get description() {
647
- return this._description || UNDEFINED_VALUE;
648
- }
649
-
650
- async evaluate(context = 'repl'): Promise<void> {
651
- const { expression } = this;
652
- if (this.session) {
653
- try {
654
- if (typeof expression === 'string') {
655
- const body = await this.session.evaluate(expression, context);
656
- if (body) {
657
- this.name = expression;
658
- this._description = body.result;
659
- this.variablesReference = body.variablesReference;
660
- this.namedVariables = body.namedVariables;
661
- this.indexedVariables = body.indexedVariables;
662
- this.memoryReference = body.memoryReference;
663
- this._available = true;
664
- }
665
- }
666
- } catch (err) {
667
- this._available = false;
668
- this.name = expression;
669
- this._description = err.message;
670
- }
671
- } else {
672
- this._available = false;
673
- this.name = expression;
674
- }
675
- }
676
- }
677
-
678
- export class DebugConsoleRoot extends ExpressionContainer {
679
- static is(node?: ExpressionContainer): node is DebugConsoleRoot {
680
- return !!node && !node.parent;
681
- }
682
-
683
- constructor(public readonly session: DebugSession | undefined, presets: DebugConsoleNode[] = []) {
684
- super({ session }, undefined, new DebugConsoleTreeService(session) as ITree);
685
- this.presetChildren = presets;
686
- }
687
-
688
- get expanded() {
689
- return true;
690
- }
691
-
692
- updatePresetChildren(presets: (AnsiConsoleNode | DebugConsoleNode | DebugVariableContainer)[]) {
693
- this.presetChildren = presets as (ExpressionNode | ExpressionContainer)[];
694
- }
695
- }
696
-
697
- export class DebugWatchRoot extends ExpressionContainer {
698
- static is(node?: ExpressionContainer): node is DebugWatchRoot {
699
- return !!node && !node.parent;
700
- }
701
-
702
- constructor(public readonly session: DebugSession | undefined, presets: DebugWatchNode[] = []) {
703
- super({ session }, undefined);
704
- this.presetChildren = presets;
705
- }
706
-
707
- get expanded() {
708
- return true;
709
- }
710
-
711
- updatePresetChildren(presets: DebugWatchNode[]) {
712
- this.presetChildren = presets;
713
- }
714
- }
715
-
716
- export class DebugVariableRoot extends DebugVariableContainer {
717
- static is(node?: ExpressionContainer): node is DebugVariableRoot {
718
- return !!node && !node.parent;
719
- }
720
-
721
- constructor(public readonly session: DebugSession | undefined) {
722
- super(session, {} as any, undefined);
723
- }
724
-
725
- get expanded() {
726
- return true;
727
- }
728
- }
729
-
730
- export class DebugHoverVariableRoot extends ExpressionContainer {
731
- private _value = '';
732
-
733
- constructor(protected readonly expression: string, protected readonly session: DebugSession | undefined) {
734
- super({ session });
735
- }
736
-
737
- get name() {
738
- return this._value;
739
- }
740
-
741
- protected _available = false;
742
- get available(): boolean {
743
- return this._available;
744
- }
745
-
746
- async evaluate(context = 'repl'): Promise<void> {
747
- if (this.session) {
748
- try {
749
- const { expression } = this;
750
- const body = await this.session.evaluate(expression, context);
751
- if (body) {
752
- this._value = body.result;
753
- this._available = true;
754
- this.variablesReference = body.variablesReference;
755
- this.namedVariables = body.namedVariables;
756
- this.indexedVariables = body.indexedVariables;
757
- this.memoryReference = body.memoryReference;
758
- }
759
- } catch (err) {
760
- this._value = err.message;
761
- this._available = false;
762
- }
763
- } else {
764
- this._value = 'Please start a debug session to evaluate';
765
- this._available = false;
766
- }
767
- }
768
- }