@theia/debug 1.34.3 → 1.34.4

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 (250) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +62 -62
  3. package/bin/download-adapters.js +76 -76
  4. package/lib/browser/breakpoint/breakpoint-manager.d.ts +69 -69
  5. package/lib/browser/breakpoint/breakpoint-manager.js +311 -311
  6. package/lib/browser/breakpoint/breakpoint-marker.d.ts +40 -40
  7. package/lib/browser/breakpoint/breakpoint-marker.js +73 -73
  8. package/lib/browser/console/debug-console-contribution.d.ts +40 -40
  9. package/lib/browser/console/debug-console-contribution.js +227 -227
  10. package/lib/browser/console/debug-console-items.d.ts +93 -93
  11. package/lib/browser/console/debug-console-items.js +318 -318
  12. package/lib/browser/console/debug-console-session.d.ts +31 -31
  13. package/lib/browser/console/debug-console-session.js +199 -199
  14. package/lib/browser/debug-call-stack-item-type-key.d.ts +3 -3
  15. package/lib/browser/debug-call-stack-item-type-key.js +19 -19
  16. package/lib/browser/debug-configuration-manager.d.ts +101 -101
  17. package/lib/browser/debug-configuration-manager.js +521 -521
  18. package/lib/browser/debug-configuration-model.d.ts +29 -29
  19. package/lib/browser/debug-configuration-model.js +79 -79
  20. package/lib/browser/debug-contribution.d.ts +22 -22
  21. package/lib/browser/debug-contribution.js +19 -19
  22. package/lib/browser/debug-frontend-application-contribution.d.ts +214 -214
  23. package/lib/browser/debug-frontend-application-contribution.js +1351 -1351
  24. package/lib/browser/debug-frontend-module.d.ts +4 -4
  25. package/lib/browser/debug-frontend-module.js +108 -108
  26. package/lib/browser/debug-keybinding-contexts.d.ts +24 -24
  27. package/lib/browser/debug-keybinding-contexts.js +85 -85
  28. package/lib/browser/debug-package.spec.js +18 -18
  29. package/lib/browser/debug-preferences.d.ts +17 -17
  30. package/lib/browser/debug-preferences.js +89 -89
  31. package/lib/browser/debug-prefix-configuration.d.ts +50 -50
  32. package/lib/browser/debug-prefix-configuration.js +204 -204
  33. package/lib/browser/debug-resource.d.ts +14 -14
  34. package/lib/browser/debug-resource.js +65 -65
  35. package/lib/browser/debug-schema-updater.d.ts +15 -15
  36. package/lib/browser/debug-schema-updater.js +168 -168
  37. package/lib/browser/debug-session-connection.d.ts +110 -110
  38. package/lib/browser/debug-session-connection.js +258 -258
  39. package/lib/browser/debug-session-contribution.d.ts +73 -73
  40. package/lib/browser/debug-session-contribution.js +145 -145
  41. package/lib/browser/debug-session-manager.d.ts +137 -137
  42. package/lib/browser/debug-session-manager.js +593 -593
  43. package/lib/browser/debug-session-options.d.ts +48 -48
  44. package/lib/browser/debug-session-options.js +85 -85
  45. package/lib/browser/debug-session.d.ts +178 -178
  46. package/lib/browser/debug-session.js +859 -859
  47. package/lib/browser/debug-tab-bar-decorator.d.ts +16 -16
  48. package/lib/browser/debug-tab-bar-decorator.js +70 -70
  49. package/lib/browser/debug-watch-manager.d.ts +21 -21
  50. package/lib/browser/debug-watch-manager.js +93 -93
  51. package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.d.ts +6 -6
  52. package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.js +38 -38
  53. package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.d.ts +19 -19
  54. package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.js +110 -110
  55. package/lib/browser/disassembly-view/disassembly-view-contribution.d.ts +24 -24
  56. package/lib/browser/disassembly-view/disassembly-view-contribution.js +131 -131
  57. package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.d.ts +38 -38
  58. package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.js +222 -222
  59. package/lib/browser/disassembly-view/disassembly-view-table-delegate.d.ts +15 -15
  60. package/lib/browser/disassembly-view/disassembly-view-table-delegate.js +38 -38
  61. package/lib/browser/disassembly-view/disassembly-view-utilities.d.ts +37 -37
  62. package/lib/browser/disassembly-view/disassembly-view-utilities.js +17 -17
  63. package/lib/browser/disassembly-view/disassembly-view-widget.d.ts +60 -60
  64. package/lib/browser/disassembly-view/disassembly-view-widget.js +452 -452
  65. package/lib/browser/editor/debug-breakpoint-widget.d.ts +51 -51
  66. package/lib/browser/editor/debug-breakpoint-widget.js +245 -245
  67. package/lib/browser/editor/debug-editor-model.d.ts +91 -91
  68. package/lib/browser/editor/debug-editor-model.js +497 -497
  69. package/lib/browser/editor/debug-editor-service.d.ts +37 -37
  70. package/lib/browser/editor/debug-editor-service.js +214 -214
  71. package/lib/browser/editor/debug-editor.d.ts +3 -3
  72. package/lib/browser/editor/debug-editor.js +19 -19
  73. package/lib/browser/editor/debug-exception-widget.d.ts +28 -28
  74. package/lib/browser/editor/debug-exception-widget.js +111 -111
  75. package/lib/browser/editor/debug-expression-provider.d.ts +11 -11
  76. package/lib/browser/editor/debug-expression-provider.js +81 -81
  77. package/lib/browser/editor/debug-hover-source.d.ts +18 -18
  78. package/lib/browser/editor/debug-hover-source.js +117 -117
  79. package/lib/browser/editor/debug-hover-widget.d.ts +47 -47
  80. package/lib/browser/editor/debug-hover-widget.js +267 -267
  81. package/lib/browser/editor/debug-inline-value-decorator.d.ts +21 -21
  82. package/lib/browser/editor/debug-inline-value-decorator.js +337 -337
  83. package/lib/browser/model/debug-breakpoint.d.ts +47 -47
  84. package/lib/browser/model/debug-breakpoint.js +109 -109
  85. package/lib/browser/model/debug-function-breakpoint.d.ts +18 -18
  86. package/lib/browser/model/debug-function-breakpoint.js +92 -92
  87. package/lib/browser/model/debug-instruction-breakpoint.d.ts +14 -14
  88. package/lib/browser/model/debug-instruction-breakpoint.js +65 -65
  89. package/lib/browser/model/debug-source-breakpoint.d.ts +37 -37
  90. package/lib/browser/model/debug-source-breakpoint.js +211 -211
  91. package/lib/browser/model/debug-source.d.ts +24 -24
  92. package/lib/browser/model/debug-source.js +80 -80
  93. package/lib/browser/model/debug-stack-frame.d.ts +41 -41
  94. package/lib/browser/model/debug-stack-frame.js +146 -146
  95. package/lib/browser/model/debug-thread.d.ts +60 -60
  96. package/lib/browser/model/debug-thread.js +200 -200
  97. package/lib/browser/preferences/launch-preferences.d.ts +4 -4
  98. package/lib/browser/preferences/launch-preferences.js +38 -38
  99. package/lib/browser/view/debug-action.d.ts +16 -16
  100. package/lib/browser/view/debug-action.js +43 -43
  101. package/lib/browser/view/debug-breakpoints-source.d.ts +9 -9
  102. package/lib/browser/view/debug-breakpoints-source.js +70 -70
  103. package/lib/browser/view/debug-breakpoints-widget.d.ts +22 -22
  104. package/lib/browser/view/debug-breakpoints-widget.js +87 -87
  105. package/lib/browser/view/debug-configuration-select.d.ts +61 -61
  106. package/lib/browser/view/debug-configuration-select.js +204 -204
  107. package/lib/browser/view/debug-configuration-widget.d.ts +30 -30
  108. package/lib/browser/view/debug-configuration-widget.js +135 -135
  109. package/lib/browser/view/debug-exception-breakpoint.d.ts +13 -13
  110. package/lib/browser/view/debug-exception-breakpoint.js +34 -34
  111. package/lib/browser/view/debug-session-widget.d.ts +28 -28
  112. package/lib/browser/view/debug-session-widget.js +134 -134
  113. package/lib/browser/view/debug-stack-frames-source.d.ts +17 -17
  114. package/lib/browser/view/debug-stack-frames-source.js +89 -89
  115. package/lib/browser/view/debug-stack-frames-widget.d.ts +24 -24
  116. package/lib/browser/view/debug-stack-frames-widget.js +154 -154
  117. package/lib/browser/view/debug-threads-source.d.ts +8 -8
  118. package/lib/browser/view/debug-threads-source.js +63 -63
  119. package/lib/browser/view/debug-threads-widget.d.ts +26 -26
  120. package/lib/browser/view/debug-threads-widget.js +145 -145
  121. package/lib/browser/view/debug-toolbar-widget.d.ts +34 -34
  122. package/lib/browser/view/debug-toolbar-widget.js +156 -156
  123. package/lib/browser/view/debug-variables-source.d.ts +9 -9
  124. package/lib/browser/view/debug-variables-source.js +60 -60
  125. package/lib/browser/view/debug-variables-widget.d.ts +16 -16
  126. package/lib/browser/view/debug-variables-widget.js +78 -78
  127. package/lib/browser/view/debug-view-model.d.ts +51 -51
  128. package/lib/browser/view/debug-view-model.js +220 -220
  129. package/lib/browser/view/debug-watch-expression.d.ts +30 -30
  130. package/lib/browser/view/debug-watch-expression.js +73 -73
  131. package/lib/browser/view/debug-watch-source.d.ts +9 -9
  132. package/lib/browser/view/debug-watch-source.js +58 -58
  133. package/lib/browser/view/debug-watch-widget.d.ts +16 -16
  134. package/lib/browser/view/debug-watch-widget.js +78 -78
  135. package/lib/browser/view/debug-widget.d.ts +23 -23
  136. package/lib/browser/view/debug-widget.js +108 -108
  137. package/lib/common/debug-adapter-contribution-registry.d.ts +59 -59
  138. package/lib/common/debug-adapter-contribution-registry.js +212 -212
  139. package/lib/common/debug-adapter-session.d.ts +18 -18
  140. package/lib/common/debug-adapter-session.js +78 -78
  141. package/lib/common/debug-common.d.ts +1 -1
  142. package/lib/common/debug-common.js +29 -29
  143. package/lib/common/debug-compound.d.ts +14 -14
  144. package/lib/common/debug-compound.js +27 -27
  145. package/lib/common/debug-configuration.d.ts +58 -58
  146. package/lib/common/debug-configuration.js +31 -31
  147. package/lib/common/debug-model.d.ts +152 -152
  148. package/lib/common/debug-model.js +35 -35
  149. package/lib/common/debug-service.d.ts +123 -123
  150. package/lib/common/debug-service.js +66 -66
  151. package/lib/common/debug-uri-utils.d.ts +23 -23
  152. package/lib/common/debug-uri-utils.js +26 -26
  153. package/lib/common/inline-debug-adapter.d.ts +18 -18
  154. package/lib/common/inline-debug-adapter.js +44 -44
  155. package/lib/node/debug-adapter-factory.d.ts +19 -19
  156. package/lib/node/debug-adapter-factory.js +96 -96
  157. package/lib/node/debug-adapter-session-manager.d.ts +37 -37
  158. package/lib/node/debug-adapter-session-manager.js +111 -111
  159. package/lib/node/debug-backend-module.d.ts +3 -3
  160. package/lib/node/debug-backend-module.js +41 -41
  161. package/lib/node/debug-service-impl.d.ts +30 -30
  162. package/lib/node/debug-service-impl.js +124 -124
  163. package/lib/node/stream-debug-adapter.d.ts +36 -36
  164. package/lib/node/stream-debug-adapter.js +112 -112
  165. package/lib/node/vscode/vscode-debug-adapter-contribution.d.ts +47 -47
  166. package/lib/node/vscode/vscode-debug-adapter-contribution.js +221 -221
  167. package/package.json +15 -15
  168. package/src/browser/breakpoint/breakpoint-manager.ts +351 -351
  169. package/src/browser/breakpoint/breakpoint-marker.ts +102 -102
  170. package/src/browser/console/debug-console-contribution.tsx +239 -239
  171. package/src/browser/console/debug-console-items.tsx +383 -383
  172. package/src/browser/console/debug-console-session.ts +205 -205
  173. package/src/browser/debug-call-stack-item-type-key.ts +20 -20
  174. package/src/browser/debug-configuration-manager.ts +559 -559
  175. package/src/browser/debug-configuration-model.ts +100 -100
  176. package/src/browser/debug-contribution.ts +43 -43
  177. package/src/browser/debug-frontend-application-contribution.ts +1503 -1503
  178. package/src/browser/debug-frontend-module.ts +136 -136
  179. package/src/browser/debug-keybinding-contexts.ts +75 -75
  180. package/src/browser/debug-package.spec.ts +20 -20
  181. package/src/browser/debug-preferences.ts +98 -98
  182. package/src/browser/debug-prefix-configuration.ts +190 -190
  183. package/src/browser/debug-resource.ts +59 -59
  184. package/src/browser/debug-schema-updater.ts +149 -149
  185. package/src/browser/debug-session-connection.ts +357 -357
  186. package/src/browser/debug-session-contribution.ts +150 -150
  187. package/src/browser/debug-session-manager.ts +681 -681
  188. package/src/browser/debug-session-options.ts +114 -114
  189. package/src/browser/debug-session.tsx +936 -936
  190. package/src/browser/debug-tab-bar-decorator.ts +57 -57
  191. package/src/browser/debug-watch-manager.ts +93 -93
  192. package/src/browser/disassembly-view/disassembly-view-accessibility-provider.ts +43 -43
  193. package/src/browser/disassembly-view/disassembly-view-breakpoint-renderer.ts +119 -119
  194. package/src/browser/disassembly-view/disassembly-view-contribution.ts +109 -109
  195. package/src/browser/disassembly-view/disassembly-view-instruction-renderer.ts +245 -245
  196. package/src/browser/disassembly-view/disassembly-view-table-delegate.ts +39 -39
  197. package/src/browser/disassembly-view/disassembly-view-utilities.ts +55 -55
  198. package/src/browser/disassembly-view/disassembly-view-widget.ts +463 -463
  199. package/src/browser/editor/debug-breakpoint-widget.tsx +275 -275
  200. package/src/browser/editor/debug-editor-model.ts +508 -508
  201. package/src/browser/editor/debug-editor-service.ts +206 -206
  202. package/src/browser/editor/debug-editor.ts +20 -20
  203. package/src/browser/editor/debug-exception-widget.tsx +118 -118
  204. package/src/browser/editor/debug-expression-provider.ts +78 -78
  205. package/src/browser/editor/debug-hover-source.tsx +105 -105
  206. package/src/browser/editor/debug-hover-widget.ts +280 -280
  207. package/src/browser/editor/debug-inline-value-decorator.ts +377 -377
  208. package/src/browser/model/debug-breakpoint.tsx +151 -151
  209. package/src/browser/model/debug-function-breakpoint.tsx +101 -101
  210. package/src/browser/model/debug-instruction-breakpoint.tsx +68 -68
  211. package/src/browser/model/debug-source-breakpoint.tsx +237 -237
  212. package/src/browser/model/debug-source.ts +93 -93
  213. package/src/browser/model/debug-stack-frame.tsx +170 -170
  214. package/src/browser/model/debug-thread.tsx +240 -240
  215. package/src/browser/preferences/launch-preferences.ts +38 -38
  216. package/src/browser/style/index.css +445 -445
  217. package/src/browser/view/debug-action.tsx +57 -57
  218. package/src/browser/view/debug-breakpoints-source.tsx +53 -53
  219. package/src/browser/view/debug-breakpoints-widget.ts +71 -71
  220. package/src/browser/view/debug-configuration-select.tsx +256 -256
  221. package/src/browser/view/debug-configuration-widget.tsx +121 -121
  222. package/src/browser/view/debug-exception-breakpoint.tsx +43 -43
  223. package/src/browser/view/debug-session-widget.ts +124 -124
  224. package/src/browser/view/debug-stack-frames-source.tsx +75 -75
  225. package/src/browser/view/debug-stack-frames-widget.ts +135 -135
  226. package/src/browser/view/debug-threads-source.tsx +48 -48
  227. package/src/browser/view/debug-threads-widget.ts +125 -125
  228. package/src/browser/view/debug-toolbar-widget.tsx +145 -145
  229. package/src/browser/view/debug-variables-source.ts +43 -43
  230. package/src/browser/view/debug-variables-widget.ts +61 -61
  231. package/src/browser/view/debug-view-model.ts +230 -230
  232. package/src/browser/view/debug-watch-expression.tsx +88 -88
  233. package/src/browser/view/debug-watch-source.ts +41 -41
  234. package/src/browser/view/debug-watch-widget.ts +61 -61
  235. package/src/browser/view/debug-widget.ts +97 -97
  236. package/src/common/debug-adapter-contribution-registry.ts +206 -206
  237. package/src/common/debug-adapter-session.ts +102 -102
  238. package/src/common/debug-common.ts +19 -19
  239. package/src/common/debug-compound.ts +33 -33
  240. package/src/common/debug-configuration.ts +93 -93
  241. package/src/common/debug-model.ts +200 -200
  242. package/src/common/debug-service.ts +184 -184
  243. package/src/common/debug-uri-utils.ts +24 -24
  244. package/src/common/inline-debug-adapter.ts +47 -47
  245. package/src/node/debug-adapter-factory.ts +107 -107
  246. package/src/node/debug-adapter-session-manager.ts +106 -106
  247. package/src/node/debug-backend-module.ts +57 -57
  248. package/src/node/debug-service-impl.ts +119 -119
  249. package/src/node/stream-debug-adapter.ts +126 -126
  250. package/src/node/vscode/vscode-debug-adapter-contribution.ts +252 -252
@@ -1,1352 +1,1352 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 TypeFox 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 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.DebugFrontendApplicationContribution = exports.DebugBreakpointWidgetCommands = exports.DebugEditorContextCommands = exports.DebugSessionContextCommands = exports.DebugThreadContextCommands = exports.DebugCommands = exports.DebugMenus = void 0;
28
- const browser_1 = require("@theia/core/lib/browser");
29
- const inversify_1 = require("@theia/core/shared/inversify");
30
- const monaco = require("@theia/monaco-editor-core");
31
- const common_1 = require("@theia/core/lib/common");
32
- const browser_2 = require("@theia/editor/lib/browser");
33
- const debug_session_manager_1 = require("./debug-session-manager");
34
- const debug_widget_1 = require("./view/debug-widget");
35
- const breakpoint_marker_1 = require("./breakpoint/breakpoint-marker");
36
- const breakpoint_manager_1 = require("./breakpoint/breakpoint-manager");
37
- const debug_configuration_manager_1 = require("./debug-configuration-manager");
38
- const debug_session_1 = require("./debug-session");
39
- const debug_breakpoints_widget_1 = require("./view/debug-breakpoints-widget");
40
- const debug_source_breakpoint_1 = require("./model/debug-source-breakpoint");
41
- const debug_threads_widget_1 = require("./view/debug-threads-widget");
42
- const debug_thread_1 = require("./model/debug-thread");
43
- const debug_stack_frames_widget_1 = require("./view/debug-stack-frames-widget");
44
- const debug_stack_frame_1 = require("./model/debug-stack-frame");
45
- const debug_variables_widget_1 = require("./view/debug-variables-widget");
46
- const debug_console_items_1 = require("./console/debug-console-items");
47
- const debug_keybinding_contexts_1 = require("./debug-keybinding-contexts");
48
- const debug_editor_model_1 = require("./editor/debug-editor-model");
49
- const debug_editor_service_1 = require("./editor/debug-editor-service");
50
- const debug_console_contribution_1 = require("./console/debug-console-contribution");
51
- const debug_service_1 = require("../common/debug-service");
52
- const debug_schema_updater_1 = require("./debug-schema-updater");
53
- const debug_preferences_1 = require("./debug-preferences");
54
- const debug_watch_widget_1 = require("./view/debug-watch-widget");
55
- const debug_watch_expression_1 = require("./view/debug-watch-expression");
56
- const debug_watch_manager_1 = require("./debug-watch-manager");
57
- const debug_function_breakpoint_1 = require("./model/debug-function-breakpoint");
58
- const debug_breakpoint_1 = require("./model/debug-breakpoint");
59
- const nls_1 = require("@theia/core/lib/common/nls");
60
- const debug_instruction_breakpoint_1 = require("./model/debug-instruction-breakpoint");
61
- var DebugMenus;
62
- (function (DebugMenus) {
63
- DebugMenus.DEBUG = [...common_1.MAIN_MENU_BAR, '6_debug'];
64
- DebugMenus.DEBUG_CONTROLS = [...DebugMenus.DEBUG, 'a_controls'];
65
- DebugMenus.DEBUG_CONFIGURATION = [...DebugMenus.DEBUG, 'b_configuration'];
66
- DebugMenus.DEBUG_THREADS = [...DebugMenus.DEBUG, 'c_threads'];
67
- DebugMenus.DEBUG_SESSIONS = [...DebugMenus.DEBUG, 'd_sessions'];
68
- DebugMenus.DEBUG_BREAKPOINT = [...DebugMenus.DEBUG, 'e_breakpoint'];
69
- DebugMenus.DEBUG_NEW_BREAKPOINT = [...DebugMenus.DEBUG_BREAKPOINT, 'a_new_breakpoint'];
70
- DebugMenus.DEBUG_BREAKPOINTS = [...DebugMenus.DEBUG, 'f_breakpoints'];
71
- })(DebugMenus = exports.DebugMenus || (exports.DebugMenus = {}));
72
- function nlsEditBreakpoint(breakpoint) {
73
- return nls_1.nls.localizeByDefault('Edit {0}...', nls_1.nls.localizeByDefault(breakpoint));
74
- }
75
- function nlsRemoveBreakpoint(breakpoint) {
76
- return nls_1.nls.localizeByDefault('Remove {0}', nls_1.nls.localizeByDefault(breakpoint));
77
- }
78
- function nlsEnableBreakpoint(breakpoint) {
79
- return nls_1.nls.localizeByDefault('Enable {0}', nls_1.nls.localizeByDefault(breakpoint));
80
- }
81
- function nlsDisableBreakpoint(breakpoint) {
82
- return nls_1.nls.localizeByDefault('Disable {0}', nls_1.nls.localizeByDefault(breakpoint));
83
- }
84
- var DebugCommands;
85
- (function (DebugCommands) {
86
- DebugCommands.DEBUG_CATEGORY = 'Debug';
87
- DebugCommands.DEBUG_CATEGORY_KEY = nls_1.nls.getDefaultKey(DebugCommands.DEBUG_CATEGORY);
88
- DebugCommands.START = common_1.Command.toDefaultLocalizedCommand({
89
- id: 'workbench.action.debug.start',
90
- category: DebugCommands.DEBUG_CATEGORY,
91
- label: 'Start Debugging',
92
- iconClass: (0, browser_1.codicon)('debug-alt')
93
- });
94
- DebugCommands.START_NO_DEBUG = common_1.Command.toDefaultLocalizedCommand({
95
- id: 'workbench.action.debug.run',
96
- category: DebugCommands.DEBUG_CATEGORY,
97
- label: 'Start Without Debugging'
98
- });
99
- DebugCommands.STOP = common_1.Command.toDefaultLocalizedCommand({
100
- id: 'workbench.action.debug.stop',
101
- category: DebugCommands.DEBUG_CATEGORY,
102
- label: 'Stop',
103
- iconClass: (0, browser_1.codicon)('debug-stop')
104
- });
105
- DebugCommands.RESTART = common_1.Command.toDefaultLocalizedCommand({
106
- id: 'workbench.action.debug.restart',
107
- category: DebugCommands.DEBUG_CATEGORY,
108
- label: 'Restart',
109
- });
110
- DebugCommands.OPEN_CONFIGURATIONS = common_1.Command.toDefaultLocalizedCommand({
111
- id: 'debug.configurations.open',
112
- category: DebugCommands.DEBUG_CATEGORY,
113
- label: 'Open Configurations'
114
- });
115
- DebugCommands.ADD_CONFIGURATION = common_1.Command.toDefaultLocalizedCommand({
116
- id: 'debug.configurations.add',
117
- category: DebugCommands.DEBUG_CATEGORY,
118
- label: 'Add Configuration...'
119
- });
120
- DebugCommands.STEP_OVER = common_1.Command.toDefaultLocalizedCommand({
121
- id: 'workbench.action.debug.stepOver',
122
- category: DebugCommands.DEBUG_CATEGORY,
123
- label: 'Step Over',
124
- iconClass: (0, browser_1.codicon)('debug-step-over')
125
- });
126
- DebugCommands.STEP_INTO = common_1.Command.toDefaultLocalizedCommand({
127
- id: 'workbench.action.debug.stepInto',
128
- category: DebugCommands.DEBUG_CATEGORY,
129
- label: 'Step Into',
130
- iconClass: (0, browser_1.codicon)('debug-step-into')
131
- });
132
- DebugCommands.STEP_OUT = common_1.Command.toDefaultLocalizedCommand({
133
- id: 'workbench.action.debug.stepOut',
134
- category: DebugCommands.DEBUG_CATEGORY,
135
- label: 'Step Out',
136
- iconClass: (0, browser_1.codicon)('debug-step-out')
137
- });
138
- DebugCommands.CONTINUE = common_1.Command.toDefaultLocalizedCommand({
139
- id: 'workbench.action.debug.continue',
140
- category: DebugCommands.DEBUG_CATEGORY,
141
- label: 'Continue',
142
- iconClass: (0, browser_1.codicon)('debug-continue')
143
- });
144
- DebugCommands.PAUSE = common_1.Command.toDefaultLocalizedCommand({
145
- id: 'workbench.action.debug.pause',
146
- category: DebugCommands.DEBUG_CATEGORY,
147
- label: 'Pause',
148
- iconClass: (0, browser_1.codicon)('debug-pause')
149
- });
150
- DebugCommands.CONTINUE_ALL = common_1.Command.toLocalizedCommand({
151
- id: 'debug.thread.continue.all',
152
- category: DebugCommands.DEBUG_CATEGORY,
153
- label: 'Continue All',
154
- iconClass: (0, browser_1.codicon)('debug-continue')
155
- }, 'theia/debug/continueAll', DebugCommands.DEBUG_CATEGORY_KEY);
156
- DebugCommands.PAUSE_ALL = common_1.Command.toLocalizedCommand({
157
- id: 'debug.thread.pause.all',
158
- category: DebugCommands.DEBUG_CATEGORY,
159
- label: 'Pause All',
160
- iconClass: (0, browser_1.codicon)('debug-pause')
161
- }, 'theia/debug/pauseAll', DebugCommands.DEBUG_CATEGORY_KEY);
162
- DebugCommands.TOGGLE_BREAKPOINT = common_1.Command.toDefaultLocalizedCommand({
163
- id: 'editor.debug.action.toggleBreakpoint',
164
- category: DebugCommands.DEBUG_CATEGORY,
165
- label: 'Toggle Breakpoint',
166
- });
167
- DebugCommands.INLINE_BREAKPOINT = common_1.Command.toDefaultLocalizedCommand({
168
- id: 'editor.debug.action.inlineBreakpoint',
169
- category: DebugCommands.DEBUG_CATEGORY,
170
- label: 'Inline Breakpoint',
171
- });
172
- DebugCommands.ADD_CONDITIONAL_BREAKPOINT = common_1.Command.toDefaultLocalizedCommand({
173
- id: 'debug.breakpoint.add.conditional',
174
- category: DebugCommands.DEBUG_CATEGORY,
175
- label: 'Add Conditional Breakpoint...',
176
- });
177
- DebugCommands.ADD_LOGPOINT = common_1.Command.toDefaultLocalizedCommand({
178
- id: 'debug.breakpoint.add.logpoint',
179
- category: DebugCommands.DEBUG_CATEGORY,
180
- label: 'Add Logpoint...',
181
- });
182
- DebugCommands.ADD_FUNCTION_BREAKPOINT = common_1.Command.toDefaultLocalizedCommand({
183
- id: 'debug.breakpoint.add.function',
184
- category: DebugCommands.DEBUG_CATEGORY,
185
- label: 'Add Function Breakpoint',
186
- });
187
- DebugCommands.ENABLE_ALL_BREAKPOINTS = common_1.Command.toDefaultLocalizedCommand({
188
- id: 'debug.breakpoint.enableAll',
189
- category: DebugCommands.DEBUG_CATEGORY,
190
- label: 'Enable All Breakpoints',
191
- });
192
- DebugCommands.DISABLE_ALL_BREAKPOINTS = common_1.Command.toDefaultLocalizedCommand({
193
- id: 'debug.breakpoint.disableAll',
194
- category: DebugCommands.DEBUG_CATEGORY,
195
- label: 'Disable All Breakpoints',
196
- });
197
- DebugCommands.EDIT_BREAKPOINT = common_1.Command.toLocalizedCommand({
198
- id: 'debug.breakpoint.edit',
199
- category: DebugCommands.DEBUG_CATEGORY,
200
- originalLabel: 'Edit Breakpoint...',
201
- label: nlsEditBreakpoint('Breakpoint')
202
- }, '', DebugCommands.DEBUG_CATEGORY_KEY);
203
- DebugCommands.EDIT_LOGPOINT = common_1.Command.toLocalizedCommand({
204
- id: 'debug.logpoint.edit',
205
- category: DebugCommands.DEBUG_CATEGORY,
206
- originalLabel: 'Edit Logpoint...',
207
- label: nlsEditBreakpoint('Logpoint')
208
- }, '', DebugCommands.DEBUG_CATEGORY_KEY);
209
- DebugCommands.REMOVE_BREAKPOINT = common_1.Command.toLocalizedCommand({
210
- id: 'debug.breakpoint.remove',
211
- category: DebugCommands.DEBUG_CATEGORY,
212
- originalLabel: 'Remove Breakpoint',
213
- label: nlsRemoveBreakpoint('Breakpoint')
214
- }, '', DebugCommands.DEBUG_CATEGORY_KEY);
215
- DebugCommands.REMOVE_LOGPOINT = common_1.Command.toLocalizedCommand({
216
- id: 'debug.logpoint.remove',
217
- category: DebugCommands.DEBUG_CATEGORY,
218
- originalLabel: 'Remove Logpoint',
219
- label: nlsRemoveBreakpoint('Logpoint')
220
- }, '', DebugCommands.DEBUG_CATEGORY_KEY);
221
- DebugCommands.REMOVE_ALL_BREAKPOINTS = common_1.Command.toDefaultLocalizedCommand({
222
- id: 'debug.breakpoint.removeAll',
223
- category: DebugCommands.DEBUG_CATEGORY,
224
- label: 'Remove All Breakpoints',
225
- });
226
- DebugCommands.TOGGLE_BREAKPOINTS_ENABLED = common_1.Command.toLocalizedCommand({
227
- id: 'debug.breakpoint.toggleEnabled'
228
- });
229
- DebugCommands.SHOW_HOVER = common_1.Command.toDefaultLocalizedCommand({
230
- id: 'editor.debug.action.showDebugHover',
231
- category: DebugCommands.DEBUG_CATEGORY,
232
- label: 'Show Hover'
233
- });
234
- DebugCommands.RESTART_FRAME = common_1.Command.toDefaultLocalizedCommand({
235
- id: 'debug.frame.restart',
236
- category: DebugCommands.DEBUG_CATEGORY,
237
- label: 'Restart Frame',
238
- });
239
- DebugCommands.COPY_CALL_STACK = common_1.Command.toDefaultLocalizedCommand({
240
- id: 'debug.callStack.copy',
241
- category: DebugCommands.DEBUG_CATEGORY,
242
- label: 'Copy Call Stack',
243
- });
244
- DebugCommands.SET_VARIABLE_VALUE = common_1.Command.toDefaultLocalizedCommand({
245
- id: 'debug.variable.setValue',
246
- category: DebugCommands.DEBUG_CATEGORY,
247
- label: 'Set Value',
248
- });
249
- DebugCommands.COPY_VARIABLE_VALUE = common_1.Command.toDefaultLocalizedCommand({
250
- id: 'debug.variable.copyValue',
251
- category: DebugCommands.DEBUG_CATEGORY,
252
- label: 'Copy Value',
253
- });
254
- DebugCommands.COPY_VARIABLE_AS_EXPRESSION = common_1.Command.toDefaultLocalizedCommand({
255
- id: 'debug.variable.copyAsExpression',
256
- category: DebugCommands.DEBUG_CATEGORY,
257
- label: 'Copy as Expression',
258
- });
259
- DebugCommands.WATCH_VARIABLE = common_1.Command.toDefaultLocalizedCommand({
260
- id: 'debug.variable.watch',
261
- category: DebugCommands.DEBUG_CATEGORY,
262
- label: 'Add to Watch',
263
- });
264
- DebugCommands.ADD_WATCH_EXPRESSION = common_1.Command.toDefaultLocalizedCommand({
265
- id: 'debug.watch.addExpression',
266
- category: DebugCommands.DEBUG_CATEGORY,
267
- label: 'Add Expression'
268
- });
269
- DebugCommands.EDIT_WATCH_EXPRESSION = common_1.Command.toDefaultLocalizedCommand({
270
- id: 'debug.watch.editExpression',
271
- category: DebugCommands.DEBUG_CATEGORY,
272
- label: 'Edit Expression'
273
- });
274
- DebugCommands.COPY_WATCH_EXPRESSION_VALUE = common_1.Command.toLocalizedCommand({
275
- id: 'debug.watch.copyExpressionValue',
276
- category: DebugCommands.DEBUG_CATEGORY,
277
- label: 'Copy Expression Value'
278
- }, 'theia/debug/copyExpressionValue', DebugCommands.DEBUG_CATEGORY_KEY);
279
- DebugCommands.REMOVE_WATCH_EXPRESSION = common_1.Command.toDefaultLocalizedCommand({
280
- id: 'debug.watch.removeExpression',
281
- category: DebugCommands.DEBUG_CATEGORY,
282
- label: 'Remove Expression'
283
- });
284
- DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS = common_1.Command.toDefaultLocalizedCommand({
285
- id: 'debug.watch.collapseAllExpressions',
286
- category: DebugCommands.DEBUG_CATEGORY,
287
- label: 'Collapse All'
288
- });
289
- DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS = common_1.Command.toDefaultLocalizedCommand({
290
- id: 'debug.watch.removeAllExpressions',
291
- category: DebugCommands.DEBUG_CATEGORY,
292
- label: 'Remove All Expressions'
293
- });
294
- })(DebugCommands = exports.DebugCommands || (exports.DebugCommands = {}));
295
- var DebugThreadContextCommands;
296
- (function (DebugThreadContextCommands) {
297
- DebugThreadContextCommands.STEP_OVER = {
298
- id: 'debug.thread.context.context.next'
299
- };
300
- DebugThreadContextCommands.STEP_INTO = {
301
- id: 'debug.thread.context.stepin'
302
- };
303
- DebugThreadContextCommands.STEP_OUT = {
304
- id: 'debug.thread.context.stepout'
305
- };
306
- DebugThreadContextCommands.CONTINUE = {
307
- id: 'debug.thread.context.continue'
308
- };
309
- DebugThreadContextCommands.PAUSE = {
310
- id: 'debug.thread.context.pause'
311
- };
312
- DebugThreadContextCommands.TERMINATE = {
313
- id: 'debug.thread.context.terminate'
314
- };
315
- })(DebugThreadContextCommands = exports.DebugThreadContextCommands || (exports.DebugThreadContextCommands = {}));
316
- var DebugSessionContextCommands;
317
- (function (DebugSessionContextCommands) {
318
- DebugSessionContextCommands.STOP = {
319
- id: 'debug.session.context.stop'
320
- };
321
- DebugSessionContextCommands.RESTART = {
322
- id: 'debug.session.context.restart'
323
- };
324
- DebugSessionContextCommands.PAUSE_ALL = {
325
- id: 'debug.session.context.pauseAll'
326
- };
327
- DebugSessionContextCommands.CONTINUE_ALL = {
328
- id: 'debug.session.context.continueAll'
329
- };
330
- DebugSessionContextCommands.REVEAL = {
331
- id: 'debug.session.context.reveal'
332
- };
333
- })(DebugSessionContextCommands = exports.DebugSessionContextCommands || (exports.DebugSessionContextCommands = {}));
334
- var DebugEditorContextCommands;
335
- (function (DebugEditorContextCommands) {
336
- DebugEditorContextCommands.ADD_BREAKPOINT = {
337
- id: 'debug.editor.context.addBreakpoint'
338
- };
339
- DebugEditorContextCommands.ADD_CONDITIONAL_BREAKPOINT = {
340
- id: 'debug.editor.context.addBreakpoint.conditional'
341
- };
342
- DebugEditorContextCommands.ADD_LOGPOINT = {
343
- id: 'debug.editor.context.add.logpoint'
344
- };
345
- DebugEditorContextCommands.REMOVE_BREAKPOINT = {
346
- id: 'debug.editor.context.removeBreakpoint'
347
- };
348
- DebugEditorContextCommands.EDIT_BREAKPOINT = {
349
- id: 'debug.editor.context.edit.breakpoint'
350
- };
351
- DebugEditorContextCommands.ENABLE_BREAKPOINT = {
352
- id: 'debug.editor.context.enableBreakpoint'
353
- };
354
- DebugEditorContextCommands.DISABLE_BREAKPOINT = {
355
- id: 'debug.editor.context.disableBreakpoint'
356
- };
357
- DebugEditorContextCommands.REMOVE_LOGPOINT = {
358
- id: 'debug.editor.context.logpoint.remove'
359
- };
360
- DebugEditorContextCommands.EDIT_LOGPOINT = {
361
- id: 'debug.editor.context.logpoint.edit'
362
- };
363
- DebugEditorContextCommands.ENABLE_LOGPOINT = {
364
- id: 'debug.editor.context.logpoint.enable'
365
- };
366
- DebugEditorContextCommands.DISABLE_LOGPOINT = {
367
- id: 'debug.editor.context.logpoint.disable'
368
- };
369
- })(DebugEditorContextCommands = exports.DebugEditorContextCommands || (exports.DebugEditorContextCommands = {}));
370
- var DebugBreakpointWidgetCommands;
371
- (function (DebugBreakpointWidgetCommands) {
372
- DebugBreakpointWidgetCommands.ACCEPT = {
373
- id: 'debug.breakpointWidget.accept'
374
- };
375
- DebugBreakpointWidgetCommands.CLOSE = {
376
- id: 'debug.breakpointWidget.close'
377
- };
378
- })(DebugBreakpointWidgetCommands = exports.DebugBreakpointWidgetCommands || (exports.DebugBreakpointWidgetCommands = {}));
379
- let DebugFrontendApplicationContribution = class DebugFrontendApplicationContribution extends browser_1.AbstractViewContribution {
380
- constructor() {
381
- super({
382
- widgetId: debug_widget_1.DebugWidget.ID,
383
- widgetName: debug_widget_1.DebugWidget.LABEL,
384
- defaultWidgetOptions: {
385
- area: 'left',
386
- rank: 400
387
- },
388
- toggleCommandId: 'debug:toggle',
389
- toggleKeybinding: 'ctrlcmd+shift+d'
390
- });
391
- this.firstSessionStart = true;
392
- }
393
- async initializeLayout() {
394
- await this.openView();
395
- }
396
- async onStart() {
397
- this.manager.onDidCreateDebugSession(session => this.openSession(session, { reveal: false }));
398
- this.manager.onDidStartDebugSession(session => {
399
- const { noDebug } = session.configuration;
400
- const openDebug = session.configuration.openDebug || this.preference['debug.openDebug'];
401
- const internalConsoleOptions = session.configuration.internalConsoleOptions || this.preference['debug.internalConsoleOptions'];
402
- if (internalConsoleOptions === 'openOnSessionStart' ||
403
- (internalConsoleOptions === 'openOnFirstSessionStart' && this.firstSessionStart)) {
404
- this.console.openView({
405
- reveal: true,
406
- activate: false,
407
- });
408
- }
409
- if (!noDebug && (openDebug === 'openOnSessionStart' || (openDebug === 'openOnFirstSessionStart' && this.firstSessionStart))) {
410
- this.openSession(session);
411
- }
412
- this.firstSessionStart = false;
413
- });
414
- this.manager.onDidStopDebugSession(session => {
415
- const { openDebug } = session.configuration;
416
- if (openDebug === 'openOnDebugBreak') {
417
- this.openSession(session);
418
- }
419
- });
420
- this.updateStatusBar();
421
- this.manager.onDidChange(() => this.updateStatusBar());
422
- this.schemaUpdater.update();
423
- this.configurations.load();
424
- await this.breakpointManager.load();
425
- await this.watchManager.load();
426
- }
427
- onStop() {
428
- this.configurations.save();
429
- this.breakpointManager.save();
430
- this.watchManager.save();
431
- }
432
- onWillStop() {
433
- if (this.preference['debug.confirmOnExit'] === 'always' && this.manager.currentSession) {
434
- return {
435
- reason: 'active-debug-sessions',
436
- action: async () => {
437
- if (this.manager.currentSession) {
438
- const msg = this.manager.sessions.length === 1
439
- ? nls_1.nls.localizeByDefault('There is an active debug session, are you sure you want to stop it?')
440
- : nls_1.nls.localizeByDefault('There are active debug sessions, are you sure you want to stop them?');
441
- const safeToExit = await new browser_1.ConfirmDialog({
442
- title: '',
443
- msg,
444
- ok: nls_1.nls.localizeByDefault('Stop Debugging'),
445
- cancel: browser_1.Dialog.CANCEL,
446
- }).open();
447
- return safeToExit === true;
448
- }
449
- return true;
450
- },
451
- };
452
- }
453
- }
454
- registerMenus(menus) {
455
- super.registerMenus(menus);
456
- const registerMenuActions = (menuPath, ...commands) => {
457
- for (const [index, command] of commands.entries()) {
458
- const label = command.label;
459
- const debug = `${DebugCommands.DEBUG_CATEGORY}:`;
460
- menus.registerMenuAction(menuPath, {
461
- commandId: command.id,
462
- label: label && label.startsWith(debug) && label.slice(debug.length).trimStart() || label,
463
- icon: command.iconClass,
464
- order: String.fromCharCode('a'.charCodeAt(0) + index)
465
- });
466
- }
467
- };
468
- menus.registerSubmenu(DebugMenus.DEBUG, nls_1.nls.localizeByDefault('Run'));
469
- registerMenuActions(DebugMenus.DEBUG_CONTROLS, DebugCommands.START, DebugCommands.START_NO_DEBUG, DebugCommands.STOP, DebugCommands.RESTART);
470
- registerMenuActions(DebugMenus.DEBUG_CONFIGURATION, DebugCommands.OPEN_CONFIGURATIONS, DebugCommands.ADD_CONFIGURATION);
471
- registerMenuActions(DebugMenus.DEBUG_THREADS, DebugCommands.CONTINUE, DebugCommands.STEP_OVER, DebugCommands.STEP_INTO, DebugCommands.STEP_OUT, DebugCommands.PAUSE);
472
- registerMenuActions(DebugMenus.DEBUG_SESSIONS, DebugCommands.CONTINUE_ALL, DebugCommands.PAUSE_ALL);
473
- registerMenuActions(DebugMenus.DEBUG_BREAKPOINT, DebugCommands.TOGGLE_BREAKPOINT);
474
- menus.registerSubmenu(DebugMenus.DEBUG_NEW_BREAKPOINT, nls_1.nls.localizeByDefault('New Breakpoint'));
475
- registerMenuActions(DebugMenus.DEBUG_NEW_BREAKPOINT, DebugCommands.ADD_CONDITIONAL_BREAKPOINT, DebugCommands.INLINE_BREAKPOINT, DebugCommands.ADD_FUNCTION_BREAKPOINT, DebugCommands.ADD_LOGPOINT);
476
- registerMenuActions(DebugMenus.DEBUG_BREAKPOINTS, DebugCommands.ENABLE_ALL_BREAKPOINTS, DebugCommands.DISABLE_ALL_BREAKPOINTS, DebugCommands.REMOVE_ALL_BREAKPOINTS);
477
- registerMenuActions(debug_threads_widget_1.DebugThreadsWidget.CONTROL_MENU, Object.assign(Object.assign({}, DebugCommands.PAUSE), DebugThreadContextCommands.PAUSE), Object.assign(Object.assign({}, DebugCommands.CONTINUE), DebugThreadContextCommands.CONTINUE), Object.assign(Object.assign({}, DebugCommands.STEP_OVER), DebugThreadContextCommands.STEP_OVER), Object.assign(Object.assign({}, DebugCommands.STEP_INTO), DebugThreadContextCommands.STEP_INTO), Object.assign(Object.assign({}, DebugCommands.STEP_OUT), DebugThreadContextCommands.STEP_OUT), Object.assign(Object.assign({}, DebugCommands.PAUSE_ALL), DebugSessionContextCommands.PAUSE_ALL), Object.assign(Object.assign({}, DebugCommands.CONTINUE_ALL), DebugSessionContextCommands.CONTINUE_ALL));
478
- registerMenuActions(debug_threads_widget_1.DebugThreadsWidget.TERMINATE_MENU, Object.assign(Object.assign({}, DebugCommands.RESTART), DebugSessionContextCommands.RESTART), Object.assign(Object.assign({}, DebugCommands.STOP), DebugSessionContextCommands.STOP), Object.assign(Object.assign({}, DebugThreadContextCommands.TERMINATE), { label: nls_1.nls.localizeByDefault('Terminate Thread') }));
479
- registerMenuActions(debug_threads_widget_1.DebugThreadsWidget.OPEN_MENU, Object.assign(Object.assign({}, DebugSessionContextCommands.REVEAL), { label: nls_1.nls.localize('theia/debug/reveal', 'Reveal') }));
480
- registerMenuActions(debug_stack_frames_widget_1.DebugStackFramesWidget.CONTEXT_MENU, DebugCommands.RESTART_FRAME, DebugCommands.COPY_CALL_STACK);
481
- registerMenuActions(debug_variables_widget_1.DebugVariablesWidget.EDIT_MENU, DebugCommands.SET_VARIABLE_VALUE, DebugCommands.COPY_VARIABLE_VALUE, DebugCommands.COPY_VARIABLE_AS_EXPRESSION);
482
- registerMenuActions(debug_variables_widget_1.DebugVariablesWidget.WATCH_MENU, DebugCommands.WATCH_VARIABLE);
483
- registerMenuActions(debug_watch_widget_1.DebugWatchWidget.EDIT_MENU, DebugCommands.EDIT_WATCH_EXPRESSION, DebugCommands.COPY_WATCH_EXPRESSION_VALUE);
484
- registerMenuActions(debug_watch_widget_1.DebugWatchWidget.REMOVE_MENU, DebugCommands.REMOVE_WATCH_EXPRESSION, DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS);
485
- registerMenuActions(debug_breakpoints_widget_1.DebugBreakpointsWidget.EDIT_MENU, DebugCommands.EDIT_BREAKPOINT, DebugCommands.EDIT_LOGPOINT);
486
- registerMenuActions(debug_breakpoints_widget_1.DebugBreakpointsWidget.REMOVE_MENU, DebugCommands.REMOVE_BREAKPOINT, DebugCommands.REMOVE_LOGPOINT, DebugCommands.REMOVE_ALL_BREAKPOINTS);
487
- registerMenuActions(debug_breakpoints_widget_1.DebugBreakpointsWidget.ENABLE_MENU, DebugCommands.ENABLE_ALL_BREAKPOINTS, DebugCommands.DISABLE_ALL_BREAKPOINTS);
488
- registerMenuActions(debug_editor_model_1.DebugEditorModel.CONTEXT_MENU, Object.assign(Object.assign({}, DebugEditorContextCommands.ADD_BREAKPOINT), { label: nls_1.nls.localizeByDefault('Add Breakpoint') }), Object.assign(Object.assign({}, DebugEditorContextCommands.ADD_CONDITIONAL_BREAKPOINT), { label: DebugCommands.ADD_CONDITIONAL_BREAKPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.ADD_LOGPOINT), { label: DebugCommands.ADD_LOGPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.REMOVE_BREAKPOINT), { label: DebugCommands.REMOVE_BREAKPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.EDIT_BREAKPOINT), { label: DebugCommands.EDIT_BREAKPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.ENABLE_BREAKPOINT), { label: nlsEnableBreakpoint('Breakpoint') }), Object.assign(Object.assign({}, DebugEditorContextCommands.DISABLE_BREAKPOINT), { label: nlsDisableBreakpoint('Breakpoint') }), Object.assign(Object.assign({}, DebugEditorContextCommands.REMOVE_LOGPOINT), { label: DebugCommands.REMOVE_LOGPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.EDIT_LOGPOINT), { label: DebugCommands.EDIT_LOGPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.ENABLE_LOGPOINT), { label: nlsEnableBreakpoint('Logpoint') }), Object.assign(Object.assign({}, DebugEditorContextCommands.DISABLE_LOGPOINT), { label: nlsDisableBreakpoint('Logpoint') }));
489
- }
490
- registerCommands(registry) {
491
- super.registerCommands(registry);
492
- registry.registerCommand(DebugCommands.START, {
493
- execute: (config) => this.start(false, config)
494
- });
495
- registry.registerCommand(DebugCommands.START_NO_DEBUG, {
496
- execute: (config) => this.start(true, config)
497
- });
498
- registry.registerCommand(DebugCommands.STOP, {
499
- execute: () => this.manager.terminateSession(),
500
- isEnabled: () => this.manager.state !== debug_session_1.DebugState.Inactive
501
- });
502
- registry.registerCommand(DebugCommands.RESTART, {
503
- execute: () => this.manager.restartSession(),
504
- isEnabled: () => this.manager.state !== debug_session_1.DebugState.Inactive
505
- });
506
- registry.registerCommand(DebugCommands.OPEN_CONFIGURATIONS, {
507
- execute: () => this.configurations.openConfiguration()
508
- });
509
- registry.registerCommand(DebugCommands.ADD_CONFIGURATION, {
510
- execute: () => this.configurations.addConfiguration()
511
- });
512
- registry.registerCommand(DebugCommands.STEP_OVER, {
513
- execute: () => this.manager.currentThread && this.manager.currentThread.stepOver(),
514
- isEnabled: () => this.manager.state === debug_session_1.DebugState.Stopped
515
- });
516
- registry.registerCommand(DebugCommands.STEP_INTO, {
517
- execute: () => this.manager.currentThread && this.manager.currentThread.stepIn(),
518
- isEnabled: () => this.manager.state === debug_session_1.DebugState.Stopped
519
- });
520
- registry.registerCommand(DebugCommands.STEP_OUT, {
521
- execute: () => this.manager.currentThread && this.manager.currentThread.stepOut(),
522
- isEnabled: () => this.manager.state === debug_session_1.DebugState.Stopped
523
- });
524
- registry.registerCommand(DebugCommands.CONTINUE, {
525
- execute: () => this.manager.currentThread && this.manager.currentThread.continue(),
526
- isEnabled: () => this.manager.state === debug_session_1.DebugState.Stopped
527
- });
528
- registry.registerCommand(DebugCommands.PAUSE, {
529
- execute: () => this.manager.currentThread && this.manager.currentThread.pause(),
530
- isEnabled: () => this.manager.state === debug_session_1.DebugState.Running
531
- });
532
- registry.registerCommand(DebugCommands.PAUSE_ALL, {
533
- execute: () => this.manager.currentSession && this.manager.currentSession.pauseAll(),
534
- isEnabled: () => !!this.manager.currentSession && !!this.manager.currentSession.runningThreads.next().value
535
- });
536
- registry.registerCommand(DebugCommands.CONTINUE_ALL, {
537
- execute: () => this.manager.currentSession && this.manager.currentSession.continueAll(),
538
- isEnabled: () => !!this.manager.currentSession && !!this.manager.currentSession.stoppedThreads.next().value
539
- });
540
- registry.registerCommand(DebugThreadContextCommands.STEP_OVER, {
541
- execute: () => this.selectedThread && this.selectedThread.stepOver(),
542
- isEnabled: () => !!this.selectedThread && this.selectedThread.stopped,
543
- isVisible: () => !!this.selectedThread
544
- });
545
- registry.registerCommand(DebugThreadContextCommands.STEP_INTO, {
546
- execute: () => this.selectedThread && this.selectedThread.stepIn(),
547
- isEnabled: () => !!this.selectedThread && this.selectedThread.stopped,
548
- isVisible: () => !!this.selectedThread
549
- });
550
- registry.registerCommand(DebugThreadContextCommands.STEP_OUT, {
551
- execute: () => this.selectedThread && this.selectedThread.stepOut(),
552
- isEnabled: () => !!this.selectedThread && this.selectedThread.stopped,
553
- isVisible: () => !!this.selectedThread
554
- });
555
- registry.registerCommand(DebugThreadContextCommands.CONTINUE, {
556
- execute: () => this.selectedThread && this.selectedThread.continue(),
557
- isEnabled: () => !!this.selectedThread && this.selectedThread.stopped,
558
- isVisible: () => !!this.selectedThread && this.selectedThread.stopped,
559
- });
560
- registry.registerCommand(DebugThreadContextCommands.PAUSE, {
561
- execute: () => this.selectedThread && this.selectedThread.pause(),
562
- isEnabled: () => !!this.selectedThread && !this.selectedThread.stopped,
563
- isVisible: () => !!this.selectedThread && !this.selectedThread.stopped,
564
- });
565
- registry.registerCommand(DebugThreadContextCommands.TERMINATE, {
566
- execute: () => this.selectedThread && this.selectedThread.terminate(),
567
- isEnabled: () => !!this.selectedThread && this.selectedThread.supportsTerminate,
568
- isVisible: () => !!this.selectedThread && this.selectedThread.supportsTerminate
569
- });
570
- registry.registerCommand(DebugSessionContextCommands.STOP, {
571
- execute: () => this.selectedSession && this.manager.terminateSession(this.selectedSession),
572
- isEnabled: () => !!this.selectedSession && this.selectedSession.state !== debug_session_1.DebugState.Inactive,
573
- isVisible: () => !this.selectedThread
574
- });
575
- registry.registerCommand(DebugSessionContextCommands.RESTART, {
576
- execute: () => this.selectedSession && this.manager.restartSession(this.selectedSession),
577
- isEnabled: () => !!this.selectedSession && this.selectedSession.state !== debug_session_1.DebugState.Inactive,
578
- isVisible: () => !this.selectedThread
579
- });
580
- registry.registerCommand(DebugSessionContextCommands.CONTINUE_ALL, {
581
- execute: () => this.selectedSession && this.selectedSession.continueAll(),
582
- isEnabled: () => !!this.selectedSession && !!this.selectedSession.stoppedThreads.next().value,
583
- isVisible: () => !this.selectedThread
584
- });
585
- registry.registerCommand(DebugSessionContextCommands.PAUSE_ALL, {
586
- execute: () => this.selectedSession && this.selectedSession.pauseAll(),
587
- isEnabled: () => !!this.selectedSession && !!this.selectedSession.runningThreads.next().value,
588
- isVisible: () => !this.selectedThread
589
- });
590
- registry.registerCommand(DebugSessionContextCommands.REVEAL, {
591
- execute: () => this.selectedSession && this.revealSession(this.selectedSession),
592
- isEnabled: () => Boolean(this.selectedSession),
593
- isVisible: () => !this.selectedThread && Boolean(this.selectedSession)
594
- });
595
- registry.registerCommand(DebugCommands.TOGGLE_BREAKPOINT, {
596
- execute: () => this.editors.toggleBreakpoint(),
597
- isEnabled: () => !!this.editors.model
598
- });
599
- registry.registerCommand(DebugCommands.INLINE_BREAKPOINT, {
600
- execute: () => this.editors.addInlineBreakpoint(),
601
- isEnabled: () => !!this.editors.model && !this.editors.getInlineBreakpoint()
602
- });
603
- registry.registerCommand(DebugCommands.ADD_CONDITIONAL_BREAKPOINT, {
604
- execute: () => this.editors.addBreakpoint('condition'),
605
- isEnabled: () => !!this.editors.model && !this.editors.anyBreakpoint()
606
- });
607
- registry.registerCommand(DebugCommands.ADD_LOGPOINT, {
608
- execute: () => this.editors.addBreakpoint('logMessage'),
609
- isEnabled: () => !!this.editors.model && !this.editors.anyBreakpoint()
610
- });
611
- registry.registerCommand(DebugCommands.ADD_FUNCTION_BREAKPOINT, {
612
- execute: async () => {
613
- const { labelProvider, breakpointManager, editorManager } = this;
614
- const options = { labelProvider, breakpoints: breakpointManager, editorManager };
615
- await new debug_function_breakpoint_1.DebugFunctionBreakpoint(breakpoint_marker_1.FunctionBreakpoint.create({ name: '' }), options).open();
616
- },
617
- isEnabled: widget => !(widget instanceof browser_1.Widget) || widget instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget,
618
- isVisible: widget => !(widget instanceof browser_1.Widget) || widget instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget
619
- });
620
- registry.registerCommand(DebugCommands.ENABLE_ALL_BREAKPOINTS, {
621
- execute: () => this.breakpointManager.enableAllBreakpoints(true),
622
- isEnabled: () => this.breakpointManager.hasBreakpoints()
623
- });
624
- registry.registerCommand(DebugCommands.DISABLE_ALL_BREAKPOINTS, {
625
- execute: () => this.breakpointManager.enableAllBreakpoints(false),
626
- isEnabled: () => this.breakpointManager.hasBreakpoints()
627
- });
628
- registry.registerCommand(DebugCommands.EDIT_BREAKPOINT, {
629
- execute: async () => {
630
- const { selectedBreakpoint, selectedFunctionBreakpoint } = this;
631
- if (selectedBreakpoint) {
632
- await this.editors.editBreakpoint(selectedBreakpoint);
633
- }
634
- else if (selectedFunctionBreakpoint) {
635
- await selectedFunctionBreakpoint.open();
636
- }
637
- },
638
- isEnabled: () => !!this.selectedBreakpoint || !!this.selectedFunctionBreakpoint,
639
- isVisible: () => !!this.selectedBreakpoint || !!this.selectedFunctionBreakpoint
640
- });
641
- registry.registerCommand(DebugCommands.EDIT_LOGPOINT, {
642
- execute: async () => {
643
- const { selectedLogpoint } = this;
644
- if (selectedLogpoint) {
645
- await this.editors.editBreakpoint(selectedLogpoint);
646
- }
647
- },
648
- isEnabled: () => !!this.selectedLogpoint,
649
- isVisible: () => !!this.selectedLogpoint
650
- });
651
- registry.registerCommand(DebugCommands.REMOVE_BREAKPOINT, {
652
- execute: () => {
653
- const selectedBreakpoint = this.selectedSettableBreakpoint;
654
- if (selectedBreakpoint) {
655
- selectedBreakpoint.remove();
656
- }
657
- },
658
- isEnabled: () => Boolean(this.selectedSettableBreakpoint),
659
- isVisible: () => Boolean(this.selectedSettableBreakpoint),
660
- });
661
- registry.registerCommand(DebugCommands.REMOVE_LOGPOINT, {
662
- execute: () => {
663
- const { selectedLogpoint } = this;
664
- if (selectedLogpoint) {
665
- selectedLogpoint.remove();
666
- }
667
- },
668
- isEnabled: () => !!this.selectedLogpoint,
669
- isVisible: () => !!this.selectedLogpoint
670
- });
671
- registry.registerCommand(DebugCommands.REMOVE_ALL_BREAKPOINTS, {
672
- execute: () => this.breakpointManager.removeBreakpoints(),
673
- isEnabled: () => this.breakpointManager.hasBreakpoints(),
674
- isVisible: widget => !(widget instanceof browser_1.Widget) || (widget instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget)
675
- });
676
- registry.registerCommand(DebugCommands.TOGGLE_BREAKPOINTS_ENABLED, {
677
- execute: () => this.breakpointManager.breakpointsEnabled = !this.breakpointManager.breakpointsEnabled,
678
- isVisible: arg => arg instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget
679
- });
680
- registry.registerCommand(DebugCommands.SHOW_HOVER, {
681
- execute: () => this.editors.showHover(),
682
- isEnabled: () => this.editors.canShowHover()
683
- });
684
- registry.registerCommand(DebugCommands.RESTART_FRAME, {
685
- execute: () => this.selectedFrame && this.selectedFrame.restart(),
686
- isEnabled: () => !!this.selectedFrame
687
- });
688
- registry.registerCommand(DebugCommands.COPY_CALL_STACK, {
689
- execute: () => {
690
- const { frames } = this;
691
- const selection = document.getSelection();
692
- if (frames && selection) {
693
- selection.selectAllChildren(frames.node);
694
- document.execCommand('copy');
695
- }
696
- },
697
- isEnabled: () => document.queryCommandSupported('copy'),
698
- isVisible: () => document.queryCommandSupported('copy')
699
- });
700
- registry.registerCommand(DebugCommands.SET_VARIABLE_VALUE, {
701
- execute: () => this.selectedVariable && this.selectedVariable.open(),
702
- isEnabled: () => !!this.selectedVariable && this.selectedVariable.supportSetVariable,
703
- isVisible: () => !!this.selectedVariable && this.selectedVariable.supportSetVariable
704
- });
705
- registry.registerCommand(DebugCommands.COPY_VARIABLE_VALUE, {
706
- execute: () => this.selectedVariable && this.selectedVariable.copyValue(),
707
- isEnabled: () => !!this.selectedVariable && this.selectedVariable.supportCopyValue,
708
- isVisible: () => !!this.selectedVariable && this.selectedVariable.supportCopyValue
709
- });
710
- registry.registerCommand(DebugCommands.COPY_VARIABLE_AS_EXPRESSION, {
711
- execute: () => this.selectedVariable && this.selectedVariable.copyAsExpression(),
712
- isEnabled: () => !!this.selectedVariable && this.selectedVariable.supportCopyAsExpression,
713
- isVisible: () => !!this.selectedVariable && this.selectedVariable.supportCopyAsExpression
714
- });
715
- registry.registerCommand(DebugCommands.WATCH_VARIABLE, {
716
- execute: () => {
717
- const { selectedVariable, watch } = this;
718
- if (selectedVariable && watch) {
719
- watch.viewModel.addWatchExpression(selectedVariable.name);
720
- }
721
- },
722
- isEnabled: () => !!this.selectedVariable && !!this.watch,
723
- isVisible: () => !!this.selectedVariable && !!this.watch,
724
- });
725
- // Debug context menu commands
726
- registry.registerCommand(DebugEditorContextCommands.ADD_BREAKPOINT, {
727
- execute: position => this.isPosition(position) && this.editors.toggleBreakpoint(position),
728
- isEnabled: position => this.isPosition(position) && !this.editors.anyBreakpoint(position),
729
- isVisible: position => this.isPosition(position) && !this.editors.anyBreakpoint(position)
730
- });
731
- registry.registerCommand(DebugEditorContextCommands.ADD_CONDITIONAL_BREAKPOINT, {
732
- execute: position => this.isPosition(position) && this.editors.addBreakpoint('condition', position),
733
- isEnabled: position => this.isPosition(position) && !this.editors.anyBreakpoint(position),
734
- isVisible: position => this.isPosition(position) && !this.editors.anyBreakpoint(position)
735
- });
736
- registry.registerCommand(DebugEditorContextCommands.ADD_LOGPOINT, {
737
- execute: position => this.isPosition(position) && this.editors.addBreakpoint('logMessage', position),
738
- isEnabled: position => this.isPosition(position) && !this.editors.anyBreakpoint(position),
739
- isVisible: position => this.isPosition(position) && !this.editors.anyBreakpoint(position)
740
- });
741
- registry.registerCommand(DebugEditorContextCommands.REMOVE_BREAKPOINT, {
742
- execute: position => this.isPosition(position) && this.editors.toggleBreakpoint(position),
743
- isEnabled: position => this.isPosition(position) && !!this.editors.getBreakpoint(position),
744
- isVisible: position => this.isPosition(position) && !!this.editors.getBreakpoint(position)
745
- });
746
- registry.registerCommand(DebugEditorContextCommands.EDIT_BREAKPOINT, {
747
- execute: position => this.isPosition(position) && this.editors.editBreakpoint(position),
748
- isEnabled: position => this.isPosition(position) && !!this.editors.getBreakpoint(position),
749
- isVisible: position => this.isPosition(position) && !!this.editors.getBreakpoint(position)
750
- });
751
- registry.registerCommand(DebugEditorContextCommands.ENABLE_BREAKPOINT, {
752
- execute: position => this.isPosition(position) && this.editors.setBreakpointEnabled(position, true),
753
- isEnabled: position => this.isPosition(position) && this.editors.getBreakpointEnabled(position) === false,
754
- isVisible: position => this.isPosition(position) && this.editors.getBreakpointEnabled(position) === false
755
- });
756
- registry.registerCommand(DebugEditorContextCommands.DISABLE_BREAKPOINT, {
757
- execute: position => this.isPosition(position) && this.editors.setBreakpointEnabled(position, false),
758
- isEnabled: position => this.isPosition(position) && !!this.editors.getBreakpointEnabled(position),
759
- isVisible: position => this.isPosition(position) && !!this.editors.getBreakpointEnabled(position)
760
- });
761
- registry.registerCommand(DebugEditorContextCommands.REMOVE_LOGPOINT, {
762
- execute: position => this.isPosition(position) && this.editors.toggleBreakpoint(position),
763
- isEnabled: position => this.isPosition(position) && !!this.editors.getLogpoint(position),
764
- isVisible: position => this.isPosition(position) && !!this.editors.getLogpoint(position)
765
- });
766
- registry.registerCommand(DebugEditorContextCommands.EDIT_LOGPOINT, {
767
- execute: position => this.isPosition(position) && this.editors.editBreakpoint(position),
768
- isEnabled: position => this.isPosition(position) && !!this.editors.getLogpoint(position),
769
- isVisible: position => this.isPosition(position) && !!this.editors.getLogpoint(position)
770
- });
771
- registry.registerCommand(DebugEditorContextCommands.ENABLE_LOGPOINT, {
772
- execute: position => this.isPosition(position) && this.editors.setBreakpointEnabled(position, true),
773
- isEnabled: position => this.isPosition(position) && this.editors.getLogpointEnabled(position) === false,
774
- isVisible: position => this.isPosition(position) && this.editors.getLogpointEnabled(position) === false
775
- });
776
- registry.registerCommand(DebugEditorContextCommands.DISABLE_LOGPOINT, {
777
- execute: position => this.isPosition(position) && this.editors.setBreakpointEnabled(position, false),
778
- isEnabled: position => this.isPosition(position) && !!this.editors.getLogpointEnabled(position),
779
- isVisible: position => this.isPosition(position) && !!this.editors.getLogpointEnabled(position)
780
- });
781
- registry.registerCommand(DebugBreakpointWidgetCommands.ACCEPT, {
782
- execute: () => this.editors.acceptBreakpoint()
783
- });
784
- registry.registerCommand(DebugBreakpointWidgetCommands.CLOSE, {
785
- execute: () => this.editors.closeBreakpoint()
786
- });
787
- registry.registerCommand(DebugCommands.ADD_WATCH_EXPRESSION, {
788
- execute: widget => {
789
- if (widget instanceof browser_1.Widget) {
790
- if (widget instanceof debug_watch_widget_1.DebugWatchWidget) {
791
- widget.viewModel.addWatchExpression();
792
- }
793
- }
794
- else if (this.watch) {
795
- this.watch.viewModel.addWatchExpression();
796
- }
797
- },
798
- isEnabled: widget => widget instanceof browser_1.Widget ? widget instanceof debug_watch_widget_1.DebugWatchWidget : !!this.watch,
799
- isVisible: widget => widget instanceof browser_1.Widget ? widget instanceof debug_watch_widget_1.DebugWatchWidget : !!this.watch
800
- });
801
- registry.registerCommand(DebugCommands.EDIT_WATCH_EXPRESSION, {
802
- execute: () => {
803
- const { watchExpression } = this;
804
- if (watchExpression) {
805
- watchExpression.open();
806
- }
807
- },
808
- isEnabled: () => !!this.watchExpression,
809
- isVisible: () => !!this.watchExpression
810
- });
811
- registry.registerCommand(DebugCommands.COPY_WATCH_EXPRESSION_VALUE, {
812
- execute: () => this.watchExpression && this.watchExpression.copyValue(),
813
- isEnabled: () => !!this.watchExpression && this.watchExpression.supportCopyValue,
814
- isVisible: () => !!this.watchExpression && this.watchExpression.supportCopyValue
815
- });
816
- registry.registerCommand(DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS, {
817
- execute: widget => {
818
- if (widget instanceof debug_watch_widget_1.DebugWatchWidget) {
819
- const root = widget.model.root;
820
- widget.model.collapseAll(browser_1.CompositeTreeNode.is(root) ? root : undefined);
821
- }
822
- },
823
- isEnabled: widget => widget instanceof debug_watch_widget_1.DebugWatchWidget,
824
- isVisible: widget => widget instanceof debug_watch_widget_1.DebugWatchWidget
825
- });
826
- registry.registerCommand(DebugCommands.REMOVE_WATCH_EXPRESSION, {
827
- execute: () => {
828
- const { watch, watchExpression } = this;
829
- if (watch && watchExpression) {
830
- watch.viewModel.removeWatchExpression(watchExpression);
831
- }
832
- },
833
- isEnabled: () => !!this.watchExpression,
834
- isVisible: () => !!this.watchExpression
835
- });
836
- registry.registerCommand(DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS, {
837
- execute: widget => {
838
- if (widget instanceof browser_1.Widget) {
839
- if (widget instanceof debug_watch_widget_1.DebugWatchWidget) {
840
- widget.viewModel.removeWatchExpressions();
841
- }
842
- }
843
- else if (this.watch) {
844
- this.watch.viewModel.removeWatchExpressions();
845
- }
846
- },
847
- isEnabled: widget => widget instanceof browser_1.Widget ? widget instanceof debug_watch_widget_1.DebugWatchWidget : !!this.watch,
848
- isVisible: widget => widget instanceof browser_1.Widget ? widget instanceof debug_watch_widget_1.DebugWatchWidget : !!this.watch
849
- });
850
- }
851
- registerKeybindings(keybindings) {
852
- super.registerKeybindings(keybindings);
853
- keybindings.registerKeybinding({
854
- command: DebugCommands.START.id,
855
- keybinding: 'f5'
856
- });
857
- keybindings.registerKeybinding({
858
- command: DebugCommands.START_NO_DEBUG.id,
859
- keybinding: 'ctrl+f5'
860
- });
861
- keybindings.registerKeybinding({
862
- command: DebugCommands.STOP.id,
863
- keybinding: 'shift+f5',
864
- context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
865
- });
866
- keybindings.registerKeybinding({
867
- command: DebugCommands.RESTART.id,
868
- keybinding: 'shift+ctrlcmd+f5',
869
- context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
870
- });
871
- keybindings.registerKeybinding({
872
- command: DebugCommands.STEP_OVER.id,
873
- keybinding: 'f10',
874
- context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
875
- });
876
- keybindings.registerKeybinding({
877
- command: DebugCommands.STEP_INTO.id,
878
- keybinding: 'f11',
879
- context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
880
- });
881
- keybindings.registerKeybinding({
882
- command: DebugCommands.STEP_OUT.id,
883
- keybinding: 'shift+f11',
884
- context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
885
- });
886
- keybindings.registerKeybinding({
887
- command: DebugCommands.CONTINUE.id,
888
- keybinding: 'f5',
889
- context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
890
- });
891
- keybindings.registerKeybinding({
892
- command: DebugCommands.PAUSE.id,
893
- keybinding: 'f6',
894
- context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
895
- });
896
- keybindings.registerKeybinding({
897
- command: DebugCommands.TOGGLE_BREAKPOINT.id,
898
- keybinding: 'f9',
899
- context: browser_2.EditorKeybindingContexts.editorTextFocus
900
- });
901
- keybindings.registerKeybinding({
902
- command: DebugCommands.INLINE_BREAKPOINT.id,
903
- keybinding: 'shift+f9',
904
- context: browser_2.EditorKeybindingContexts.editorTextFocus
905
- });
906
- keybindings.registerKeybinding({
907
- command: DebugBreakpointWidgetCommands.ACCEPT.id,
908
- keybinding: 'enter',
909
- context: debug_keybinding_contexts_1.DebugKeybindingContexts.breakpointWidgetInputFocus
910
- });
911
- keybindings.registerKeybinding({
912
- command: DebugBreakpointWidgetCommands.CLOSE.id,
913
- keybinding: 'esc',
914
- context: debug_keybinding_contexts_1.DebugKeybindingContexts.breakpointWidgetInputStrictFocus
915
- });
916
- }
917
- registerToolbarItems(toolbar) {
918
- const onDidChangeToggleBreakpointsEnabled = new common_1.Emitter();
919
- const toggleBreakpointsEnabled = {
920
- id: DebugCommands.TOGGLE_BREAKPOINTS_ENABLED.id,
921
- command: DebugCommands.TOGGLE_BREAKPOINTS_ENABLED.id,
922
- icon: (0, browser_1.codicon)('activate-breakpoints'),
923
- onDidChange: onDidChangeToggleBreakpointsEnabled.event,
924
- priority: 1
925
- };
926
- const updateToggleBreakpointsEnabled = () => {
927
- const activateBreakpoints = nls_1.nls.localizeByDefault('Enable All Breakpoints');
928
- const deactivateBreakpoints = nls_1.nls.localizeByDefault('Disable All Breakpoints');
929
- const tooltip = this.breakpointManager.breakpointsEnabled ? deactivateBreakpoints : activateBreakpoints;
930
- if (toggleBreakpointsEnabled.tooltip !== tooltip) {
931
- toggleBreakpointsEnabled.tooltip = tooltip;
932
- onDidChangeToggleBreakpointsEnabled.fire(undefined);
933
- }
934
- };
935
- toolbar.registerItem({
936
- id: DebugCommands.ADD_FUNCTION_BREAKPOINT.id,
937
- command: DebugCommands.ADD_FUNCTION_BREAKPOINT.id,
938
- icon: (0, browser_1.codicon)('add'),
939
- tooltip: DebugCommands.ADD_FUNCTION_BREAKPOINT.label
940
- });
941
- updateToggleBreakpointsEnabled();
942
- this.breakpointManager.onDidChangeBreakpoints(updateToggleBreakpointsEnabled);
943
- toolbar.registerItem(toggleBreakpointsEnabled);
944
- toolbar.registerItem({
945
- id: DebugCommands.REMOVE_ALL_BREAKPOINTS.id,
946
- command: DebugCommands.REMOVE_ALL_BREAKPOINTS.id,
947
- icon: (0, browser_1.codicon)('close-all'),
948
- priority: 2
949
- });
950
- toolbar.registerItem({
951
- id: DebugCommands.ADD_WATCH_EXPRESSION.id,
952
- command: DebugCommands.ADD_WATCH_EXPRESSION.id,
953
- icon: (0, browser_1.codicon)('add'),
954
- tooltip: DebugCommands.ADD_WATCH_EXPRESSION.label
955
- });
956
- toolbar.registerItem({
957
- id: DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS.id,
958
- command: DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS.id,
959
- icon: (0, browser_1.codicon)('collapse-all'),
960
- tooltip: DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS.label,
961
- priority: 1
962
- });
963
- toolbar.registerItem({
964
- id: DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS.id,
965
- command: DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS.id,
966
- icon: (0, browser_1.codicon)('close-all'),
967
- tooltip: DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS.label,
968
- priority: 2
969
- });
970
- }
971
- async openSession(session, options) {
972
- const { reveal } = Object.assign({ reveal: true }, options);
973
- const debugWidget = await this.openView({ reveal });
974
- debugWidget.sessionManager.currentSession = session;
975
- return debugWidget['sessionWidget'];
976
- }
977
- revealSession(session) {
978
- var _a;
979
- const widget = (_a = this.tryGetWidget()) === null || _a === void 0 ? void 0 : _a['sessionWidget'];
980
- if (widget) {
981
- this.shell.revealWidget(widget.id);
982
- }
983
- return widget;
984
- }
985
- async start(noDebug, debugSessionOptions) {
986
- let current = debugSessionOptions ? debugSessionOptions : this.configurations.current;
987
- // If no configurations are currently present, create the `launch.json` and prompt users to select the config.
988
- if (!current) {
989
- await this.configurations.addConfiguration();
990
- return;
991
- }
992
- if (noDebug !== undefined) {
993
- if (current.configuration) {
994
- current = Object.assign(Object.assign({}, current), { configuration: Object.assign(Object.assign({}, current.configuration), { noDebug }) });
995
- }
996
- else {
997
- current = Object.assign(Object.assign({}, current), { noDebug });
998
- }
999
- }
1000
- await this.manager.start(current);
1001
- }
1002
- get threads() {
1003
- const { currentWidget } = this.shell;
1004
- return currentWidget instanceof debug_threads_widget_1.DebugThreadsWidget && currentWidget || undefined;
1005
- }
1006
- get selectedSession() {
1007
- const { threads } = this;
1008
- return threads && threads.selectedElement instanceof debug_session_1.DebugSession && threads.selectedElement || undefined;
1009
- }
1010
- get selectedThread() {
1011
- const { threads } = this;
1012
- return threads && threads.selectedElement instanceof debug_thread_1.DebugThread && threads.selectedElement || undefined;
1013
- }
1014
- get frames() {
1015
- const { currentWidget } = this.shell;
1016
- return currentWidget instanceof debug_stack_frames_widget_1.DebugStackFramesWidget && currentWidget || undefined;
1017
- }
1018
- get selectedFrame() {
1019
- const { frames } = this;
1020
- return frames && frames.selectedElement instanceof debug_stack_frame_1.DebugStackFrame && frames.selectedElement || undefined;
1021
- }
1022
- get breakpoints() {
1023
- const { currentWidget } = this.shell;
1024
- return currentWidget instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget && currentWidget || undefined;
1025
- }
1026
- get selectedAnyBreakpoint() {
1027
- const { breakpoints } = this;
1028
- const selectedElement = breakpoints && breakpoints.selectedElement;
1029
- return selectedElement instanceof debug_breakpoint_1.DebugBreakpoint ? selectedElement : undefined;
1030
- }
1031
- get selectedBreakpoint() {
1032
- const breakpoint = this.selectedAnyBreakpoint;
1033
- return breakpoint && breakpoint instanceof debug_source_breakpoint_1.DebugSourceBreakpoint && !breakpoint.logMessage ? breakpoint : undefined;
1034
- }
1035
- get selectedLogpoint() {
1036
- const breakpoint = this.selectedAnyBreakpoint;
1037
- return breakpoint && breakpoint instanceof debug_source_breakpoint_1.DebugSourceBreakpoint && !!breakpoint.logMessage ? breakpoint : undefined;
1038
- }
1039
- get selectedFunctionBreakpoint() {
1040
- const breakpoint = this.selectedAnyBreakpoint;
1041
- return breakpoint && breakpoint instanceof debug_function_breakpoint_1.DebugFunctionBreakpoint ? breakpoint : undefined;
1042
- }
1043
- get selectedInstructionBreakpoint() {
1044
- if (this.selectedAnyBreakpoint instanceof debug_instruction_breakpoint_1.DebugInstructionBreakpoint) {
1045
- return this.selectedAnyBreakpoint;
1046
- }
1047
- }
1048
- get selectedSettableBreakpoint() {
1049
- const selected = this.selectedAnyBreakpoint;
1050
- if (selected instanceof debug_function_breakpoint_1.DebugFunctionBreakpoint || selected instanceof debug_instruction_breakpoint_1.DebugInstructionBreakpoint || selected instanceof debug_source_breakpoint_1.DebugSourceBreakpoint) {
1051
- return selected;
1052
- }
1053
- }
1054
- get variables() {
1055
- const { currentWidget } = this.shell;
1056
- return currentWidget instanceof debug_variables_widget_1.DebugVariablesWidget && currentWidget || undefined;
1057
- }
1058
- get selectedVariable() {
1059
- const { variables } = this;
1060
- return variables && variables.selectedElement instanceof debug_console_items_1.DebugVariable && variables.selectedElement || undefined;
1061
- }
1062
- get watch() {
1063
- const { currentWidget } = this.shell;
1064
- return currentWidget instanceof debug_watch_widget_1.DebugWatchWidget && currentWidget || undefined;
1065
- }
1066
- get watchExpression() {
1067
- const { watch } = this;
1068
- return watch && watch.selectedElement instanceof debug_watch_expression_1.DebugWatchExpression && watch.selectedElement || undefined;
1069
- }
1070
- isPosition(position) {
1071
- return (position instanceof monaco.Position);
1072
- }
1073
- registerColors(colors) {
1074
- colors.register(
1075
- // Debug colors should be aligned with https://code.visualstudio.com/api/references/theme-color#debug-colors
1076
- {
1077
- id: 'editor.stackFrameHighlightBackground',
1078
- defaults: {
1079
- dark: '#ffff0033',
1080
- light: '#ffff6673',
1081
- hcDark: '#fff600',
1082
- hcLight: '#ffff6673'
1083
- }, description: 'Background color for the highlight of line at the top stack frame position.'
1084
- }, {
1085
- id: 'editor.focusedStackFrameHighlightBackground',
1086
- defaults: {
1087
- dark: '#7abd7a4d',
1088
- light: '#cee7ce73',
1089
- hcDark: '#cee7ce',
1090
- hcLight: '#cee7ce73'
1091
- }, description: 'Background color for the highlight of line at focused stack frame position.'
1092
- },
1093
- // Status bar colors should be aligned with debugging colors from https://code.visualstudio.com/api/references/theme-color#status-bar-colors
1094
- {
1095
- id: 'statusBar.debuggingBackground', defaults: {
1096
- dark: '#CC6633',
1097
- light: '#CC6633',
1098
- hcDark: '#CC6633',
1099
- hcLight: '#B5200D'
1100
- }, description: 'Status bar background color when a program is being debugged. The status bar is shown in the bottom of the window'
1101
- }, {
1102
- id: 'statusBar.debuggingForeground', defaults: {
1103
- dark: 'statusBar.foreground',
1104
- light: 'statusBar.foreground',
1105
- hcDark: 'statusBar.foreground',
1106
- hcLight: 'statusBar.foreground'
1107
- }, description: 'Status bar foreground color when a program is being debugged. The status bar is shown in the bottom of the window'
1108
- }, {
1109
- id: 'statusBar.debuggingBorder', defaults: {
1110
- dark: 'statusBar.border',
1111
- light: 'statusBar.border',
1112
- hcDark: 'statusBar.border',
1113
- hcLight: 'statusBar.border'
1114
- }, description: 'Status bar border color separating to the sidebar and editor when a program is being debugged. The status bar is shown in the bottom of the window'
1115
- },
1116
- // Debug Exception Widget colors should be aligned with
1117
- // https://github.com/microsoft/vscode/blob/ff5f581425da6230b6f9216ecf19abf6c9d285a6/src/vs/workbench/contrib/debug/browser/exceptionWidget.ts#L23
1118
- {
1119
- id: 'debugExceptionWidget.border', defaults: {
1120
- dark: '#a31515',
1121
- light: '#a31515',
1122
- hcDark: '#a31515',
1123
- hcLight: '#a31515'
1124
- }, description: 'Exception widget border color.',
1125
- }, {
1126
- id: 'debugExceptionWidget.background', defaults: {
1127
- dark: '#420b0d',
1128
- light: '#f1dfde',
1129
- hcDark: '#420b0d',
1130
- hcLight: '#f1dfde'
1131
- }, description: 'Exception widget background color.'
1132
- },
1133
- // Debug Icon colors should be aligned with
1134
- // https://code.visualstudio.com/api/references/theme-color#debug-icons-colors
1135
- {
1136
- id: 'debugIcon.breakpointForeground', defaults: {
1137
- dark: '#E51400',
1138
- light: '#E51400',
1139
- hcDark: '#E51400',
1140
- hcLight: '#E51400'
1141
- },
1142
- description: 'Icon color for breakpoints.'
1143
- }, {
1144
- id: 'debugIcon.breakpointDisabledForeground', defaults: {
1145
- dark: '#848484',
1146
- light: '#848484',
1147
- hcDark: '#848484',
1148
- hcLight: '#848484'
1149
- },
1150
- description: 'Icon color for disabled breakpoints.'
1151
- }, {
1152
- id: 'debugIcon.breakpointUnverifiedForeground', defaults: {
1153
- dark: '#848484',
1154
- light: '#848484',
1155
- hcDark: '#848484',
1156
- hcLight: '#848484'
1157
- },
1158
- description: 'Icon color for unverified breakpoints.'
1159
- }, {
1160
- id: 'debugIcon.breakpointCurrentStackframeForeground', defaults: {
1161
- dark: '#FFCC00',
1162
- light: '#BE8700',
1163
- hcDark: '#FFCC00',
1164
- hcLight: '#BE8700'
1165
- },
1166
- description: 'Icon color for the current breakpoint stack frame.'
1167
- }, {
1168
- id: 'debugIcon.breakpointStackframeForeground', defaults: {
1169
- dark: '#89D185',
1170
- light: '#89D185',
1171
- hcDark: '#89D185',
1172
- hcLight: '#89D185'
1173
- },
1174
- description: 'Icon color for all breakpoint stack frames.'
1175
- }, {
1176
- id: 'debugIcon.startForeground', defaults: {
1177
- dark: '#89D185',
1178
- light: '#388A34',
1179
- hcDark: '#89D185',
1180
- hcLight: '#388A34'
1181
- }, description: 'Debug toolbar icon for start debugging.'
1182
- }, {
1183
- id: 'debugIcon.pauseForeground', defaults: {
1184
- dark: '#75BEFF',
1185
- light: '#007ACC',
1186
- hcDark: '#75BEFF',
1187
- hcLight: '#007ACC'
1188
- }, description: 'Debug toolbar icon for pause.'
1189
- }, {
1190
- id: 'debugIcon.stopForeground', defaults: {
1191
- dark: '#F48771',
1192
- light: '#A1260D',
1193
- hcDark: '#F48771',
1194
- hcLight: '#A1260D'
1195
- }, description: 'Debug toolbar icon for stop.'
1196
- }, {
1197
- id: 'debugIcon.disconnectForeground', defaults: {
1198
- dark: '#F48771',
1199
- light: '#A1260D',
1200
- hcDark: '#F48771',
1201
- hcLight: '#A1260D'
1202
- }, description: 'Debug toolbar icon for disconnect.'
1203
- }, {
1204
- id: 'debugIcon.restartForeground', defaults: {
1205
- dark: '#89D185',
1206
- light: '#388A34',
1207
- hcDark: '#89D185',
1208
- hcLight: '#388A34'
1209
- }, description: 'Debug toolbar icon for restart.'
1210
- }, {
1211
- id: 'debugIcon.stepOverForeground', defaults: {
1212
- dark: '#75BEFF',
1213
- light: '#007ACC',
1214
- hcDark: '#75BEFF',
1215
- hcLight: '#007ACC',
1216
- }, description: 'Debug toolbar icon for step over.'
1217
- }, {
1218
- id: 'debugIcon.stepIntoForeground', defaults: {
1219
- dark: '#75BEFF',
1220
- light: '#007ACC',
1221
- hcDark: '#75BEFF',
1222
- hcLight: '#007ACC'
1223
- }, description: 'Debug toolbar icon for step into.'
1224
- }, {
1225
- id: 'debugIcon.stepOutForeground', defaults: {
1226
- dark: '#75BEFF',
1227
- light: '#007ACC',
1228
- hcDark: '#75BEFF',
1229
- hcLight: '#007ACC',
1230
- }, description: 'Debug toolbar icon for step over.'
1231
- }, {
1232
- id: 'debugIcon.continueForeground', defaults: {
1233
- dark: '#75BEFF',
1234
- light: '#007ACC',
1235
- hcDark: '#75BEFF',
1236
- hcLight: '#007ACC'
1237
- }, description: 'Debug toolbar icon for continue.'
1238
- }, {
1239
- id: 'debugIcon.stepBackForeground', defaults: {
1240
- dark: '#75BEFF',
1241
- light: '#007ACC',
1242
- hcDark: '#75BEFF',
1243
- hcLight: '#007ACC'
1244
- }, description: 'Debug toolbar icon for step back.'
1245
- }, {
1246
- id: 'debugConsole.infoForeground', defaults: {
1247
- dark: 'editorInfo.foreground',
1248
- light: 'editorInfo.foreground',
1249
- hcDark: 'foreground',
1250
- hcLight: 'foreground'
1251
- }, description: 'Foreground color for info messages in debug REPL console.'
1252
- }, {
1253
- id: 'debugConsole.warningForeground', defaults: {
1254
- dark: 'editorWarning.foreground',
1255
- light: 'editorWarning.foreground',
1256
- hcDark: '#008000',
1257
- hcLight: 'editorWarning.foreground'
1258
- },
1259
- description: 'Foreground color for warning messages in debug REPL console.'
1260
- }, {
1261
- id: 'debugConsole.errorForeground', defaults: {
1262
- dark: 'errorForeground',
1263
- light: 'errorForeground',
1264
- hcDark: 'errorForeground',
1265
- hcLight: 'errorForeground'
1266
- },
1267
- description: 'Foreground color for error messages in debug REPL console.',
1268
- }, {
1269
- id: 'debugConsole.sourceForeground', defaults: {
1270
- dark: 'foreground',
1271
- light: 'foreground',
1272
- hcDark: 'foreground',
1273
- hcLight: 'foreground'
1274
- },
1275
- description: 'Foreground color for source filenames in debug REPL console.',
1276
- }, {
1277
- id: 'debugConsoleInputIcon.foreground', defaults: {
1278
- dark: 'foreground',
1279
- light: 'foreground',
1280
- hcDark: 'foreground',
1281
- hcLight: 'foreground'
1282
- },
1283
- description: 'Foreground color for debug console input marker icon.'
1284
- });
1285
- }
1286
- updateStatusBar() {
1287
- if (this.debuggingStatusBar === document.body.classList.contains('theia-mod-debugging')) {
1288
- return;
1289
- }
1290
- document.body.classList.toggle('theia-mod-debugging');
1291
- }
1292
- get debuggingStatusBar() {
1293
- if (this.manager.state < debug_session_1.DebugState.Running) {
1294
- return false;
1295
- }
1296
- const session = this.manager.currentSession;
1297
- if (session && session.configuration.noDebug) {
1298
- return false;
1299
- }
1300
- return true;
1301
- }
1302
- };
1303
- __decorate([
1304
- (0, inversify_1.inject)(debug_service_1.DebugService),
1305
- __metadata("design:type", Object)
1306
- ], DebugFrontendApplicationContribution.prototype, "debug", void 0);
1307
- __decorate([
1308
- (0, inversify_1.inject)(debug_session_manager_1.DebugSessionManager),
1309
- __metadata("design:type", debug_session_manager_1.DebugSessionManager)
1310
- ], DebugFrontendApplicationContribution.prototype, "manager", void 0);
1311
- __decorate([
1312
- (0, inversify_1.inject)(debug_configuration_manager_1.DebugConfigurationManager),
1313
- __metadata("design:type", debug_configuration_manager_1.DebugConfigurationManager)
1314
- ], DebugFrontendApplicationContribution.prototype, "configurations", void 0);
1315
- __decorate([
1316
- (0, inversify_1.inject)(breakpoint_manager_1.BreakpointManager),
1317
- __metadata("design:type", breakpoint_manager_1.BreakpointManager)
1318
- ], DebugFrontendApplicationContribution.prototype, "breakpointManager", void 0);
1319
- __decorate([
1320
- (0, inversify_1.inject)(debug_editor_service_1.DebugEditorService),
1321
- __metadata("design:type", debug_editor_service_1.DebugEditorService)
1322
- ], DebugFrontendApplicationContribution.prototype, "editors", void 0);
1323
- __decorate([
1324
- (0, inversify_1.inject)(debug_console_contribution_1.DebugConsoleContribution),
1325
- __metadata("design:type", debug_console_contribution_1.DebugConsoleContribution)
1326
- ], DebugFrontendApplicationContribution.prototype, "console", void 0);
1327
- __decorate([
1328
- (0, inversify_1.inject)(debug_schema_updater_1.DebugSchemaUpdater),
1329
- __metadata("design:type", debug_schema_updater_1.DebugSchemaUpdater)
1330
- ], DebugFrontendApplicationContribution.prototype, "schemaUpdater", void 0);
1331
- __decorate([
1332
- (0, inversify_1.inject)(debug_preferences_1.DebugPreferences),
1333
- __metadata("design:type", Object)
1334
- ], DebugFrontendApplicationContribution.prototype, "preference", void 0);
1335
- __decorate([
1336
- (0, inversify_1.inject)(debug_watch_manager_1.DebugWatchManager),
1337
- __metadata("design:type", debug_watch_manager_1.DebugWatchManager)
1338
- ], DebugFrontendApplicationContribution.prototype, "watchManager", void 0);
1339
- __decorate([
1340
- (0, inversify_1.inject)(browser_1.LabelProvider),
1341
- __metadata("design:type", browser_1.LabelProvider)
1342
- ], DebugFrontendApplicationContribution.prototype, "labelProvider", void 0);
1343
- __decorate([
1344
- (0, inversify_1.inject)(browser_2.EditorManager),
1345
- __metadata("design:type", browser_2.EditorManager)
1346
- ], DebugFrontendApplicationContribution.prototype, "editorManager", void 0);
1347
- DebugFrontendApplicationContribution = __decorate([
1348
- (0, inversify_1.injectable)(),
1349
- __metadata("design:paramtypes", [])
1350
- ], DebugFrontendApplicationContribution);
1351
- exports.DebugFrontendApplicationContribution = DebugFrontendApplicationContribution;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 TypeFox 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 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.DebugFrontendApplicationContribution = exports.DebugBreakpointWidgetCommands = exports.DebugEditorContextCommands = exports.DebugSessionContextCommands = exports.DebugThreadContextCommands = exports.DebugCommands = exports.DebugMenus = void 0;
28
+ const browser_1 = require("@theia/core/lib/browser");
29
+ const inversify_1 = require("@theia/core/shared/inversify");
30
+ const monaco = require("@theia/monaco-editor-core");
31
+ const common_1 = require("@theia/core/lib/common");
32
+ const browser_2 = require("@theia/editor/lib/browser");
33
+ const debug_session_manager_1 = require("./debug-session-manager");
34
+ const debug_widget_1 = require("./view/debug-widget");
35
+ const breakpoint_marker_1 = require("./breakpoint/breakpoint-marker");
36
+ const breakpoint_manager_1 = require("./breakpoint/breakpoint-manager");
37
+ const debug_configuration_manager_1 = require("./debug-configuration-manager");
38
+ const debug_session_1 = require("./debug-session");
39
+ const debug_breakpoints_widget_1 = require("./view/debug-breakpoints-widget");
40
+ const debug_source_breakpoint_1 = require("./model/debug-source-breakpoint");
41
+ const debug_threads_widget_1 = require("./view/debug-threads-widget");
42
+ const debug_thread_1 = require("./model/debug-thread");
43
+ const debug_stack_frames_widget_1 = require("./view/debug-stack-frames-widget");
44
+ const debug_stack_frame_1 = require("./model/debug-stack-frame");
45
+ const debug_variables_widget_1 = require("./view/debug-variables-widget");
46
+ const debug_console_items_1 = require("./console/debug-console-items");
47
+ const debug_keybinding_contexts_1 = require("./debug-keybinding-contexts");
48
+ const debug_editor_model_1 = require("./editor/debug-editor-model");
49
+ const debug_editor_service_1 = require("./editor/debug-editor-service");
50
+ const debug_console_contribution_1 = require("./console/debug-console-contribution");
51
+ const debug_service_1 = require("../common/debug-service");
52
+ const debug_schema_updater_1 = require("./debug-schema-updater");
53
+ const debug_preferences_1 = require("./debug-preferences");
54
+ const debug_watch_widget_1 = require("./view/debug-watch-widget");
55
+ const debug_watch_expression_1 = require("./view/debug-watch-expression");
56
+ const debug_watch_manager_1 = require("./debug-watch-manager");
57
+ const debug_function_breakpoint_1 = require("./model/debug-function-breakpoint");
58
+ const debug_breakpoint_1 = require("./model/debug-breakpoint");
59
+ const nls_1 = require("@theia/core/lib/common/nls");
60
+ const debug_instruction_breakpoint_1 = require("./model/debug-instruction-breakpoint");
61
+ var DebugMenus;
62
+ (function (DebugMenus) {
63
+ DebugMenus.DEBUG = [...common_1.MAIN_MENU_BAR, '6_debug'];
64
+ DebugMenus.DEBUG_CONTROLS = [...DebugMenus.DEBUG, 'a_controls'];
65
+ DebugMenus.DEBUG_CONFIGURATION = [...DebugMenus.DEBUG, 'b_configuration'];
66
+ DebugMenus.DEBUG_THREADS = [...DebugMenus.DEBUG, 'c_threads'];
67
+ DebugMenus.DEBUG_SESSIONS = [...DebugMenus.DEBUG, 'd_sessions'];
68
+ DebugMenus.DEBUG_BREAKPOINT = [...DebugMenus.DEBUG, 'e_breakpoint'];
69
+ DebugMenus.DEBUG_NEW_BREAKPOINT = [...DebugMenus.DEBUG_BREAKPOINT, 'a_new_breakpoint'];
70
+ DebugMenus.DEBUG_BREAKPOINTS = [...DebugMenus.DEBUG, 'f_breakpoints'];
71
+ })(DebugMenus = exports.DebugMenus || (exports.DebugMenus = {}));
72
+ function nlsEditBreakpoint(breakpoint) {
73
+ return nls_1.nls.localizeByDefault('Edit {0}...', nls_1.nls.localizeByDefault(breakpoint));
74
+ }
75
+ function nlsRemoveBreakpoint(breakpoint) {
76
+ return nls_1.nls.localizeByDefault('Remove {0}', nls_1.nls.localizeByDefault(breakpoint));
77
+ }
78
+ function nlsEnableBreakpoint(breakpoint) {
79
+ return nls_1.nls.localizeByDefault('Enable {0}', nls_1.nls.localizeByDefault(breakpoint));
80
+ }
81
+ function nlsDisableBreakpoint(breakpoint) {
82
+ return nls_1.nls.localizeByDefault('Disable {0}', nls_1.nls.localizeByDefault(breakpoint));
83
+ }
84
+ var DebugCommands;
85
+ (function (DebugCommands) {
86
+ DebugCommands.DEBUG_CATEGORY = 'Debug';
87
+ DebugCommands.DEBUG_CATEGORY_KEY = nls_1.nls.getDefaultKey(DebugCommands.DEBUG_CATEGORY);
88
+ DebugCommands.START = common_1.Command.toDefaultLocalizedCommand({
89
+ id: 'workbench.action.debug.start',
90
+ category: DebugCommands.DEBUG_CATEGORY,
91
+ label: 'Start Debugging',
92
+ iconClass: (0, browser_1.codicon)('debug-alt')
93
+ });
94
+ DebugCommands.START_NO_DEBUG = common_1.Command.toDefaultLocalizedCommand({
95
+ id: 'workbench.action.debug.run',
96
+ category: DebugCommands.DEBUG_CATEGORY,
97
+ label: 'Start Without Debugging'
98
+ });
99
+ DebugCommands.STOP = common_1.Command.toDefaultLocalizedCommand({
100
+ id: 'workbench.action.debug.stop',
101
+ category: DebugCommands.DEBUG_CATEGORY,
102
+ label: 'Stop',
103
+ iconClass: (0, browser_1.codicon)('debug-stop')
104
+ });
105
+ DebugCommands.RESTART = common_1.Command.toDefaultLocalizedCommand({
106
+ id: 'workbench.action.debug.restart',
107
+ category: DebugCommands.DEBUG_CATEGORY,
108
+ label: 'Restart',
109
+ });
110
+ DebugCommands.OPEN_CONFIGURATIONS = common_1.Command.toDefaultLocalizedCommand({
111
+ id: 'debug.configurations.open',
112
+ category: DebugCommands.DEBUG_CATEGORY,
113
+ label: 'Open Configurations'
114
+ });
115
+ DebugCommands.ADD_CONFIGURATION = common_1.Command.toDefaultLocalizedCommand({
116
+ id: 'debug.configurations.add',
117
+ category: DebugCommands.DEBUG_CATEGORY,
118
+ label: 'Add Configuration...'
119
+ });
120
+ DebugCommands.STEP_OVER = common_1.Command.toDefaultLocalizedCommand({
121
+ id: 'workbench.action.debug.stepOver',
122
+ category: DebugCommands.DEBUG_CATEGORY,
123
+ label: 'Step Over',
124
+ iconClass: (0, browser_1.codicon)('debug-step-over')
125
+ });
126
+ DebugCommands.STEP_INTO = common_1.Command.toDefaultLocalizedCommand({
127
+ id: 'workbench.action.debug.stepInto',
128
+ category: DebugCommands.DEBUG_CATEGORY,
129
+ label: 'Step Into',
130
+ iconClass: (0, browser_1.codicon)('debug-step-into')
131
+ });
132
+ DebugCommands.STEP_OUT = common_1.Command.toDefaultLocalizedCommand({
133
+ id: 'workbench.action.debug.stepOut',
134
+ category: DebugCommands.DEBUG_CATEGORY,
135
+ label: 'Step Out',
136
+ iconClass: (0, browser_1.codicon)('debug-step-out')
137
+ });
138
+ DebugCommands.CONTINUE = common_1.Command.toDefaultLocalizedCommand({
139
+ id: 'workbench.action.debug.continue',
140
+ category: DebugCommands.DEBUG_CATEGORY,
141
+ label: 'Continue',
142
+ iconClass: (0, browser_1.codicon)('debug-continue')
143
+ });
144
+ DebugCommands.PAUSE = common_1.Command.toDefaultLocalizedCommand({
145
+ id: 'workbench.action.debug.pause',
146
+ category: DebugCommands.DEBUG_CATEGORY,
147
+ label: 'Pause',
148
+ iconClass: (0, browser_1.codicon)('debug-pause')
149
+ });
150
+ DebugCommands.CONTINUE_ALL = common_1.Command.toLocalizedCommand({
151
+ id: 'debug.thread.continue.all',
152
+ category: DebugCommands.DEBUG_CATEGORY,
153
+ label: 'Continue All',
154
+ iconClass: (0, browser_1.codicon)('debug-continue')
155
+ }, 'theia/debug/continueAll', DebugCommands.DEBUG_CATEGORY_KEY);
156
+ DebugCommands.PAUSE_ALL = common_1.Command.toLocalizedCommand({
157
+ id: 'debug.thread.pause.all',
158
+ category: DebugCommands.DEBUG_CATEGORY,
159
+ label: 'Pause All',
160
+ iconClass: (0, browser_1.codicon)('debug-pause')
161
+ }, 'theia/debug/pauseAll', DebugCommands.DEBUG_CATEGORY_KEY);
162
+ DebugCommands.TOGGLE_BREAKPOINT = common_1.Command.toDefaultLocalizedCommand({
163
+ id: 'editor.debug.action.toggleBreakpoint',
164
+ category: DebugCommands.DEBUG_CATEGORY,
165
+ label: 'Toggle Breakpoint',
166
+ });
167
+ DebugCommands.INLINE_BREAKPOINT = common_1.Command.toDefaultLocalizedCommand({
168
+ id: 'editor.debug.action.inlineBreakpoint',
169
+ category: DebugCommands.DEBUG_CATEGORY,
170
+ label: 'Inline Breakpoint',
171
+ });
172
+ DebugCommands.ADD_CONDITIONAL_BREAKPOINT = common_1.Command.toDefaultLocalizedCommand({
173
+ id: 'debug.breakpoint.add.conditional',
174
+ category: DebugCommands.DEBUG_CATEGORY,
175
+ label: 'Add Conditional Breakpoint...',
176
+ });
177
+ DebugCommands.ADD_LOGPOINT = common_1.Command.toDefaultLocalizedCommand({
178
+ id: 'debug.breakpoint.add.logpoint',
179
+ category: DebugCommands.DEBUG_CATEGORY,
180
+ label: 'Add Logpoint...',
181
+ });
182
+ DebugCommands.ADD_FUNCTION_BREAKPOINT = common_1.Command.toDefaultLocalizedCommand({
183
+ id: 'debug.breakpoint.add.function',
184
+ category: DebugCommands.DEBUG_CATEGORY,
185
+ label: 'Add Function Breakpoint',
186
+ });
187
+ DebugCommands.ENABLE_ALL_BREAKPOINTS = common_1.Command.toDefaultLocalizedCommand({
188
+ id: 'debug.breakpoint.enableAll',
189
+ category: DebugCommands.DEBUG_CATEGORY,
190
+ label: 'Enable All Breakpoints',
191
+ });
192
+ DebugCommands.DISABLE_ALL_BREAKPOINTS = common_1.Command.toDefaultLocalizedCommand({
193
+ id: 'debug.breakpoint.disableAll',
194
+ category: DebugCommands.DEBUG_CATEGORY,
195
+ label: 'Disable All Breakpoints',
196
+ });
197
+ DebugCommands.EDIT_BREAKPOINT = common_1.Command.toLocalizedCommand({
198
+ id: 'debug.breakpoint.edit',
199
+ category: DebugCommands.DEBUG_CATEGORY,
200
+ originalLabel: 'Edit Breakpoint...',
201
+ label: nlsEditBreakpoint('Breakpoint')
202
+ }, '', DebugCommands.DEBUG_CATEGORY_KEY);
203
+ DebugCommands.EDIT_LOGPOINT = common_1.Command.toLocalizedCommand({
204
+ id: 'debug.logpoint.edit',
205
+ category: DebugCommands.DEBUG_CATEGORY,
206
+ originalLabel: 'Edit Logpoint...',
207
+ label: nlsEditBreakpoint('Logpoint')
208
+ }, '', DebugCommands.DEBUG_CATEGORY_KEY);
209
+ DebugCommands.REMOVE_BREAKPOINT = common_1.Command.toLocalizedCommand({
210
+ id: 'debug.breakpoint.remove',
211
+ category: DebugCommands.DEBUG_CATEGORY,
212
+ originalLabel: 'Remove Breakpoint',
213
+ label: nlsRemoveBreakpoint('Breakpoint')
214
+ }, '', DebugCommands.DEBUG_CATEGORY_KEY);
215
+ DebugCommands.REMOVE_LOGPOINT = common_1.Command.toLocalizedCommand({
216
+ id: 'debug.logpoint.remove',
217
+ category: DebugCommands.DEBUG_CATEGORY,
218
+ originalLabel: 'Remove Logpoint',
219
+ label: nlsRemoveBreakpoint('Logpoint')
220
+ }, '', DebugCommands.DEBUG_CATEGORY_KEY);
221
+ DebugCommands.REMOVE_ALL_BREAKPOINTS = common_1.Command.toDefaultLocalizedCommand({
222
+ id: 'debug.breakpoint.removeAll',
223
+ category: DebugCommands.DEBUG_CATEGORY,
224
+ label: 'Remove All Breakpoints',
225
+ });
226
+ DebugCommands.TOGGLE_BREAKPOINTS_ENABLED = common_1.Command.toLocalizedCommand({
227
+ id: 'debug.breakpoint.toggleEnabled'
228
+ });
229
+ DebugCommands.SHOW_HOVER = common_1.Command.toDefaultLocalizedCommand({
230
+ id: 'editor.debug.action.showDebugHover',
231
+ category: DebugCommands.DEBUG_CATEGORY,
232
+ label: 'Show Hover'
233
+ });
234
+ DebugCommands.RESTART_FRAME = common_1.Command.toDefaultLocalizedCommand({
235
+ id: 'debug.frame.restart',
236
+ category: DebugCommands.DEBUG_CATEGORY,
237
+ label: 'Restart Frame',
238
+ });
239
+ DebugCommands.COPY_CALL_STACK = common_1.Command.toDefaultLocalizedCommand({
240
+ id: 'debug.callStack.copy',
241
+ category: DebugCommands.DEBUG_CATEGORY,
242
+ label: 'Copy Call Stack',
243
+ });
244
+ DebugCommands.SET_VARIABLE_VALUE = common_1.Command.toDefaultLocalizedCommand({
245
+ id: 'debug.variable.setValue',
246
+ category: DebugCommands.DEBUG_CATEGORY,
247
+ label: 'Set Value',
248
+ });
249
+ DebugCommands.COPY_VARIABLE_VALUE = common_1.Command.toDefaultLocalizedCommand({
250
+ id: 'debug.variable.copyValue',
251
+ category: DebugCommands.DEBUG_CATEGORY,
252
+ label: 'Copy Value',
253
+ });
254
+ DebugCommands.COPY_VARIABLE_AS_EXPRESSION = common_1.Command.toDefaultLocalizedCommand({
255
+ id: 'debug.variable.copyAsExpression',
256
+ category: DebugCommands.DEBUG_CATEGORY,
257
+ label: 'Copy as Expression',
258
+ });
259
+ DebugCommands.WATCH_VARIABLE = common_1.Command.toDefaultLocalizedCommand({
260
+ id: 'debug.variable.watch',
261
+ category: DebugCommands.DEBUG_CATEGORY,
262
+ label: 'Add to Watch',
263
+ });
264
+ DebugCommands.ADD_WATCH_EXPRESSION = common_1.Command.toDefaultLocalizedCommand({
265
+ id: 'debug.watch.addExpression',
266
+ category: DebugCommands.DEBUG_CATEGORY,
267
+ label: 'Add Expression'
268
+ });
269
+ DebugCommands.EDIT_WATCH_EXPRESSION = common_1.Command.toDefaultLocalizedCommand({
270
+ id: 'debug.watch.editExpression',
271
+ category: DebugCommands.DEBUG_CATEGORY,
272
+ label: 'Edit Expression'
273
+ });
274
+ DebugCommands.COPY_WATCH_EXPRESSION_VALUE = common_1.Command.toLocalizedCommand({
275
+ id: 'debug.watch.copyExpressionValue',
276
+ category: DebugCommands.DEBUG_CATEGORY,
277
+ label: 'Copy Expression Value'
278
+ }, 'theia/debug/copyExpressionValue', DebugCommands.DEBUG_CATEGORY_KEY);
279
+ DebugCommands.REMOVE_WATCH_EXPRESSION = common_1.Command.toDefaultLocalizedCommand({
280
+ id: 'debug.watch.removeExpression',
281
+ category: DebugCommands.DEBUG_CATEGORY,
282
+ label: 'Remove Expression'
283
+ });
284
+ DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS = common_1.Command.toDefaultLocalizedCommand({
285
+ id: 'debug.watch.collapseAllExpressions',
286
+ category: DebugCommands.DEBUG_CATEGORY,
287
+ label: 'Collapse All'
288
+ });
289
+ DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS = common_1.Command.toDefaultLocalizedCommand({
290
+ id: 'debug.watch.removeAllExpressions',
291
+ category: DebugCommands.DEBUG_CATEGORY,
292
+ label: 'Remove All Expressions'
293
+ });
294
+ })(DebugCommands = exports.DebugCommands || (exports.DebugCommands = {}));
295
+ var DebugThreadContextCommands;
296
+ (function (DebugThreadContextCommands) {
297
+ DebugThreadContextCommands.STEP_OVER = {
298
+ id: 'debug.thread.context.context.next'
299
+ };
300
+ DebugThreadContextCommands.STEP_INTO = {
301
+ id: 'debug.thread.context.stepin'
302
+ };
303
+ DebugThreadContextCommands.STEP_OUT = {
304
+ id: 'debug.thread.context.stepout'
305
+ };
306
+ DebugThreadContextCommands.CONTINUE = {
307
+ id: 'debug.thread.context.continue'
308
+ };
309
+ DebugThreadContextCommands.PAUSE = {
310
+ id: 'debug.thread.context.pause'
311
+ };
312
+ DebugThreadContextCommands.TERMINATE = {
313
+ id: 'debug.thread.context.terminate'
314
+ };
315
+ })(DebugThreadContextCommands = exports.DebugThreadContextCommands || (exports.DebugThreadContextCommands = {}));
316
+ var DebugSessionContextCommands;
317
+ (function (DebugSessionContextCommands) {
318
+ DebugSessionContextCommands.STOP = {
319
+ id: 'debug.session.context.stop'
320
+ };
321
+ DebugSessionContextCommands.RESTART = {
322
+ id: 'debug.session.context.restart'
323
+ };
324
+ DebugSessionContextCommands.PAUSE_ALL = {
325
+ id: 'debug.session.context.pauseAll'
326
+ };
327
+ DebugSessionContextCommands.CONTINUE_ALL = {
328
+ id: 'debug.session.context.continueAll'
329
+ };
330
+ DebugSessionContextCommands.REVEAL = {
331
+ id: 'debug.session.context.reveal'
332
+ };
333
+ })(DebugSessionContextCommands = exports.DebugSessionContextCommands || (exports.DebugSessionContextCommands = {}));
334
+ var DebugEditorContextCommands;
335
+ (function (DebugEditorContextCommands) {
336
+ DebugEditorContextCommands.ADD_BREAKPOINT = {
337
+ id: 'debug.editor.context.addBreakpoint'
338
+ };
339
+ DebugEditorContextCommands.ADD_CONDITIONAL_BREAKPOINT = {
340
+ id: 'debug.editor.context.addBreakpoint.conditional'
341
+ };
342
+ DebugEditorContextCommands.ADD_LOGPOINT = {
343
+ id: 'debug.editor.context.add.logpoint'
344
+ };
345
+ DebugEditorContextCommands.REMOVE_BREAKPOINT = {
346
+ id: 'debug.editor.context.removeBreakpoint'
347
+ };
348
+ DebugEditorContextCommands.EDIT_BREAKPOINT = {
349
+ id: 'debug.editor.context.edit.breakpoint'
350
+ };
351
+ DebugEditorContextCommands.ENABLE_BREAKPOINT = {
352
+ id: 'debug.editor.context.enableBreakpoint'
353
+ };
354
+ DebugEditorContextCommands.DISABLE_BREAKPOINT = {
355
+ id: 'debug.editor.context.disableBreakpoint'
356
+ };
357
+ DebugEditorContextCommands.REMOVE_LOGPOINT = {
358
+ id: 'debug.editor.context.logpoint.remove'
359
+ };
360
+ DebugEditorContextCommands.EDIT_LOGPOINT = {
361
+ id: 'debug.editor.context.logpoint.edit'
362
+ };
363
+ DebugEditorContextCommands.ENABLE_LOGPOINT = {
364
+ id: 'debug.editor.context.logpoint.enable'
365
+ };
366
+ DebugEditorContextCommands.DISABLE_LOGPOINT = {
367
+ id: 'debug.editor.context.logpoint.disable'
368
+ };
369
+ })(DebugEditorContextCommands = exports.DebugEditorContextCommands || (exports.DebugEditorContextCommands = {}));
370
+ var DebugBreakpointWidgetCommands;
371
+ (function (DebugBreakpointWidgetCommands) {
372
+ DebugBreakpointWidgetCommands.ACCEPT = {
373
+ id: 'debug.breakpointWidget.accept'
374
+ };
375
+ DebugBreakpointWidgetCommands.CLOSE = {
376
+ id: 'debug.breakpointWidget.close'
377
+ };
378
+ })(DebugBreakpointWidgetCommands = exports.DebugBreakpointWidgetCommands || (exports.DebugBreakpointWidgetCommands = {}));
379
+ let DebugFrontendApplicationContribution = class DebugFrontendApplicationContribution extends browser_1.AbstractViewContribution {
380
+ constructor() {
381
+ super({
382
+ widgetId: debug_widget_1.DebugWidget.ID,
383
+ widgetName: debug_widget_1.DebugWidget.LABEL,
384
+ defaultWidgetOptions: {
385
+ area: 'left',
386
+ rank: 400
387
+ },
388
+ toggleCommandId: 'debug:toggle',
389
+ toggleKeybinding: 'ctrlcmd+shift+d'
390
+ });
391
+ this.firstSessionStart = true;
392
+ }
393
+ async initializeLayout() {
394
+ await this.openView();
395
+ }
396
+ async onStart() {
397
+ this.manager.onDidCreateDebugSession(session => this.openSession(session, { reveal: false }));
398
+ this.manager.onDidStartDebugSession(session => {
399
+ const { noDebug } = session.configuration;
400
+ const openDebug = session.configuration.openDebug || this.preference['debug.openDebug'];
401
+ const internalConsoleOptions = session.configuration.internalConsoleOptions || this.preference['debug.internalConsoleOptions'];
402
+ if (internalConsoleOptions === 'openOnSessionStart' ||
403
+ (internalConsoleOptions === 'openOnFirstSessionStart' && this.firstSessionStart)) {
404
+ this.console.openView({
405
+ reveal: true,
406
+ activate: false,
407
+ });
408
+ }
409
+ if (!noDebug && (openDebug === 'openOnSessionStart' || (openDebug === 'openOnFirstSessionStart' && this.firstSessionStart))) {
410
+ this.openSession(session);
411
+ }
412
+ this.firstSessionStart = false;
413
+ });
414
+ this.manager.onDidStopDebugSession(session => {
415
+ const { openDebug } = session.configuration;
416
+ if (openDebug === 'openOnDebugBreak') {
417
+ this.openSession(session);
418
+ }
419
+ });
420
+ this.updateStatusBar();
421
+ this.manager.onDidChange(() => this.updateStatusBar());
422
+ this.schemaUpdater.update();
423
+ this.configurations.load();
424
+ await this.breakpointManager.load();
425
+ await this.watchManager.load();
426
+ }
427
+ onStop() {
428
+ this.configurations.save();
429
+ this.breakpointManager.save();
430
+ this.watchManager.save();
431
+ }
432
+ onWillStop() {
433
+ if (this.preference['debug.confirmOnExit'] === 'always' && this.manager.currentSession) {
434
+ return {
435
+ reason: 'active-debug-sessions',
436
+ action: async () => {
437
+ if (this.manager.currentSession) {
438
+ const msg = this.manager.sessions.length === 1
439
+ ? nls_1.nls.localizeByDefault('There is an active debug session, are you sure you want to stop it?')
440
+ : nls_1.nls.localizeByDefault('There are active debug sessions, are you sure you want to stop them?');
441
+ const safeToExit = await new browser_1.ConfirmDialog({
442
+ title: '',
443
+ msg,
444
+ ok: nls_1.nls.localizeByDefault('Stop Debugging'),
445
+ cancel: browser_1.Dialog.CANCEL,
446
+ }).open();
447
+ return safeToExit === true;
448
+ }
449
+ return true;
450
+ },
451
+ };
452
+ }
453
+ }
454
+ registerMenus(menus) {
455
+ super.registerMenus(menus);
456
+ const registerMenuActions = (menuPath, ...commands) => {
457
+ for (const [index, command] of commands.entries()) {
458
+ const label = command.label;
459
+ const debug = `${DebugCommands.DEBUG_CATEGORY}:`;
460
+ menus.registerMenuAction(menuPath, {
461
+ commandId: command.id,
462
+ label: label && label.startsWith(debug) && label.slice(debug.length).trimStart() || label,
463
+ icon: command.iconClass,
464
+ order: String.fromCharCode('a'.charCodeAt(0) + index)
465
+ });
466
+ }
467
+ };
468
+ menus.registerSubmenu(DebugMenus.DEBUG, nls_1.nls.localizeByDefault('Run'));
469
+ registerMenuActions(DebugMenus.DEBUG_CONTROLS, DebugCommands.START, DebugCommands.START_NO_DEBUG, DebugCommands.STOP, DebugCommands.RESTART);
470
+ registerMenuActions(DebugMenus.DEBUG_CONFIGURATION, DebugCommands.OPEN_CONFIGURATIONS, DebugCommands.ADD_CONFIGURATION);
471
+ registerMenuActions(DebugMenus.DEBUG_THREADS, DebugCommands.CONTINUE, DebugCommands.STEP_OVER, DebugCommands.STEP_INTO, DebugCommands.STEP_OUT, DebugCommands.PAUSE);
472
+ registerMenuActions(DebugMenus.DEBUG_SESSIONS, DebugCommands.CONTINUE_ALL, DebugCommands.PAUSE_ALL);
473
+ registerMenuActions(DebugMenus.DEBUG_BREAKPOINT, DebugCommands.TOGGLE_BREAKPOINT);
474
+ menus.registerSubmenu(DebugMenus.DEBUG_NEW_BREAKPOINT, nls_1.nls.localizeByDefault('New Breakpoint'));
475
+ registerMenuActions(DebugMenus.DEBUG_NEW_BREAKPOINT, DebugCommands.ADD_CONDITIONAL_BREAKPOINT, DebugCommands.INLINE_BREAKPOINT, DebugCommands.ADD_FUNCTION_BREAKPOINT, DebugCommands.ADD_LOGPOINT);
476
+ registerMenuActions(DebugMenus.DEBUG_BREAKPOINTS, DebugCommands.ENABLE_ALL_BREAKPOINTS, DebugCommands.DISABLE_ALL_BREAKPOINTS, DebugCommands.REMOVE_ALL_BREAKPOINTS);
477
+ registerMenuActions(debug_threads_widget_1.DebugThreadsWidget.CONTROL_MENU, Object.assign(Object.assign({}, DebugCommands.PAUSE), DebugThreadContextCommands.PAUSE), Object.assign(Object.assign({}, DebugCommands.CONTINUE), DebugThreadContextCommands.CONTINUE), Object.assign(Object.assign({}, DebugCommands.STEP_OVER), DebugThreadContextCommands.STEP_OVER), Object.assign(Object.assign({}, DebugCommands.STEP_INTO), DebugThreadContextCommands.STEP_INTO), Object.assign(Object.assign({}, DebugCommands.STEP_OUT), DebugThreadContextCommands.STEP_OUT), Object.assign(Object.assign({}, DebugCommands.PAUSE_ALL), DebugSessionContextCommands.PAUSE_ALL), Object.assign(Object.assign({}, DebugCommands.CONTINUE_ALL), DebugSessionContextCommands.CONTINUE_ALL));
478
+ registerMenuActions(debug_threads_widget_1.DebugThreadsWidget.TERMINATE_MENU, Object.assign(Object.assign({}, DebugCommands.RESTART), DebugSessionContextCommands.RESTART), Object.assign(Object.assign({}, DebugCommands.STOP), DebugSessionContextCommands.STOP), Object.assign(Object.assign({}, DebugThreadContextCommands.TERMINATE), { label: nls_1.nls.localizeByDefault('Terminate Thread') }));
479
+ registerMenuActions(debug_threads_widget_1.DebugThreadsWidget.OPEN_MENU, Object.assign(Object.assign({}, DebugSessionContextCommands.REVEAL), { label: nls_1.nls.localize('theia/debug/reveal', 'Reveal') }));
480
+ registerMenuActions(debug_stack_frames_widget_1.DebugStackFramesWidget.CONTEXT_MENU, DebugCommands.RESTART_FRAME, DebugCommands.COPY_CALL_STACK);
481
+ registerMenuActions(debug_variables_widget_1.DebugVariablesWidget.EDIT_MENU, DebugCommands.SET_VARIABLE_VALUE, DebugCommands.COPY_VARIABLE_VALUE, DebugCommands.COPY_VARIABLE_AS_EXPRESSION);
482
+ registerMenuActions(debug_variables_widget_1.DebugVariablesWidget.WATCH_MENU, DebugCommands.WATCH_VARIABLE);
483
+ registerMenuActions(debug_watch_widget_1.DebugWatchWidget.EDIT_MENU, DebugCommands.EDIT_WATCH_EXPRESSION, DebugCommands.COPY_WATCH_EXPRESSION_VALUE);
484
+ registerMenuActions(debug_watch_widget_1.DebugWatchWidget.REMOVE_MENU, DebugCommands.REMOVE_WATCH_EXPRESSION, DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS);
485
+ registerMenuActions(debug_breakpoints_widget_1.DebugBreakpointsWidget.EDIT_MENU, DebugCommands.EDIT_BREAKPOINT, DebugCommands.EDIT_LOGPOINT);
486
+ registerMenuActions(debug_breakpoints_widget_1.DebugBreakpointsWidget.REMOVE_MENU, DebugCommands.REMOVE_BREAKPOINT, DebugCommands.REMOVE_LOGPOINT, DebugCommands.REMOVE_ALL_BREAKPOINTS);
487
+ registerMenuActions(debug_breakpoints_widget_1.DebugBreakpointsWidget.ENABLE_MENU, DebugCommands.ENABLE_ALL_BREAKPOINTS, DebugCommands.DISABLE_ALL_BREAKPOINTS);
488
+ registerMenuActions(debug_editor_model_1.DebugEditorModel.CONTEXT_MENU, Object.assign(Object.assign({}, DebugEditorContextCommands.ADD_BREAKPOINT), { label: nls_1.nls.localizeByDefault('Add Breakpoint') }), Object.assign(Object.assign({}, DebugEditorContextCommands.ADD_CONDITIONAL_BREAKPOINT), { label: DebugCommands.ADD_CONDITIONAL_BREAKPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.ADD_LOGPOINT), { label: DebugCommands.ADD_LOGPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.REMOVE_BREAKPOINT), { label: DebugCommands.REMOVE_BREAKPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.EDIT_BREAKPOINT), { label: DebugCommands.EDIT_BREAKPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.ENABLE_BREAKPOINT), { label: nlsEnableBreakpoint('Breakpoint') }), Object.assign(Object.assign({}, DebugEditorContextCommands.DISABLE_BREAKPOINT), { label: nlsDisableBreakpoint('Breakpoint') }), Object.assign(Object.assign({}, DebugEditorContextCommands.REMOVE_LOGPOINT), { label: DebugCommands.REMOVE_LOGPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.EDIT_LOGPOINT), { label: DebugCommands.EDIT_LOGPOINT.label }), Object.assign(Object.assign({}, DebugEditorContextCommands.ENABLE_LOGPOINT), { label: nlsEnableBreakpoint('Logpoint') }), Object.assign(Object.assign({}, DebugEditorContextCommands.DISABLE_LOGPOINT), { label: nlsDisableBreakpoint('Logpoint') }));
489
+ }
490
+ registerCommands(registry) {
491
+ super.registerCommands(registry);
492
+ registry.registerCommand(DebugCommands.START, {
493
+ execute: (config) => this.start(false, config)
494
+ });
495
+ registry.registerCommand(DebugCommands.START_NO_DEBUG, {
496
+ execute: (config) => this.start(true, config)
497
+ });
498
+ registry.registerCommand(DebugCommands.STOP, {
499
+ execute: () => this.manager.terminateSession(),
500
+ isEnabled: () => this.manager.state !== debug_session_1.DebugState.Inactive
501
+ });
502
+ registry.registerCommand(DebugCommands.RESTART, {
503
+ execute: () => this.manager.restartSession(),
504
+ isEnabled: () => this.manager.state !== debug_session_1.DebugState.Inactive
505
+ });
506
+ registry.registerCommand(DebugCommands.OPEN_CONFIGURATIONS, {
507
+ execute: () => this.configurations.openConfiguration()
508
+ });
509
+ registry.registerCommand(DebugCommands.ADD_CONFIGURATION, {
510
+ execute: () => this.configurations.addConfiguration()
511
+ });
512
+ registry.registerCommand(DebugCommands.STEP_OVER, {
513
+ execute: () => this.manager.currentThread && this.manager.currentThread.stepOver(),
514
+ isEnabled: () => this.manager.state === debug_session_1.DebugState.Stopped
515
+ });
516
+ registry.registerCommand(DebugCommands.STEP_INTO, {
517
+ execute: () => this.manager.currentThread && this.manager.currentThread.stepIn(),
518
+ isEnabled: () => this.manager.state === debug_session_1.DebugState.Stopped
519
+ });
520
+ registry.registerCommand(DebugCommands.STEP_OUT, {
521
+ execute: () => this.manager.currentThread && this.manager.currentThread.stepOut(),
522
+ isEnabled: () => this.manager.state === debug_session_1.DebugState.Stopped
523
+ });
524
+ registry.registerCommand(DebugCommands.CONTINUE, {
525
+ execute: () => this.manager.currentThread && this.manager.currentThread.continue(),
526
+ isEnabled: () => this.manager.state === debug_session_1.DebugState.Stopped
527
+ });
528
+ registry.registerCommand(DebugCommands.PAUSE, {
529
+ execute: () => this.manager.currentThread && this.manager.currentThread.pause(),
530
+ isEnabled: () => this.manager.state === debug_session_1.DebugState.Running
531
+ });
532
+ registry.registerCommand(DebugCommands.PAUSE_ALL, {
533
+ execute: () => this.manager.currentSession && this.manager.currentSession.pauseAll(),
534
+ isEnabled: () => !!this.manager.currentSession && !!this.manager.currentSession.runningThreads.next().value
535
+ });
536
+ registry.registerCommand(DebugCommands.CONTINUE_ALL, {
537
+ execute: () => this.manager.currentSession && this.manager.currentSession.continueAll(),
538
+ isEnabled: () => !!this.manager.currentSession && !!this.manager.currentSession.stoppedThreads.next().value
539
+ });
540
+ registry.registerCommand(DebugThreadContextCommands.STEP_OVER, {
541
+ execute: () => this.selectedThread && this.selectedThread.stepOver(),
542
+ isEnabled: () => !!this.selectedThread && this.selectedThread.stopped,
543
+ isVisible: () => !!this.selectedThread
544
+ });
545
+ registry.registerCommand(DebugThreadContextCommands.STEP_INTO, {
546
+ execute: () => this.selectedThread && this.selectedThread.stepIn(),
547
+ isEnabled: () => !!this.selectedThread && this.selectedThread.stopped,
548
+ isVisible: () => !!this.selectedThread
549
+ });
550
+ registry.registerCommand(DebugThreadContextCommands.STEP_OUT, {
551
+ execute: () => this.selectedThread && this.selectedThread.stepOut(),
552
+ isEnabled: () => !!this.selectedThread && this.selectedThread.stopped,
553
+ isVisible: () => !!this.selectedThread
554
+ });
555
+ registry.registerCommand(DebugThreadContextCommands.CONTINUE, {
556
+ execute: () => this.selectedThread && this.selectedThread.continue(),
557
+ isEnabled: () => !!this.selectedThread && this.selectedThread.stopped,
558
+ isVisible: () => !!this.selectedThread && this.selectedThread.stopped,
559
+ });
560
+ registry.registerCommand(DebugThreadContextCommands.PAUSE, {
561
+ execute: () => this.selectedThread && this.selectedThread.pause(),
562
+ isEnabled: () => !!this.selectedThread && !this.selectedThread.stopped,
563
+ isVisible: () => !!this.selectedThread && !this.selectedThread.stopped,
564
+ });
565
+ registry.registerCommand(DebugThreadContextCommands.TERMINATE, {
566
+ execute: () => this.selectedThread && this.selectedThread.terminate(),
567
+ isEnabled: () => !!this.selectedThread && this.selectedThread.supportsTerminate,
568
+ isVisible: () => !!this.selectedThread && this.selectedThread.supportsTerminate
569
+ });
570
+ registry.registerCommand(DebugSessionContextCommands.STOP, {
571
+ execute: () => this.selectedSession && this.manager.terminateSession(this.selectedSession),
572
+ isEnabled: () => !!this.selectedSession && this.selectedSession.state !== debug_session_1.DebugState.Inactive,
573
+ isVisible: () => !this.selectedThread
574
+ });
575
+ registry.registerCommand(DebugSessionContextCommands.RESTART, {
576
+ execute: () => this.selectedSession && this.manager.restartSession(this.selectedSession),
577
+ isEnabled: () => !!this.selectedSession && this.selectedSession.state !== debug_session_1.DebugState.Inactive,
578
+ isVisible: () => !this.selectedThread
579
+ });
580
+ registry.registerCommand(DebugSessionContextCommands.CONTINUE_ALL, {
581
+ execute: () => this.selectedSession && this.selectedSession.continueAll(),
582
+ isEnabled: () => !!this.selectedSession && !!this.selectedSession.stoppedThreads.next().value,
583
+ isVisible: () => !this.selectedThread
584
+ });
585
+ registry.registerCommand(DebugSessionContextCommands.PAUSE_ALL, {
586
+ execute: () => this.selectedSession && this.selectedSession.pauseAll(),
587
+ isEnabled: () => !!this.selectedSession && !!this.selectedSession.runningThreads.next().value,
588
+ isVisible: () => !this.selectedThread
589
+ });
590
+ registry.registerCommand(DebugSessionContextCommands.REVEAL, {
591
+ execute: () => this.selectedSession && this.revealSession(this.selectedSession),
592
+ isEnabled: () => Boolean(this.selectedSession),
593
+ isVisible: () => !this.selectedThread && Boolean(this.selectedSession)
594
+ });
595
+ registry.registerCommand(DebugCommands.TOGGLE_BREAKPOINT, {
596
+ execute: () => this.editors.toggleBreakpoint(),
597
+ isEnabled: () => !!this.editors.model
598
+ });
599
+ registry.registerCommand(DebugCommands.INLINE_BREAKPOINT, {
600
+ execute: () => this.editors.addInlineBreakpoint(),
601
+ isEnabled: () => !!this.editors.model && !this.editors.getInlineBreakpoint()
602
+ });
603
+ registry.registerCommand(DebugCommands.ADD_CONDITIONAL_BREAKPOINT, {
604
+ execute: () => this.editors.addBreakpoint('condition'),
605
+ isEnabled: () => !!this.editors.model && !this.editors.anyBreakpoint()
606
+ });
607
+ registry.registerCommand(DebugCommands.ADD_LOGPOINT, {
608
+ execute: () => this.editors.addBreakpoint('logMessage'),
609
+ isEnabled: () => !!this.editors.model && !this.editors.anyBreakpoint()
610
+ });
611
+ registry.registerCommand(DebugCommands.ADD_FUNCTION_BREAKPOINT, {
612
+ execute: async () => {
613
+ const { labelProvider, breakpointManager, editorManager } = this;
614
+ const options = { labelProvider, breakpoints: breakpointManager, editorManager };
615
+ await new debug_function_breakpoint_1.DebugFunctionBreakpoint(breakpoint_marker_1.FunctionBreakpoint.create({ name: '' }), options).open();
616
+ },
617
+ isEnabled: widget => !(widget instanceof browser_1.Widget) || widget instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget,
618
+ isVisible: widget => !(widget instanceof browser_1.Widget) || widget instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget
619
+ });
620
+ registry.registerCommand(DebugCommands.ENABLE_ALL_BREAKPOINTS, {
621
+ execute: () => this.breakpointManager.enableAllBreakpoints(true),
622
+ isEnabled: () => this.breakpointManager.hasBreakpoints()
623
+ });
624
+ registry.registerCommand(DebugCommands.DISABLE_ALL_BREAKPOINTS, {
625
+ execute: () => this.breakpointManager.enableAllBreakpoints(false),
626
+ isEnabled: () => this.breakpointManager.hasBreakpoints()
627
+ });
628
+ registry.registerCommand(DebugCommands.EDIT_BREAKPOINT, {
629
+ execute: async () => {
630
+ const { selectedBreakpoint, selectedFunctionBreakpoint } = this;
631
+ if (selectedBreakpoint) {
632
+ await this.editors.editBreakpoint(selectedBreakpoint);
633
+ }
634
+ else if (selectedFunctionBreakpoint) {
635
+ await selectedFunctionBreakpoint.open();
636
+ }
637
+ },
638
+ isEnabled: () => !!this.selectedBreakpoint || !!this.selectedFunctionBreakpoint,
639
+ isVisible: () => !!this.selectedBreakpoint || !!this.selectedFunctionBreakpoint
640
+ });
641
+ registry.registerCommand(DebugCommands.EDIT_LOGPOINT, {
642
+ execute: async () => {
643
+ const { selectedLogpoint } = this;
644
+ if (selectedLogpoint) {
645
+ await this.editors.editBreakpoint(selectedLogpoint);
646
+ }
647
+ },
648
+ isEnabled: () => !!this.selectedLogpoint,
649
+ isVisible: () => !!this.selectedLogpoint
650
+ });
651
+ registry.registerCommand(DebugCommands.REMOVE_BREAKPOINT, {
652
+ execute: () => {
653
+ const selectedBreakpoint = this.selectedSettableBreakpoint;
654
+ if (selectedBreakpoint) {
655
+ selectedBreakpoint.remove();
656
+ }
657
+ },
658
+ isEnabled: () => Boolean(this.selectedSettableBreakpoint),
659
+ isVisible: () => Boolean(this.selectedSettableBreakpoint),
660
+ });
661
+ registry.registerCommand(DebugCommands.REMOVE_LOGPOINT, {
662
+ execute: () => {
663
+ const { selectedLogpoint } = this;
664
+ if (selectedLogpoint) {
665
+ selectedLogpoint.remove();
666
+ }
667
+ },
668
+ isEnabled: () => !!this.selectedLogpoint,
669
+ isVisible: () => !!this.selectedLogpoint
670
+ });
671
+ registry.registerCommand(DebugCommands.REMOVE_ALL_BREAKPOINTS, {
672
+ execute: () => this.breakpointManager.removeBreakpoints(),
673
+ isEnabled: () => this.breakpointManager.hasBreakpoints(),
674
+ isVisible: widget => !(widget instanceof browser_1.Widget) || (widget instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget)
675
+ });
676
+ registry.registerCommand(DebugCommands.TOGGLE_BREAKPOINTS_ENABLED, {
677
+ execute: () => this.breakpointManager.breakpointsEnabled = !this.breakpointManager.breakpointsEnabled,
678
+ isVisible: arg => arg instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget
679
+ });
680
+ registry.registerCommand(DebugCommands.SHOW_HOVER, {
681
+ execute: () => this.editors.showHover(),
682
+ isEnabled: () => this.editors.canShowHover()
683
+ });
684
+ registry.registerCommand(DebugCommands.RESTART_FRAME, {
685
+ execute: () => this.selectedFrame && this.selectedFrame.restart(),
686
+ isEnabled: () => !!this.selectedFrame
687
+ });
688
+ registry.registerCommand(DebugCommands.COPY_CALL_STACK, {
689
+ execute: () => {
690
+ const { frames } = this;
691
+ const selection = document.getSelection();
692
+ if (frames && selection) {
693
+ selection.selectAllChildren(frames.node);
694
+ document.execCommand('copy');
695
+ }
696
+ },
697
+ isEnabled: () => document.queryCommandSupported('copy'),
698
+ isVisible: () => document.queryCommandSupported('copy')
699
+ });
700
+ registry.registerCommand(DebugCommands.SET_VARIABLE_VALUE, {
701
+ execute: () => this.selectedVariable && this.selectedVariable.open(),
702
+ isEnabled: () => !!this.selectedVariable && this.selectedVariable.supportSetVariable,
703
+ isVisible: () => !!this.selectedVariable && this.selectedVariable.supportSetVariable
704
+ });
705
+ registry.registerCommand(DebugCommands.COPY_VARIABLE_VALUE, {
706
+ execute: () => this.selectedVariable && this.selectedVariable.copyValue(),
707
+ isEnabled: () => !!this.selectedVariable && this.selectedVariable.supportCopyValue,
708
+ isVisible: () => !!this.selectedVariable && this.selectedVariable.supportCopyValue
709
+ });
710
+ registry.registerCommand(DebugCommands.COPY_VARIABLE_AS_EXPRESSION, {
711
+ execute: () => this.selectedVariable && this.selectedVariable.copyAsExpression(),
712
+ isEnabled: () => !!this.selectedVariable && this.selectedVariable.supportCopyAsExpression,
713
+ isVisible: () => !!this.selectedVariable && this.selectedVariable.supportCopyAsExpression
714
+ });
715
+ registry.registerCommand(DebugCommands.WATCH_VARIABLE, {
716
+ execute: () => {
717
+ const { selectedVariable, watch } = this;
718
+ if (selectedVariable && watch) {
719
+ watch.viewModel.addWatchExpression(selectedVariable.name);
720
+ }
721
+ },
722
+ isEnabled: () => !!this.selectedVariable && !!this.watch,
723
+ isVisible: () => !!this.selectedVariable && !!this.watch,
724
+ });
725
+ // Debug context menu commands
726
+ registry.registerCommand(DebugEditorContextCommands.ADD_BREAKPOINT, {
727
+ execute: position => this.isPosition(position) && this.editors.toggleBreakpoint(position),
728
+ isEnabled: position => this.isPosition(position) && !this.editors.anyBreakpoint(position),
729
+ isVisible: position => this.isPosition(position) && !this.editors.anyBreakpoint(position)
730
+ });
731
+ registry.registerCommand(DebugEditorContextCommands.ADD_CONDITIONAL_BREAKPOINT, {
732
+ execute: position => this.isPosition(position) && this.editors.addBreakpoint('condition', position),
733
+ isEnabled: position => this.isPosition(position) && !this.editors.anyBreakpoint(position),
734
+ isVisible: position => this.isPosition(position) && !this.editors.anyBreakpoint(position)
735
+ });
736
+ registry.registerCommand(DebugEditorContextCommands.ADD_LOGPOINT, {
737
+ execute: position => this.isPosition(position) && this.editors.addBreakpoint('logMessage', position),
738
+ isEnabled: position => this.isPosition(position) && !this.editors.anyBreakpoint(position),
739
+ isVisible: position => this.isPosition(position) && !this.editors.anyBreakpoint(position)
740
+ });
741
+ registry.registerCommand(DebugEditorContextCommands.REMOVE_BREAKPOINT, {
742
+ execute: position => this.isPosition(position) && this.editors.toggleBreakpoint(position),
743
+ isEnabled: position => this.isPosition(position) && !!this.editors.getBreakpoint(position),
744
+ isVisible: position => this.isPosition(position) && !!this.editors.getBreakpoint(position)
745
+ });
746
+ registry.registerCommand(DebugEditorContextCommands.EDIT_BREAKPOINT, {
747
+ execute: position => this.isPosition(position) && this.editors.editBreakpoint(position),
748
+ isEnabled: position => this.isPosition(position) && !!this.editors.getBreakpoint(position),
749
+ isVisible: position => this.isPosition(position) && !!this.editors.getBreakpoint(position)
750
+ });
751
+ registry.registerCommand(DebugEditorContextCommands.ENABLE_BREAKPOINT, {
752
+ execute: position => this.isPosition(position) && this.editors.setBreakpointEnabled(position, true),
753
+ isEnabled: position => this.isPosition(position) && this.editors.getBreakpointEnabled(position) === false,
754
+ isVisible: position => this.isPosition(position) && this.editors.getBreakpointEnabled(position) === false
755
+ });
756
+ registry.registerCommand(DebugEditorContextCommands.DISABLE_BREAKPOINT, {
757
+ execute: position => this.isPosition(position) && this.editors.setBreakpointEnabled(position, false),
758
+ isEnabled: position => this.isPosition(position) && !!this.editors.getBreakpointEnabled(position),
759
+ isVisible: position => this.isPosition(position) && !!this.editors.getBreakpointEnabled(position)
760
+ });
761
+ registry.registerCommand(DebugEditorContextCommands.REMOVE_LOGPOINT, {
762
+ execute: position => this.isPosition(position) && this.editors.toggleBreakpoint(position),
763
+ isEnabled: position => this.isPosition(position) && !!this.editors.getLogpoint(position),
764
+ isVisible: position => this.isPosition(position) && !!this.editors.getLogpoint(position)
765
+ });
766
+ registry.registerCommand(DebugEditorContextCommands.EDIT_LOGPOINT, {
767
+ execute: position => this.isPosition(position) && this.editors.editBreakpoint(position),
768
+ isEnabled: position => this.isPosition(position) && !!this.editors.getLogpoint(position),
769
+ isVisible: position => this.isPosition(position) && !!this.editors.getLogpoint(position)
770
+ });
771
+ registry.registerCommand(DebugEditorContextCommands.ENABLE_LOGPOINT, {
772
+ execute: position => this.isPosition(position) && this.editors.setBreakpointEnabled(position, true),
773
+ isEnabled: position => this.isPosition(position) && this.editors.getLogpointEnabled(position) === false,
774
+ isVisible: position => this.isPosition(position) && this.editors.getLogpointEnabled(position) === false
775
+ });
776
+ registry.registerCommand(DebugEditorContextCommands.DISABLE_LOGPOINT, {
777
+ execute: position => this.isPosition(position) && this.editors.setBreakpointEnabled(position, false),
778
+ isEnabled: position => this.isPosition(position) && !!this.editors.getLogpointEnabled(position),
779
+ isVisible: position => this.isPosition(position) && !!this.editors.getLogpointEnabled(position)
780
+ });
781
+ registry.registerCommand(DebugBreakpointWidgetCommands.ACCEPT, {
782
+ execute: () => this.editors.acceptBreakpoint()
783
+ });
784
+ registry.registerCommand(DebugBreakpointWidgetCommands.CLOSE, {
785
+ execute: () => this.editors.closeBreakpoint()
786
+ });
787
+ registry.registerCommand(DebugCommands.ADD_WATCH_EXPRESSION, {
788
+ execute: widget => {
789
+ if (widget instanceof browser_1.Widget) {
790
+ if (widget instanceof debug_watch_widget_1.DebugWatchWidget) {
791
+ widget.viewModel.addWatchExpression();
792
+ }
793
+ }
794
+ else if (this.watch) {
795
+ this.watch.viewModel.addWatchExpression();
796
+ }
797
+ },
798
+ isEnabled: widget => widget instanceof browser_1.Widget ? widget instanceof debug_watch_widget_1.DebugWatchWidget : !!this.watch,
799
+ isVisible: widget => widget instanceof browser_1.Widget ? widget instanceof debug_watch_widget_1.DebugWatchWidget : !!this.watch
800
+ });
801
+ registry.registerCommand(DebugCommands.EDIT_WATCH_EXPRESSION, {
802
+ execute: () => {
803
+ const { watchExpression } = this;
804
+ if (watchExpression) {
805
+ watchExpression.open();
806
+ }
807
+ },
808
+ isEnabled: () => !!this.watchExpression,
809
+ isVisible: () => !!this.watchExpression
810
+ });
811
+ registry.registerCommand(DebugCommands.COPY_WATCH_EXPRESSION_VALUE, {
812
+ execute: () => this.watchExpression && this.watchExpression.copyValue(),
813
+ isEnabled: () => !!this.watchExpression && this.watchExpression.supportCopyValue,
814
+ isVisible: () => !!this.watchExpression && this.watchExpression.supportCopyValue
815
+ });
816
+ registry.registerCommand(DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS, {
817
+ execute: widget => {
818
+ if (widget instanceof debug_watch_widget_1.DebugWatchWidget) {
819
+ const root = widget.model.root;
820
+ widget.model.collapseAll(browser_1.CompositeTreeNode.is(root) ? root : undefined);
821
+ }
822
+ },
823
+ isEnabled: widget => widget instanceof debug_watch_widget_1.DebugWatchWidget,
824
+ isVisible: widget => widget instanceof debug_watch_widget_1.DebugWatchWidget
825
+ });
826
+ registry.registerCommand(DebugCommands.REMOVE_WATCH_EXPRESSION, {
827
+ execute: () => {
828
+ const { watch, watchExpression } = this;
829
+ if (watch && watchExpression) {
830
+ watch.viewModel.removeWatchExpression(watchExpression);
831
+ }
832
+ },
833
+ isEnabled: () => !!this.watchExpression,
834
+ isVisible: () => !!this.watchExpression
835
+ });
836
+ registry.registerCommand(DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS, {
837
+ execute: widget => {
838
+ if (widget instanceof browser_1.Widget) {
839
+ if (widget instanceof debug_watch_widget_1.DebugWatchWidget) {
840
+ widget.viewModel.removeWatchExpressions();
841
+ }
842
+ }
843
+ else if (this.watch) {
844
+ this.watch.viewModel.removeWatchExpressions();
845
+ }
846
+ },
847
+ isEnabled: widget => widget instanceof browser_1.Widget ? widget instanceof debug_watch_widget_1.DebugWatchWidget : !!this.watch,
848
+ isVisible: widget => widget instanceof browser_1.Widget ? widget instanceof debug_watch_widget_1.DebugWatchWidget : !!this.watch
849
+ });
850
+ }
851
+ registerKeybindings(keybindings) {
852
+ super.registerKeybindings(keybindings);
853
+ keybindings.registerKeybinding({
854
+ command: DebugCommands.START.id,
855
+ keybinding: 'f5'
856
+ });
857
+ keybindings.registerKeybinding({
858
+ command: DebugCommands.START_NO_DEBUG.id,
859
+ keybinding: 'ctrl+f5'
860
+ });
861
+ keybindings.registerKeybinding({
862
+ command: DebugCommands.STOP.id,
863
+ keybinding: 'shift+f5',
864
+ context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
865
+ });
866
+ keybindings.registerKeybinding({
867
+ command: DebugCommands.RESTART.id,
868
+ keybinding: 'shift+ctrlcmd+f5',
869
+ context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
870
+ });
871
+ keybindings.registerKeybinding({
872
+ command: DebugCommands.STEP_OVER.id,
873
+ keybinding: 'f10',
874
+ context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
875
+ });
876
+ keybindings.registerKeybinding({
877
+ command: DebugCommands.STEP_INTO.id,
878
+ keybinding: 'f11',
879
+ context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
880
+ });
881
+ keybindings.registerKeybinding({
882
+ command: DebugCommands.STEP_OUT.id,
883
+ keybinding: 'shift+f11',
884
+ context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
885
+ });
886
+ keybindings.registerKeybinding({
887
+ command: DebugCommands.CONTINUE.id,
888
+ keybinding: 'f5',
889
+ context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
890
+ });
891
+ keybindings.registerKeybinding({
892
+ command: DebugCommands.PAUSE.id,
893
+ keybinding: 'f6',
894
+ context: debug_keybinding_contexts_1.DebugKeybindingContexts.inDebugMode
895
+ });
896
+ keybindings.registerKeybinding({
897
+ command: DebugCommands.TOGGLE_BREAKPOINT.id,
898
+ keybinding: 'f9',
899
+ context: browser_2.EditorKeybindingContexts.editorTextFocus
900
+ });
901
+ keybindings.registerKeybinding({
902
+ command: DebugCommands.INLINE_BREAKPOINT.id,
903
+ keybinding: 'shift+f9',
904
+ context: browser_2.EditorKeybindingContexts.editorTextFocus
905
+ });
906
+ keybindings.registerKeybinding({
907
+ command: DebugBreakpointWidgetCommands.ACCEPT.id,
908
+ keybinding: 'enter',
909
+ context: debug_keybinding_contexts_1.DebugKeybindingContexts.breakpointWidgetInputFocus
910
+ });
911
+ keybindings.registerKeybinding({
912
+ command: DebugBreakpointWidgetCommands.CLOSE.id,
913
+ keybinding: 'esc',
914
+ context: debug_keybinding_contexts_1.DebugKeybindingContexts.breakpointWidgetInputStrictFocus
915
+ });
916
+ }
917
+ registerToolbarItems(toolbar) {
918
+ const onDidChangeToggleBreakpointsEnabled = new common_1.Emitter();
919
+ const toggleBreakpointsEnabled = {
920
+ id: DebugCommands.TOGGLE_BREAKPOINTS_ENABLED.id,
921
+ command: DebugCommands.TOGGLE_BREAKPOINTS_ENABLED.id,
922
+ icon: (0, browser_1.codicon)('activate-breakpoints'),
923
+ onDidChange: onDidChangeToggleBreakpointsEnabled.event,
924
+ priority: 1
925
+ };
926
+ const updateToggleBreakpointsEnabled = () => {
927
+ const activateBreakpoints = nls_1.nls.localizeByDefault('Enable All Breakpoints');
928
+ const deactivateBreakpoints = nls_1.nls.localizeByDefault('Disable All Breakpoints');
929
+ const tooltip = this.breakpointManager.breakpointsEnabled ? deactivateBreakpoints : activateBreakpoints;
930
+ if (toggleBreakpointsEnabled.tooltip !== tooltip) {
931
+ toggleBreakpointsEnabled.tooltip = tooltip;
932
+ onDidChangeToggleBreakpointsEnabled.fire(undefined);
933
+ }
934
+ };
935
+ toolbar.registerItem({
936
+ id: DebugCommands.ADD_FUNCTION_BREAKPOINT.id,
937
+ command: DebugCommands.ADD_FUNCTION_BREAKPOINT.id,
938
+ icon: (0, browser_1.codicon)('add'),
939
+ tooltip: DebugCommands.ADD_FUNCTION_BREAKPOINT.label
940
+ });
941
+ updateToggleBreakpointsEnabled();
942
+ this.breakpointManager.onDidChangeBreakpoints(updateToggleBreakpointsEnabled);
943
+ toolbar.registerItem(toggleBreakpointsEnabled);
944
+ toolbar.registerItem({
945
+ id: DebugCommands.REMOVE_ALL_BREAKPOINTS.id,
946
+ command: DebugCommands.REMOVE_ALL_BREAKPOINTS.id,
947
+ icon: (0, browser_1.codicon)('close-all'),
948
+ priority: 2
949
+ });
950
+ toolbar.registerItem({
951
+ id: DebugCommands.ADD_WATCH_EXPRESSION.id,
952
+ command: DebugCommands.ADD_WATCH_EXPRESSION.id,
953
+ icon: (0, browser_1.codicon)('add'),
954
+ tooltip: DebugCommands.ADD_WATCH_EXPRESSION.label
955
+ });
956
+ toolbar.registerItem({
957
+ id: DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS.id,
958
+ command: DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS.id,
959
+ icon: (0, browser_1.codicon)('collapse-all'),
960
+ tooltip: DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS.label,
961
+ priority: 1
962
+ });
963
+ toolbar.registerItem({
964
+ id: DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS.id,
965
+ command: DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS.id,
966
+ icon: (0, browser_1.codicon)('close-all'),
967
+ tooltip: DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS.label,
968
+ priority: 2
969
+ });
970
+ }
971
+ async openSession(session, options) {
972
+ const { reveal } = Object.assign({ reveal: true }, options);
973
+ const debugWidget = await this.openView({ reveal });
974
+ debugWidget.sessionManager.currentSession = session;
975
+ return debugWidget['sessionWidget'];
976
+ }
977
+ revealSession(session) {
978
+ var _a;
979
+ const widget = (_a = this.tryGetWidget()) === null || _a === void 0 ? void 0 : _a['sessionWidget'];
980
+ if (widget) {
981
+ this.shell.revealWidget(widget.id);
982
+ }
983
+ return widget;
984
+ }
985
+ async start(noDebug, debugSessionOptions) {
986
+ let current = debugSessionOptions ? debugSessionOptions : this.configurations.current;
987
+ // If no configurations are currently present, create the `launch.json` and prompt users to select the config.
988
+ if (!current) {
989
+ await this.configurations.addConfiguration();
990
+ return;
991
+ }
992
+ if (noDebug !== undefined) {
993
+ if (current.configuration) {
994
+ current = Object.assign(Object.assign({}, current), { configuration: Object.assign(Object.assign({}, current.configuration), { noDebug }) });
995
+ }
996
+ else {
997
+ current = Object.assign(Object.assign({}, current), { noDebug });
998
+ }
999
+ }
1000
+ await this.manager.start(current);
1001
+ }
1002
+ get threads() {
1003
+ const { currentWidget } = this.shell;
1004
+ return currentWidget instanceof debug_threads_widget_1.DebugThreadsWidget && currentWidget || undefined;
1005
+ }
1006
+ get selectedSession() {
1007
+ const { threads } = this;
1008
+ return threads && threads.selectedElement instanceof debug_session_1.DebugSession && threads.selectedElement || undefined;
1009
+ }
1010
+ get selectedThread() {
1011
+ const { threads } = this;
1012
+ return threads && threads.selectedElement instanceof debug_thread_1.DebugThread && threads.selectedElement || undefined;
1013
+ }
1014
+ get frames() {
1015
+ const { currentWidget } = this.shell;
1016
+ return currentWidget instanceof debug_stack_frames_widget_1.DebugStackFramesWidget && currentWidget || undefined;
1017
+ }
1018
+ get selectedFrame() {
1019
+ const { frames } = this;
1020
+ return frames && frames.selectedElement instanceof debug_stack_frame_1.DebugStackFrame && frames.selectedElement || undefined;
1021
+ }
1022
+ get breakpoints() {
1023
+ const { currentWidget } = this.shell;
1024
+ return currentWidget instanceof debug_breakpoints_widget_1.DebugBreakpointsWidget && currentWidget || undefined;
1025
+ }
1026
+ get selectedAnyBreakpoint() {
1027
+ const { breakpoints } = this;
1028
+ const selectedElement = breakpoints && breakpoints.selectedElement;
1029
+ return selectedElement instanceof debug_breakpoint_1.DebugBreakpoint ? selectedElement : undefined;
1030
+ }
1031
+ get selectedBreakpoint() {
1032
+ const breakpoint = this.selectedAnyBreakpoint;
1033
+ return breakpoint && breakpoint instanceof debug_source_breakpoint_1.DebugSourceBreakpoint && !breakpoint.logMessage ? breakpoint : undefined;
1034
+ }
1035
+ get selectedLogpoint() {
1036
+ const breakpoint = this.selectedAnyBreakpoint;
1037
+ return breakpoint && breakpoint instanceof debug_source_breakpoint_1.DebugSourceBreakpoint && !!breakpoint.logMessage ? breakpoint : undefined;
1038
+ }
1039
+ get selectedFunctionBreakpoint() {
1040
+ const breakpoint = this.selectedAnyBreakpoint;
1041
+ return breakpoint && breakpoint instanceof debug_function_breakpoint_1.DebugFunctionBreakpoint ? breakpoint : undefined;
1042
+ }
1043
+ get selectedInstructionBreakpoint() {
1044
+ if (this.selectedAnyBreakpoint instanceof debug_instruction_breakpoint_1.DebugInstructionBreakpoint) {
1045
+ return this.selectedAnyBreakpoint;
1046
+ }
1047
+ }
1048
+ get selectedSettableBreakpoint() {
1049
+ const selected = this.selectedAnyBreakpoint;
1050
+ if (selected instanceof debug_function_breakpoint_1.DebugFunctionBreakpoint || selected instanceof debug_instruction_breakpoint_1.DebugInstructionBreakpoint || selected instanceof debug_source_breakpoint_1.DebugSourceBreakpoint) {
1051
+ return selected;
1052
+ }
1053
+ }
1054
+ get variables() {
1055
+ const { currentWidget } = this.shell;
1056
+ return currentWidget instanceof debug_variables_widget_1.DebugVariablesWidget && currentWidget || undefined;
1057
+ }
1058
+ get selectedVariable() {
1059
+ const { variables } = this;
1060
+ return variables && variables.selectedElement instanceof debug_console_items_1.DebugVariable && variables.selectedElement || undefined;
1061
+ }
1062
+ get watch() {
1063
+ const { currentWidget } = this.shell;
1064
+ return currentWidget instanceof debug_watch_widget_1.DebugWatchWidget && currentWidget || undefined;
1065
+ }
1066
+ get watchExpression() {
1067
+ const { watch } = this;
1068
+ return watch && watch.selectedElement instanceof debug_watch_expression_1.DebugWatchExpression && watch.selectedElement || undefined;
1069
+ }
1070
+ isPosition(position) {
1071
+ return (position instanceof monaco.Position);
1072
+ }
1073
+ registerColors(colors) {
1074
+ colors.register(
1075
+ // Debug colors should be aligned with https://code.visualstudio.com/api/references/theme-color#debug-colors
1076
+ {
1077
+ id: 'editor.stackFrameHighlightBackground',
1078
+ defaults: {
1079
+ dark: '#ffff0033',
1080
+ light: '#ffff6673',
1081
+ hcDark: '#fff600',
1082
+ hcLight: '#ffff6673'
1083
+ }, description: 'Background color for the highlight of line at the top stack frame position.'
1084
+ }, {
1085
+ id: 'editor.focusedStackFrameHighlightBackground',
1086
+ defaults: {
1087
+ dark: '#7abd7a4d',
1088
+ light: '#cee7ce73',
1089
+ hcDark: '#cee7ce',
1090
+ hcLight: '#cee7ce73'
1091
+ }, description: 'Background color for the highlight of line at focused stack frame position.'
1092
+ },
1093
+ // Status bar colors should be aligned with debugging colors from https://code.visualstudio.com/api/references/theme-color#status-bar-colors
1094
+ {
1095
+ id: 'statusBar.debuggingBackground', defaults: {
1096
+ dark: '#CC6633',
1097
+ light: '#CC6633',
1098
+ hcDark: '#CC6633',
1099
+ hcLight: '#B5200D'
1100
+ }, description: 'Status bar background color when a program is being debugged. The status bar is shown in the bottom of the window'
1101
+ }, {
1102
+ id: 'statusBar.debuggingForeground', defaults: {
1103
+ dark: 'statusBar.foreground',
1104
+ light: 'statusBar.foreground',
1105
+ hcDark: 'statusBar.foreground',
1106
+ hcLight: 'statusBar.foreground'
1107
+ }, description: 'Status bar foreground color when a program is being debugged. The status bar is shown in the bottom of the window'
1108
+ }, {
1109
+ id: 'statusBar.debuggingBorder', defaults: {
1110
+ dark: 'statusBar.border',
1111
+ light: 'statusBar.border',
1112
+ hcDark: 'statusBar.border',
1113
+ hcLight: 'statusBar.border'
1114
+ }, description: 'Status bar border color separating to the sidebar and editor when a program is being debugged. The status bar is shown in the bottom of the window'
1115
+ },
1116
+ // Debug Exception Widget colors should be aligned with
1117
+ // https://github.com/microsoft/vscode/blob/ff5f581425da6230b6f9216ecf19abf6c9d285a6/src/vs/workbench/contrib/debug/browser/exceptionWidget.ts#L23
1118
+ {
1119
+ id: 'debugExceptionWidget.border', defaults: {
1120
+ dark: '#a31515',
1121
+ light: '#a31515',
1122
+ hcDark: '#a31515',
1123
+ hcLight: '#a31515'
1124
+ }, description: 'Exception widget border color.',
1125
+ }, {
1126
+ id: 'debugExceptionWidget.background', defaults: {
1127
+ dark: '#420b0d',
1128
+ light: '#f1dfde',
1129
+ hcDark: '#420b0d',
1130
+ hcLight: '#f1dfde'
1131
+ }, description: 'Exception widget background color.'
1132
+ },
1133
+ // Debug Icon colors should be aligned with
1134
+ // https://code.visualstudio.com/api/references/theme-color#debug-icons-colors
1135
+ {
1136
+ id: 'debugIcon.breakpointForeground', defaults: {
1137
+ dark: '#E51400',
1138
+ light: '#E51400',
1139
+ hcDark: '#E51400',
1140
+ hcLight: '#E51400'
1141
+ },
1142
+ description: 'Icon color for breakpoints.'
1143
+ }, {
1144
+ id: 'debugIcon.breakpointDisabledForeground', defaults: {
1145
+ dark: '#848484',
1146
+ light: '#848484',
1147
+ hcDark: '#848484',
1148
+ hcLight: '#848484'
1149
+ },
1150
+ description: 'Icon color for disabled breakpoints.'
1151
+ }, {
1152
+ id: 'debugIcon.breakpointUnverifiedForeground', defaults: {
1153
+ dark: '#848484',
1154
+ light: '#848484',
1155
+ hcDark: '#848484',
1156
+ hcLight: '#848484'
1157
+ },
1158
+ description: 'Icon color for unverified breakpoints.'
1159
+ }, {
1160
+ id: 'debugIcon.breakpointCurrentStackframeForeground', defaults: {
1161
+ dark: '#FFCC00',
1162
+ light: '#BE8700',
1163
+ hcDark: '#FFCC00',
1164
+ hcLight: '#BE8700'
1165
+ },
1166
+ description: 'Icon color for the current breakpoint stack frame.'
1167
+ }, {
1168
+ id: 'debugIcon.breakpointStackframeForeground', defaults: {
1169
+ dark: '#89D185',
1170
+ light: '#89D185',
1171
+ hcDark: '#89D185',
1172
+ hcLight: '#89D185'
1173
+ },
1174
+ description: 'Icon color for all breakpoint stack frames.'
1175
+ }, {
1176
+ id: 'debugIcon.startForeground', defaults: {
1177
+ dark: '#89D185',
1178
+ light: '#388A34',
1179
+ hcDark: '#89D185',
1180
+ hcLight: '#388A34'
1181
+ }, description: 'Debug toolbar icon for start debugging.'
1182
+ }, {
1183
+ id: 'debugIcon.pauseForeground', defaults: {
1184
+ dark: '#75BEFF',
1185
+ light: '#007ACC',
1186
+ hcDark: '#75BEFF',
1187
+ hcLight: '#007ACC'
1188
+ }, description: 'Debug toolbar icon for pause.'
1189
+ }, {
1190
+ id: 'debugIcon.stopForeground', defaults: {
1191
+ dark: '#F48771',
1192
+ light: '#A1260D',
1193
+ hcDark: '#F48771',
1194
+ hcLight: '#A1260D'
1195
+ }, description: 'Debug toolbar icon for stop.'
1196
+ }, {
1197
+ id: 'debugIcon.disconnectForeground', defaults: {
1198
+ dark: '#F48771',
1199
+ light: '#A1260D',
1200
+ hcDark: '#F48771',
1201
+ hcLight: '#A1260D'
1202
+ }, description: 'Debug toolbar icon for disconnect.'
1203
+ }, {
1204
+ id: 'debugIcon.restartForeground', defaults: {
1205
+ dark: '#89D185',
1206
+ light: '#388A34',
1207
+ hcDark: '#89D185',
1208
+ hcLight: '#388A34'
1209
+ }, description: 'Debug toolbar icon for restart.'
1210
+ }, {
1211
+ id: 'debugIcon.stepOverForeground', defaults: {
1212
+ dark: '#75BEFF',
1213
+ light: '#007ACC',
1214
+ hcDark: '#75BEFF',
1215
+ hcLight: '#007ACC',
1216
+ }, description: 'Debug toolbar icon for step over.'
1217
+ }, {
1218
+ id: 'debugIcon.stepIntoForeground', defaults: {
1219
+ dark: '#75BEFF',
1220
+ light: '#007ACC',
1221
+ hcDark: '#75BEFF',
1222
+ hcLight: '#007ACC'
1223
+ }, description: 'Debug toolbar icon for step into.'
1224
+ }, {
1225
+ id: 'debugIcon.stepOutForeground', defaults: {
1226
+ dark: '#75BEFF',
1227
+ light: '#007ACC',
1228
+ hcDark: '#75BEFF',
1229
+ hcLight: '#007ACC',
1230
+ }, description: 'Debug toolbar icon for step over.'
1231
+ }, {
1232
+ id: 'debugIcon.continueForeground', defaults: {
1233
+ dark: '#75BEFF',
1234
+ light: '#007ACC',
1235
+ hcDark: '#75BEFF',
1236
+ hcLight: '#007ACC'
1237
+ }, description: 'Debug toolbar icon for continue.'
1238
+ }, {
1239
+ id: 'debugIcon.stepBackForeground', defaults: {
1240
+ dark: '#75BEFF',
1241
+ light: '#007ACC',
1242
+ hcDark: '#75BEFF',
1243
+ hcLight: '#007ACC'
1244
+ }, description: 'Debug toolbar icon for step back.'
1245
+ }, {
1246
+ id: 'debugConsole.infoForeground', defaults: {
1247
+ dark: 'editorInfo.foreground',
1248
+ light: 'editorInfo.foreground',
1249
+ hcDark: 'foreground',
1250
+ hcLight: 'foreground'
1251
+ }, description: 'Foreground color for info messages in debug REPL console.'
1252
+ }, {
1253
+ id: 'debugConsole.warningForeground', defaults: {
1254
+ dark: 'editorWarning.foreground',
1255
+ light: 'editorWarning.foreground',
1256
+ hcDark: '#008000',
1257
+ hcLight: 'editorWarning.foreground'
1258
+ },
1259
+ description: 'Foreground color for warning messages in debug REPL console.'
1260
+ }, {
1261
+ id: 'debugConsole.errorForeground', defaults: {
1262
+ dark: 'errorForeground',
1263
+ light: 'errorForeground',
1264
+ hcDark: 'errorForeground',
1265
+ hcLight: 'errorForeground'
1266
+ },
1267
+ description: 'Foreground color for error messages in debug REPL console.',
1268
+ }, {
1269
+ id: 'debugConsole.sourceForeground', defaults: {
1270
+ dark: 'foreground',
1271
+ light: 'foreground',
1272
+ hcDark: 'foreground',
1273
+ hcLight: 'foreground'
1274
+ },
1275
+ description: 'Foreground color for source filenames in debug REPL console.',
1276
+ }, {
1277
+ id: 'debugConsoleInputIcon.foreground', defaults: {
1278
+ dark: 'foreground',
1279
+ light: 'foreground',
1280
+ hcDark: 'foreground',
1281
+ hcLight: 'foreground'
1282
+ },
1283
+ description: 'Foreground color for debug console input marker icon.'
1284
+ });
1285
+ }
1286
+ updateStatusBar() {
1287
+ if (this.debuggingStatusBar === document.body.classList.contains('theia-mod-debugging')) {
1288
+ return;
1289
+ }
1290
+ document.body.classList.toggle('theia-mod-debugging');
1291
+ }
1292
+ get debuggingStatusBar() {
1293
+ if (this.manager.state < debug_session_1.DebugState.Running) {
1294
+ return false;
1295
+ }
1296
+ const session = this.manager.currentSession;
1297
+ if (session && session.configuration.noDebug) {
1298
+ return false;
1299
+ }
1300
+ return true;
1301
+ }
1302
+ };
1303
+ __decorate([
1304
+ (0, inversify_1.inject)(debug_service_1.DebugService),
1305
+ __metadata("design:type", Object)
1306
+ ], DebugFrontendApplicationContribution.prototype, "debug", void 0);
1307
+ __decorate([
1308
+ (0, inversify_1.inject)(debug_session_manager_1.DebugSessionManager),
1309
+ __metadata("design:type", debug_session_manager_1.DebugSessionManager)
1310
+ ], DebugFrontendApplicationContribution.prototype, "manager", void 0);
1311
+ __decorate([
1312
+ (0, inversify_1.inject)(debug_configuration_manager_1.DebugConfigurationManager),
1313
+ __metadata("design:type", debug_configuration_manager_1.DebugConfigurationManager)
1314
+ ], DebugFrontendApplicationContribution.prototype, "configurations", void 0);
1315
+ __decorate([
1316
+ (0, inversify_1.inject)(breakpoint_manager_1.BreakpointManager),
1317
+ __metadata("design:type", breakpoint_manager_1.BreakpointManager)
1318
+ ], DebugFrontendApplicationContribution.prototype, "breakpointManager", void 0);
1319
+ __decorate([
1320
+ (0, inversify_1.inject)(debug_editor_service_1.DebugEditorService),
1321
+ __metadata("design:type", debug_editor_service_1.DebugEditorService)
1322
+ ], DebugFrontendApplicationContribution.prototype, "editors", void 0);
1323
+ __decorate([
1324
+ (0, inversify_1.inject)(debug_console_contribution_1.DebugConsoleContribution),
1325
+ __metadata("design:type", debug_console_contribution_1.DebugConsoleContribution)
1326
+ ], DebugFrontendApplicationContribution.prototype, "console", void 0);
1327
+ __decorate([
1328
+ (0, inversify_1.inject)(debug_schema_updater_1.DebugSchemaUpdater),
1329
+ __metadata("design:type", debug_schema_updater_1.DebugSchemaUpdater)
1330
+ ], DebugFrontendApplicationContribution.prototype, "schemaUpdater", void 0);
1331
+ __decorate([
1332
+ (0, inversify_1.inject)(debug_preferences_1.DebugPreferences),
1333
+ __metadata("design:type", Object)
1334
+ ], DebugFrontendApplicationContribution.prototype, "preference", void 0);
1335
+ __decorate([
1336
+ (0, inversify_1.inject)(debug_watch_manager_1.DebugWatchManager),
1337
+ __metadata("design:type", debug_watch_manager_1.DebugWatchManager)
1338
+ ], DebugFrontendApplicationContribution.prototype, "watchManager", void 0);
1339
+ __decorate([
1340
+ (0, inversify_1.inject)(browser_1.LabelProvider),
1341
+ __metadata("design:type", browser_1.LabelProvider)
1342
+ ], DebugFrontendApplicationContribution.prototype, "labelProvider", void 0);
1343
+ __decorate([
1344
+ (0, inversify_1.inject)(browser_2.EditorManager),
1345
+ __metadata("design:type", browser_2.EditorManager)
1346
+ ], DebugFrontendApplicationContribution.prototype, "editorManager", void 0);
1347
+ DebugFrontendApplicationContribution = __decorate([
1348
+ (0, inversify_1.injectable)(),
1349
+ __metadata("design:paramtypes", [])
1350
+ ], DebugFrontendApplicationContribution);
1351
+ exports.DebugFrontendApplicationContribution = DebugFrontendApplicationContribution;
1352
1352
  //# sourceMappingURL=debug-frontend-application-contribution.js.map