@theia/debug 1.67.0-next.59 → 1.67.0

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 (145) hide show
  1. package/lib/browser/breakpoint/breakpoint-manager.js +1 -1
  2. package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
  3. package/lib/browser/console/debug-console-items.d.ts +13 -3
  4. package/lib/browser/console/debug-console-items.d.ts.map +1 -1
  5. package/lib/browser/console/debug-console-items.js +81 -20
  6. package/lib/browser/console/debug-console-items.js.map +1 -1
  7. package/lib/browser/console/debug-console-session.d.ts.map +1 -1
  8. package/lib/browser/console/debug-console-session.js +1 -0
  9. package/lib/browser/console/debug-console-session.js.map +1 -1
  10. package/lib/browser/debug-commands.d.ts +153 -0
  11. package/lib/browser/debug-commands.d.ts.map +1 -0
  12. package/lib/browser/debug-commands.js +399 -0
  13. package/lib/browser/debug-commands.js.map +1 -0
  14. package/lib/browser/debug-frontend-application-contribution.d.ts +1 -150
  15. package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
  16. package/lib/browser/debug-frontend-application-contribution.js +155 -532
  17. package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
  18. package/lib/browser/debug-prefix-configuration.js +3 -3
  19. package/lib/browser/debug-prefix-configuration.js.map +1 -1
  20. package/lib/browser/debug-session-contribution.d.ts +2 -1
  21. package/lib/browser/debug-session-contribution.d.ts.map +1 -1
  22. package/lib/browser/debug-session-contribution.js +5 -1
  23. package/lib/browser/debug-session-contribution.js.map +1 -1
  24. package/lib/browser/debug-session-manager.d.ts +11 -3
  25. package/lib/browser/debug-session-manager.d.ts.map +1 -1
  26. package/lib/browser/debug-session-manager.js +49 -8
  27. package/lib/browser/debug-session-manager.js.map +1 -1
  28. package/lib/browser/debug-session.d.ts +9 -3
  29. package/lib/browser/debug-session.d.ts.map +1 -1
  30. package/lib/browser/debug-session.js +13 -3
  31. package/lib/browser/debug-session.js.map +1 -1
  32. package/lib/browser/editor/debug-hover-source.d.ts +1 -0
  33. package/lib/browser/editor/debug-hover-source.d.ts.map +1 -1
  34. package/lib/browser/editor/debug-hover-source.js +9 -0
  35. package/lib/browser/editor/debug-hover-source.js.map +1 -1
  36. package/lib/browser/editor/debug-inline-value-decorator.js +1 -1
  37. package/lib/browser/editor/debug-inline-value-decorator.js.map +1 -1
  38. package/lib/browser/model/debug-breakpoint.d.ts +4 -2
  39. package/lib/browser/model/debug-breakpoint.d.ts.map +1 -1
  40. package/lib/browser/model/debug-breakpoint.js +10 -2
  41. package/lib/browser/model/debug-breakpoint.js.map +1 -1
  42. package/lib/browser/model/debug-data-breakpoint.d.ts +2 -0
  43. package/lib/browser/model/debug-data-breakpoint.d.ts.map +1 -1
  44. package/lib/browser/model/debug-data-breakpoint.js +16 -5
  45. package/lib/browser/model/debug-data-breakpoint.js.map +1 -1
  46. package/lib/browser/model/debug-function-breakpoint.d.ts +3 -0
  47. package/lib/browser/model/debug-function-breakpoint.d.ts.map +1 -1
  48. package/lib/browser/model/debug-function-breakpoint.js +17 -1
  49. package/lib/browser/model/debug-function-breakpoint.js.map +1 -1
  50. package/lib/browser/model/debug-instruction-breakpoint.d.ts +2 -0
  51. package/lib/browser/model/debug-instruction-breakpoint.d.ts.map +1 -1
  52. package/lib/browser/model/debug-instruction-breakpoint.js +13 -1
  53. package/lib/browser/model/debug-instruction-breakpoint.js.map +1 -1
  54. package/lib/browser/model/debug-source-breakpoint.d.ts +6 -1
  55. package/lib/browser/model/debug-source-breakpoint.d.ts.map +1 -1
  56. package/lib/browser/model/debug-source-breakpoint.js +17 -1
  57. package/lib/browser/model/debug-source-breakpoint.js.map +1 -1
  58. package/lib/browser/model/debug-stack-frame.d.ts +2 -2
  59. package/lib/browser/model/debug-stack-frame.d.ts.map +1 -1
  60. package/lib/browser/model/debug-stack-frame.js +13 -5
  61. package/lib/browser/model/debug-stack-frame.js.map +1 -1
  62. package/lib/browser/model/debug-thread.d.ts +2 -2
  63. package/lib/browser/model/debug-thread.d.ts.map +1 -1
  64. package/lib/browser/model/debug-thread.js +13 -9
  65. package/lib/browser/model/debug-thread.js.map +1 -1
  66. package/lib/browser/view/debug-action.d.ts +1 -0
  67. package/lib/browser/view/debug-action.d.ts.map +1 -1
  68. package/lib/browser/view/debug-action.js +2 -2
  69. package/lib/browser/view/debug-action.js.map +1 -1
  70. package/lib/browser/view/debug-breakpoints-source.d.ts +2 -0
  71. package/lib/browser/view/debug-breakpoints-source.d.ts.map +1 -1
  72. package/lib/browser/view/debug-breakpoints-source.js +6 -1
  73. package/lib/browser/view/debug-breakpoints-source.js.map +1 -1
  74. package/lib/browser/view/debug-configuration-widget.js +2 -2
  75. package/lib/browser/view/debug-configuration-widget.js.map +1 -1
  76. package/lib/browser/view/debug-exception-breakpoint.d.ts +9 -2
  77. package/lib/browser/view/debug-exception-breakpoint.d.ts.map +1 -1
  78. package/lib/browser/view/debug-exception-breakpoint.js +26 -5
  79. package/lib/browser/view/debug-exception-breakpoint.js.map +1 -1
  80. package/lib/browser/view/debug-session-widget.d.ts +0 -1
  81. package/lib/browser/view/debug-session-widget.d.ts.map +1 -1
  82. package/lib/browser/view/debug-session-widget.js +0 -4
  83. package/lib/browser/view/debug-session-widget.js.map +1 -1
  84. package/lib/browser/view/debug-threads-widget.d.ts +6 -1
  85. package/lib/browser/view/debug-threads-widget.d.ts.map +1 -1
  86. package/lib/browser/view/debug-threads-widget.js +69 -5
  87. package/lib/browser/view/debug-threads-widget.js.map +1 -1
  88. package/lib/browser/view/debug-toolbar-widget.d.ts +5 -18
  89. package/lib/browser/view/debug-toolbar-widget.d.ts.map +1 -1
  90. package/lib/browser/view/debug-toolbar-widget.js +14 -58
  91. package/lib/browser/view/debug-toolbar-widget.js.map +1 -1
  92. package/lib/browser/view/debug-variables-source.d.ts.map +1 -1
  93. package/lib/browser/view/debug-variables-source.js +1 -0
  94. package/lib/browser/view/debug-variables-source.js.map +1 -1
  95. package/lib/browser/view/debug-variables-widget.d.ts +15 -0
  96. package/lib/browser/view/debug-variables-widget.d.ts.map +1 -1
  97. package/lib/browser/view/debug-variables-widget.js +56 -1
  98. package/lib/browser/view/debug-variables-widget.js.map +1 -1
  99. package/lib/browser/view/debug-view-model.d.ts +4 -0
  100. package/lib/browser/view/debug-view-model.d.ts.map +1 -1
  101. package/lib/browser/view/debug-view-model.js +18 -9
  102. package/lib/browser/view/debug-view-model.js.map +1 -1
  103. package/lib/browser/view/debug-watch-expression.d.ts.map +1 -1
  104. package/lib/browser/view/debug-watch-expression.js +4 -5
  105. package/lib/browser/view/debug-watch-expression.js.map +1 -1
  106. package/lib/browser/view/debug-watch-source.d.ts.map +1 -1
  107. package/lib/browser/view/debug-watch-source.js +1 -0
  108. package/lib/browser/view/debug-watch-source.js.map +1 -1
  109. package/lib/common/debug-preferences.d.ts +1 -0
  110. package/lib/common/debug-preferences.d.ts.map +1 -1
  111. package/lib/common/debug-preferences.js +11 -1
  112. package/lib/common/debug-preferences.js.map +1 -1
  113. package/package.json +16 -16
  114. package/src/browser/breakpoint/breakpoint-manager.ts +1 -1
  115. package/src/browser/console/debug-console-items.tsx +90 -21
  116. package/src/browser/console/debug-console-session.ts +1 -0
  117. package/src/browser/debug-commands.ts +402 -0
  118. package/src/browser/debug-frontend-application-contribution.ts +35 -410
  119. package/src/browser/debug-prefix-configuration.ts +1 -1
  120. package/src/browser/debug-session-contribution.ts +7 -2
  121. package/src/browser/debug-session-manager.ts +62 -9
  122. package/src/browser/debug-session.tsx +17 -4
  123. package/src/browser/editor/debug-hover-source.tsx +6 -2
  124. package/src/browser/editor/debug-inline-value-decorator.ts +1 -1
  125. package/src/browser/model/debug-breakpoint.tsx +12 -3
  126. package/src/browser/model/debug-data-breakpoint.tsx +21 -6
  127. package/src/browser/model/debug-function-breakpoint.tsx +22 -1
  128. package/src/browser/model/debug-instruction-breakpoint.tsx +16 -1
  129. package/src/browser/model/debug-source-breakpoint.tsx +24 -3
  130. package/src/browser/model/debug-stack-frame.tsx +13 -6
  131. package/src/browser/model/debug-thread.tsx +14 -10
  132. package/src/browser/style/index.css +30 -5
  133. package/src/browser/view/debug-action.tsx +3 -2
  134. package/src/browser/view/debug-breakpoints-source.tsx +5 -1
  135. package/src/browser/view/debug-configuration-widget.tsx +1 -1
  136. package/src/browser/view/debug-exception-breakpoint.tsx +30 -5
  137. package/src/browser/view/debug-session-widget.ts +0 -5
  138. package/src/browser/view/debug-threads-widget.ts +84 -6
  139. package/src/browser/view/debug-toolbar-widget.tsx +13 -60
  140. package/src/browser/view/debug-variables-source.ts +1 -0
  141. package/src/browser/view/debug-variables-widget.ts +59 -0
  142. package/src/browser/view/debug-view-model.ts +20 -8
  143. package/src/browser/view/debug-watch-expression.tsx +5 -6
  144. package/src/browser/view/debug-watch-source.ts +1 -0
  145. package/src/common/debug-preferences.ts +12 -1
@@ -20,7 +20,7 @@ import {
20
20
  import { TreeElementNode } from '@theia/core/lib/browser/source-tree';
21
21
  import { injectable, inject } from '@theia/core/shared/inversify';
22
22
  import * as monaco from '@theia/monaco-editor-core';
23
- import { MenuModelRegistry, CommandRegistry, MAIN_MENU_BAR, Command, Emitter, Mutable, URI, Event, MessageService, CancellationError } from '@theia/core/lib/common';
23
+ import { MenuModelRegistry, CommandRegistry, Command, URI, Event, MessageService, CancellationError } from '@theia/core/lib/common';
24
24
  import { waitForEvent } from '@theia/core/lib/common/promise-util';
25
25
  import { EDITOR_CONTEXT_MENU, EDITOR_LINENUMBER_CONTEXT_MENU, EditorManager } from '@theia/editor/lib/browser';
26
26
  import { DebugSessionManager } from './debug-session-manager';
@@ -44,7 +44,7 @@ import { DebugConsoleContribution } from './console/debug-console-contribution';
44
44
  import { DebugService } from '../common/debug-service';
45
45
  import { DebugSchemaUpdater } from './debug-schema-updater';
46
46
  import { DebugPreferences } from '../common/debug-preferences';
47
- import { RenderedToolbarAction, TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
47
+ import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
48
48
  import { DebugWatchWidget } from './view/debug-watch-widget';
49
49
  import { DebugWatchExpression } from './view/debug-watch-expression';
50
50
  import { DebugWatchManager } from './debug-watch-manager';
@@ -64,387 +64,10 @@ import { ConsoleContextMenu } from '@theia/console/lib/browser/console-contribut
64
64
  import { DebugHoverWidget } from './editor/debug-hover-widget';
65
65
  import { DebugExpressionProvider } from './editor/debug-expression-provider';
66
66
  import { AddOrEditDataBreakpointAddress } from './breakpoint/debug-data-breakpoint-actions';
67
-
68
- export namespace DebugMenus {
69
- export const DEBUG = [...MAIN_MENU_BAR, '6_debug'];
70
- export const DEBUG_CONTROLS = [...DEBUG, 'a_controls'];
71
- export const DEBUG_CONFIGURATION = [...DEBUG, 'b_configuration'];
72
- export const DEBUG_THREADS = [...DEBUG, 'c_threads'];
73
- export const DEBUG_SESSIONS = [...DEBUG, 'd_sessions'];
74
- export const DEBUG_BREAKPOINT = [...DEBUG, 'e_breakpoint'];
75
- export const DEBUG_NEW_BREAKPOINT = [...DEBUG_BREAKPOINT, 'a_new_breakpoint'];
76
- export const DEBUG_BREAKPOINTS = [...DEBUG, 'f_breakpoints'];
77
- }
78
-
79
- function nlsEditBreakpoint(breakpoint: string): string {
80
- return nls.localizeByDefault('Edit {0}...', nls.localizeByDefault(breakpoint));
81
- }
82
-
83
- function nlsRemoveBreakpoint(breakpoint: string): string {
84
- return nls.localizeByDefault('Remove {0}', nls.localizeByDefault(breakpoint));
85
- }
86
-
87
- function nlsEnableBreakpoint(breakpoint: string): string {
88
- return nls.localizeByDefault('Enable {0}', nls.localizeByDefault(breakpoint));
89
- }
90
-
91
- function nlsDisableBreakpoint(breakpoint: string): string {
92
- return nls.localizeByDefault('Disable {0}', nls.localizeByDefault(breakpoint));
93
- }
94
-
95
- export namespace DebugCommands {
96
-
97
- export const DEBUG_CATEGORY = 'Debug';
98
- export const DEBUG_CATEGORY_KEY = nls.getDefaultKey(DEBUG_CATEGORY);
99
-
100
- export const START = Command.toDefaultLocalizedCommand({
101
- id: 'workbench.action.debug.start',
102
- category: DEBUG_CATEGORY,
103
- label: 'Start Debugging',
104
- iconClass: codicon('debug-alt')
105
- });
106
- export const START_NO_DEBUG = Command.toDefaultLocalizedCommand({
107
- id: 'workbench.action.debug.run',
108
- category: DEBUG_CATEGORY,
109
- label: 'Start Without Debugging'
110
- });
111
- export const STOP = Command.toDefaultLocalizedCommand({
112
- id: 'workbench.action.debug.stop',
113
- category: DEBUG_CATEGORY,
114
- label: 'Stop',
115
- iconClass: codicon('debug-stop')
116
- });
117
- export const RESTART = Command.toDefaultLocalizedCommand({
118
- id: 'workbench.action.debug.restart',
119
- category: DEBUG_CATEGORY,
120
- label: 'Restart',
121
- });
122
-
123
- export const OPEN_CONFIGURATIONS = Command.toDefaultLocalizedCommand({
124
- id: 'debug.configurations.open',
125
- category: DEBUG_CATEGORY,
126
- label: 'Open Configurations'
127
- });
128
- export const ADD_CONFIGURATION = Command.toDefaultLocalizedCommand({
129
- id: 'debug.configurations.add',
130
- category: DEBUG_CATEGORY,
131
- label: 'Add Configuration...'
132
- });
133
-
134
- export const STEP_OVER = Command.toDefaultLocalizedCommand({
135
- id: 'workbench.action.debug.stepOver',
136
- category: DEBUG_CATEGORY,
137
- label: 'Step Over',
138
- iconClass: codicon('debug-step-over')
139
- });
140
- export const STEP_INTO = Command.toDefaultLocalizedCommand({
141
- id: 'workbench.action.debug.stepInto',
142
- category: DEBUG_CATEGORY,
143
- label: 'Step Into',
144
- iconClass: codicon('debug-step-into')
145
- });
146
- export const STEP_OUT = Command.toDefaultLocalizedCommand({
147
- id: 'workbench.action.debug.stepOut',
148
- category: DEBUG_CATEGORY,
149
- label: 'Step Out',
150
- iconClass: codicon('debug-step-out')
151
- });
152
- export const CONTINUE = Command.toDefaultLocalizedCommand({
153
- id: 'workbench.action.debug.continue',
154
- category: DEBUG_CATEGORY,
155
- label: 'Continue',
156
- iconClass: codicon('debug-continue')
157
- });
158
- export const PAUSE = Command.toDefaultLocalizedCommand({
159
- id: 'workbench.action.debug.pause',
160
- category: DEBUG_CATEGORY,
161
- label: 'Pause',
162
- iconClass: codicon('debug-pause')
163
- });
164
- export const CONTINUE_ALL = Command.toLocalizedCommand({
165
- id: 'debug.thread.continue.all',
166
- category: DEBUG_CATEGORY,
167
- label: 'Continue All',
168
- iconClass: codicon('debug-continue')
169
- }, 'theia/debug/continueAll', DEBUG_CATEGORY_KEY);
170
- export const PAUSE_ALL = Command.toLocalizedCommand({
171
- id: 'debug.thread.pause.all',
172
- category: DEBUG_CATEGORY,
173
- label: 'Pause All',
174
- iconClass: codicon('debug-pause')
175
- }, 'theia/debug/pauseAll', DEBUG_CATEGORY_KEY);
176
-
177
- export const TOGGLE_BREAKPOINT = Command.toDefaultLocalizedCommand({
178
- id: 'editor.debug.action.toggleBreakpoint',
179
- category: DEBUG_CATEGORY,
180
- label: 'Toggle Breakpoint',
181
- });
182
- export const INLINE_BREAKPOINT = Command.toDefaultLocalizedCommand({
183
- id: 'editor.debug.action.inlineBreakpoint',
184
- category: DEBUG_CATEGORY,
185
- label: 'Inline Breakpoint',
186
- });
187
- export const ADD_CONDITIONAL_BREAKPOINT = Command.toDefaultLocalizedCommand({
188
- id: 'debug.breakpoint.add.conditional',
189
- category: DEBUG_CATEGORY,
190
- label: 'Add Conditional Breakpoint...',
191
- });
192
- export const ADD_LOGPOINT = Command.toDefaultLocalizedCommand({
193
- id: 'debug.breakpoint.add.logpoint',
194
- category: DEBUG_CATEGORY,
195
- label: 'Add Logpoint...',
196
- });
197
- export const ADD_FUNCTION_BREAKPOINT = Command.toDefaultLocalizedCommand({
198
- id: 'debug.breakpoint.add.function',
199
- category: DEBUG_CATEGORY,
200
- label: 'Add Function Breakpoint',
201
- });
202
- export const ADD_DATA_BREAKPOINT = Command.toDefaultLocalizedCommand({
203
- id: 'debug.breakpoint.add.data',
204
- category: DEBUG_CATEGORY,
205
- label: 'Add Data Breakpoint at Address'
206
- });
207
- export const ENABLE_SELECTED_BREAKPOINTS = Command.toLocalizedCommand({
208
- id: 'debug.breakpoint.enableSelected',
209
- category: DEBUG_CATEGORY,
210
- label: 'Enable Selected Breakpoints',
211
- }, 'theia/debug/enableSelectedBreakpoints', DEBUG_CATEGORY_KEY);
212
- export const ENABLE_ALL_BREAKPOINTS = Command.toDefaultLocalizedCommand({
213
- id: 'debug.breakpoint.enableAll',
214
- category: DEBUG_CATEGORY,
215
- label: 'Enable All Breakpoints',
216
- });
217
- export const DISABLE_SELECTED_BREAKPOINTS = Command.toLocalizedCommand({
218
- id: 'debug.breakpoint.disableSelected',
219
- category: DEBUG_CATEGORY,
220
- label: 'Disable Selected Breakpoints',
221
- }, 'theia/debug/disableSelectedBreakpoints', DEBUG_CATEGORY_KEY);
222
- export const DISABLE_ALL_BREAKPOINTS = Command.toDefaultLocalizedCommand({
223
- id: 'debug.breakpoint.disableAll',
224
- category: DEBUG_CATEGORY,
225
- label: 'Disable All Breakpoints',
226
- });
227
- export const EDIT_BREAKPOINT = Command.toLocalizedCommand({
228
- id: 'debug.breakpoint.edit',
229
- category: DEBUG_CATEGORY,
230
- originalLabel: 'Edit Breakpoint...',
231
- label: nlsEditBreakpoint('Breakpoint')
232
- }, '', DEBUG_CATEGORY_KEY);
233
- export const EDIT_LOGPOINT = Command.toLocalizedCommand({
234
- id: 'debug.logpoint.edit',
235
- category: DEBUG_CATEGORY,
236
- originalLabel: 'Edit Logpoint...',
237
- label: nlsEditBreakpoint('Logpoint')
238
- }, '', DEBUG_CATEGORY_KEY);
239
- export const EDIT_BREAKPOINT_CONDITION = Command.toLocalizedCommand({
240
- id: 'debug.breakpoint.editCondition',
241
- category: DEBUG_CATEGORY,
242
- label: 'Edit Condition...'
243
- }, '', DEBUG_CATEGORY_KEY);
244
- export const REMOVE_BREAKPOINT = Command.toLocalizedCommand({
245
- id: 'debug.breakpoint.remove',
246
- category: DEBUG_CATEGORY,
247
- originalLabel: 'Remove Breakpoint',
248
- label: nlsRemoveBreakpoint('Breakpoint')
249
- }, '', DEBUG_CATEGORY_KEY);
250
- export const REMOVE_LOGPOINT = Command.toLocalizedCommand({
251
- id: 'debug.logpoint.remove',
252
- category: DEBUG_CATEGORY,
253
- originalLabel: 'Remove Logpoint',
254
- label: nlsRemoveBreakpoint('Logpoint')
255
- }, '', DEBUG_CATEGORY_KEY);
256
- export const REMOVE_SELECTED_BREAKPOINTS = Command.toLocalizedCommand({
257
- id: 'debug.breakpoint.removeSelected',
258
- category: DEBUG_CATEGORY,
259
- label: 'Remove Selected Breakpoints',
260
- }, '', DEBUG_CATEGORY_KEY);
261
- export const REMOVE_ALL_BREAKPOINTS = Command.toDefaultLocalizedCommand({
262
- id: 'debug.breakpoint.removeAll',
263
- category: DEBUG_CATEGORY,
264
- label: 'Remove All Breakpoints',
265
- });
266
- export const TOGGLE_BREAKPOINTS_ENABLED = Command.toLocalizedCommand({
267
- id: 'debug.breakpoint.toggleEnabled'
268
- });
269
- export const SHOW_HOVER = Command.toDefaultLocalizedCommand({
270
- id: 'editor.debug.action.showDebugHover',
271
- label: 'Debug: Show Hover'
272
- });
273
- export const EVALUATE_IN_DEBUG_CONSOLE = Command.toDefaultLocalizedCommand({
274
- id: 'editor.debug.action.selectionToRepl',
275
- category: DEBUG_CATEGORY,
276
- label: 'Evaluate in Debug Console'
277
- });
278
- export const ADD_TO_WATCH = Command.toDefaultLocalizedCommand({
279
- id: 'editor.debug.action.selectionToWatch',
280
- category: DEBUG_CATEGORY,
281
- label: 'Add to Watch'
282
- });
283
- export const JUMP_TO_CURSOR = Command.toDefaultLocalizedCommand({
284
- id: 'editor.debug.action.jumpToCursor',
285
- category: DEBUG_CATEGORY,
286
- label: 'Jump to Cursor'
287
- });
288
- export const RUN_TO_CURSOR = Command.toDefaultLocalizedCommand({
289
- id: 'editor.debug.action.runToCursor',
290
- category: DEBUG_CATEGORY,
291
- label: 'Run to Cursor'
292
- });
293
- export const RUN_TO_LINE = Command.toDefaultLocalizedCommand({
294
- id: 'editor.debug.action.runToLine',
295
- category: DEBUG_CATEGORY,
296
- label: 'Run to Line'
297
- });
298
-
299
- export const RESTART_FRAME = Command.toDefaultLocalizedCommand({
300
- id: 'debug.frame.restart',
301
- category: DEBUG_CATEGORY,
302
- label: 'Restart Frame',
303
- });
304
- export const COPY_CALL_STACK = Command.toDefaultLocalizedCommand({
305
- id: 'debug.callStack.copy',
306
- category: DEBUG_CATEGORY,
307
- label: 'Copy Call Stack',
308
- });
309
-
310
- export const SET_VARIABLE_VALUE = Command.toDefaultLocalizedCommand({
311
- id: 'debug.variable.setValue',
312
- category: DEBUG_CATEGORY,
313
- label: 'Set Value',
314
- });
315
- export const COPY_VARIABLE_VALUE = Command.toDefaultLocalizedCommand({
316
- id: 'debug.variable.copyValue',
317
- category: DEBUG_CATEGORY,
318
- label: 'Copy Value',
319
- });
320
- export const COPY_VARIABLE_AS_EXPRESSION = Command.toDefaultLocalizedCommand({
321
- id: 'debug.variable.copyAsExpression',
322
- category: DEBUG_CATEGORY,
323
- label: 'Copy as Expression',
324
- });
325
- export const WATCH_VARIABLE = Command.toDefaultLocalizedCommand({
326
- id: 'debug.variable.watch',
327
- category: DEBUG_CATEGORY,
328
- label: 'Add to Watch',
329
- });
330
-
331
- export const ADD_WATCH_EXPRESSION = Command.toDefaultLocalizedCommand({
332
- id: 'debug.watch.addExpression',
333
- category: DEBUG_CATEGORY,
334
- label: 'Add Expression'
335
- });
336
- export const EDIT_WATCH_EXPRESSION = Command.toDefaultLocalizedCommand({
337
- id: 'debug.watch.editExpression',
338
- category: DEBUG_CATEGORY,
339
- label: 'Edit Expression'
340
- });
341
- export const COPY_WATCH_EXPRESSION_VALUE = Command.toLocalizedCommand({
342
- id: 'debug.watch.copyExpressionValue',
343
- category: DEBUG_CATEGORY,
344
- label: 'Copy Expression Value'
345
- }, 'theia/debug/copyExpressionValue', DEBUG_CATEGORY_KEY);
346
- export const REMOVE_WATCH_EXPRESSION = Command.toDefaultLocalizedCommand({
347
- id: 'debug.watch.removeExpression',
348
- category: DEBUG_CATEGORY,
349
- label: 'Remove Expression'
350
- });
351
- export const COLLAPSE_ALL_WATCH_EXPRESSIONS = Command.toDefaultLocalizedCommand({
352
- id: 'debug.watch.collapseAllExpressions',
353
- category: DEBUG_CATEGORY,
354
- label: 'Collapse All'
355
- });
356
- export const REMOVE_ALL_WATCH_EXPRESSIONS = Command.toDefaultLocalizedCommand({
357
- id: 'debug.watch.removeAllExpressions',
358
- category: DEBUG_CATEGORY,
359
- label: 'Remove All Expressions'
360
- });
361
- }
362
- export namespace DebugThreadContextCommands {
363
- export const STEP_OVER = {
364
- id: 'debug.thread.context.context.next'
365
- };
366
- export const STEP_INTO = {
367
- id: 'debug.thread.context.stepin'
368
- };
369
- export const STEP_OUT = {
370
- id: 'debug.thread.context.stepout'
371
- };
372
- export const CONTINUE = {
373
- id: 'debug.thread.context.continue'
374
- };
375
- export const PAUSE = {
376
- id: 'debug.thread.context.pause'
377
- };
378
- export const TERMINATE = {
379
- id: 'debug.thread.context.terminate'
380
- };
381
- }
382
- export namespace DebugSessionContextCommands {
383
- export const STOP = {
384
- id: 'debug.session.context.stop'
385
- };
386
- export const RESTART = {
387
- id: 'debug.session.context.restart'
388
- };
389
- export const PAUSE_ALL = {
390
- id: 'debug.session.context.pauseAll'
391
- };
392
- export const CONTINUE_ALL = {
393
- id: 'debug.session.context.continueAll'
394
- };
395
- export const REVEAL = {
396
- id: 'debug.session.context.reveal'
397
- };
398
- }
399
- export namespace DebugEditorContextCommands {
400
- export const ADD_BREAKPOINT = {
401
- id: 'debug.editor.context.addBreakpoint'
402
- };
403
- export const ADD_CONDITIONAL_BREAKPOINT = {
404
- id: 'debug.editor.context.addBreakpoint.conditional'
405
- };
406
- export const ADD_LOGPOINT = {
407
- id: 'debug.editor.context.add.logpoint'
408
- };
409
- export const REMOVE_BREAKPOINT = {
410
- id: 'debug.editor.context.removeBreakpoint'
411
- };
412
- export const EDIT_BREAKPOINT = {
413
- id: 'debug.editor.context.edit.breakpoint'
414
- };
415
- export const ENABLE_BREAKPOINT = {
416
- id: 'debug.editor.context.enableBreakpoint'
417
- };
418
- export const DISABLE_BREAKPOINT = {
419
- id: 'debug.editor.context.disableBreakpoint'
420
- };
421
- export const REMOVE_LOGPOINT = {
422
- id: 'debug.editor.context.logpoint.remove'
423
- };
424
- export const EDIT_LOGPOINT = {
425
- id: 'debug.editor.context.logpoint.edit'
426
- };
427
- export const ENABLE_LOGPOINT = {
428
- id: 'debug.editor.context.logpoint.enable'
429
- };
430
- export const DISABLE_LOGPOINT = {
431
- id: 'debug.editor.context.logpoint.disable'
432
- };
433
- export const JUMP_TO_CURSOR = {
434
- id: 'debug.editor.context.jumpToCursor'
435
- };
436
- export const RUN_TO_LINE = {
437
- id: 'debug.editor.context.runToLine'
438
- };
439
- }
440
- export namespace DebugBreakpointWidgetCommands {
441
- export const ACCEPT = {
442
- id: 'debug.breakpointWidget.accept'
443
- };
444
- export const CLOSE = {
445
- id: 'debug.breakpointWidget.close'
446
- };
447
- }
67
+ import {
68
+ DebugMenus, DebugCommands, DebugThreadContextCommands, DebugSessionContextCommands,
69
+ DebugEditorContextCommands, DebugBreakpointWidgetCommands, nlsEnableBreakpoint, nlsDisableBreakpoint
70
+ } from './debug-commands';
448
71
 
449
72
  @injectable()
450
73
  export class DebugFrontendApplicationContribution extends AbstractViewContribution<DebugWidget>
@@ -577,7 +200,7 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
577
200
 
578
201
  override registerMenus(menus: MenuModelRegistry): void {
579
202
  super.registerMenus(menus);
580
- const registerMenuActions = (menuPath: string[], ...commands: (Command & { order?: string })[]) => {
203
+ const registerMenuActions = (menuPath: string[], ...commands: (Command & { order?: string, when?: string })[]) => {
581
204
  for (const [index, command] of commands.entries()) {
582
205
  const label = command.label;
583
206
  const debug = `${DebugCommands.DEBUG_CATEGORY}:`;
@@ -585,6 +208,7 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
585
208
  commandId: command.id,
586
209
  label: label && label.startsWith(debug) && label.slice(debug.length).trimStart() || label,
587
210
  icon: command.iconClass,
211
+ when: command.when,
588
212
  order: command.order || String.fromCharCode('a'.charCodeAt(0) + index)
589
213
  });
590
214
  }
@@ -727,6 +351,15 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
727
351
  menus.linkCompoundMenuNode({ newParentPath: EDITOR_LINENUMBER_CONTEXT_MENU, submenuPath: DebugEditorModel.CONTEXT_MENU });
728
352
 
729
353
  menus.registerSubmenu(DebugToolBar.MENU, nls.localize('theia/debug/debugToolbarMenu', 'Debug Toolbar Menu'));
354
+ registerMenuActions(DebugToolBar.CONTROLS,
355
+ { ...DebugCommands.CONTINUE, when: 'debugState == stopped' },
356
+ { ...DebugCommands.PAUSE, when: 'debugState != stopped' },
357
+ DebugCommands.STEP_OVER,
358
+ DebugCommands.STEP_INTO,
359
+ DebugCommands.STEP_OUT,
360
+ DebugCommands.RESTART,
361
+ DebugCommands.STOP
362
+ );
730
363
  }
731
364
 
732
365
  override registerCommands(registry: CommandRegistry): void {
@@ -895,15 +528,17 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
895
528
  });
896
529
  registry.registerCommand(DebugCommands.EDIT_BREAKPOINT, {
897
530
  execute: async () => {
898
- const { selectedBreakpoint, selectedFunctionBreakpoint } = this;
531
+ const { selectedBreakpoint, selectedFunctionBreakpoint, selectedLogpoint } = this;
899
532
  if (selectedBreakpoint) {
900
533
  await this.editors.editBreakpoint(selectedBreakpoint);
901
534
  } else if (selectedFunctionBreakpoint) {
902
535
  await selectedFunctionBreakpoint.open();
536
+ } else if (selectedLogpoint) {
537
+ await this.editors.editBreakpoint(selectedLogpoint);
903
538
  }
904
539
  },
905
- isEnabled: () => this.selectedBreakpoints.length === 1 && (!!this.selectedBreakpoint || !!this.selectedFunctionBreakpoint),
906
- isVisible: () => this.selectedBreakpoints.length === 1 && (!!this.selectedBreakpoint || !!this.selectedFunctionBreakpoint)
540
+ isEnabled: () => this.selectedBreakpoints.length === 1 && (!!this.selectedBreakpoint || !!this.selectedFunctionBreakpoint || !!this.selectedLogpoint),
541
+ isVisible: () => this.selectedBreakpoints.length === 1 && (!!this.selectedBreakpoint || !!this.selectedFunctionBreakpoint || !!this.selectedLogpoint)
907
542
  });
908
543
  registry.registerCommand(DebugCommands.EDIT_LOGPOINT, {
909
544
  execute: async () => {
@@ -922,8 +557,8 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
922
557
  await selectedExceptionBreakpoint.editCondition();
923
558
  }
924
559
  },
925
- isEnabled: () => this.selectedBreakpoints.length === 1 && !!this.selectedExceptionBreakpoint?.data.raw.supportsCondition,
926
- isVisible: () => this.selectedBreakpoints.length === 1 && !!this.selectedExceptionBreakpoint?.data.raw.supportsCondition
560
+ isEnabled: () => !!this.selectedExceptionBreakpoint?.data.raw.supportsCondition,
561
+ isVisible: () => !!this.selectedExceptionBreakpoint?.data.raw.supportsCondition
927
562
  });
928
563
  registry.registerCommand(DebugCommands.REMOVE_BREAKPOINT, {
929
564
  execute: () => {
@@ -1303,23 +938,6 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1303
938
  }
1304
939
 
1305
940
  registerToolbarItems(toolbar: TabBarToolbarRegistry): void {
1306
- const onDidChangeToggleBreakpointsEnabled = new Emitter<void>();
1307
- const toggleBreakpointsEnabled: Mutable<RenderedToolbarAction> = {
1308
- id: DebugCommands.TOGGLE_BREAKPOINTS_ENABLED.id,
1309
- command: DebugCommands.TOGGLE_BREAKPOINTS_ENABLED.id,
1310
- icon: codicon('activate-breakpoints'),
1311
- onDidChange: onDidChangeToggleBreakpointsEnabled.event,
1312
- priority: 1
1313
- };
1314
- const updateToggleBreakpointsEnabled = () => {
1315
- const activateBreakpoints = nls.localizeByDefault('Enable All Breakpoints');
1316
- const deactivateBreakpoints = nls.localizeByDefault('Disable All Breakpoints');
1317
- const tooltip = this.breakpointManager.breakpointsEnabled ? deactivateBreakpoints : activateBreakpoints;
1318
- if (toggleBreakpointsEnabled.tooltip !== tooltip) {
1319
- toggleBreakpointsEnabled.tooltip = tooltip;
1320
- onDidChangeToggleBreakpointsEnabled.fire(undefined);
1321
- }
1322
- };
1323
941
  toolbar.registerItem({
1324
942
  id: DebugCommands.ADD_FUNCTION_BREAKPOINT.id,
1325
943
  command: DebugCommands.ADD_FUNCTION_BREAKPOINT.id,
@@ -1333,9 +951,12 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1333
951
  tooltip: DebugCommands.ADD_DATA_BREAKPOINT.label,
1334
952
  onDidChange: this.manager.onDidStopDebugSession as unknown as Event<void>
1335
953
  });
1336
- updateToggleBreakpointsEnabled();
1337
- this.breakpointManager.onDidChangeBreakpoints(updateToggleBreakpointsEnabled);
1338
- toolbar.registerItem(toggleBreakpointsEnabled);
954
+ toolbar.registerItem({
955
+ id: DebugCommands.TOGGLE_BREAKPOINTS_ENABLED.id,
956
+ command: DebugCommands.TOGGLE_BREAKPOINTS_ENABLED.id,
957
+ icon: codicon('activate-breakpoints'),
958
+ priority: 1
959
+ });
1339
960
  toolbar.registerItem({
1340
961
  id: DebugCommands.REMOVE_ALL_BREAKPOINTS.id,
1341
962
  command: DebugCommands.REMOVE_ALL_BREAKPOINTS.id,
@@ -1376,7 +997,11 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1376
997
  ...options
1377
998
  };
1378
999
  const debugWidget = await this.openView({ reveal });
1379
- debugWidget.sessionManager.currentSession = session;
1000
+ // Only switch to this session if it has a stopped thread
1001
+ // Don't switch to background sessions that are just starting up
1002
+ if (session.currentThread && session.currentThread.stopped) {
1003
+ debugWidget.sessionManager.currentSession = session;
1004
+ }
1380
1005
  return debugWidget['sessionWidget'];
1381
1006
  }
1382
1007
 
@@ -18,7 +18,7 @@ import { inject, injectable, optional, postConstruct } from '@theia/core/shared/
18
18
  import { Command, CommandContribution, CommandHandler, CommandRegistry } from '@theia/core/lib/common/command';
19
19
  import { DebugSessionManager } from './debug-session-manager';
20
20
  import { DebugConfigurationManager } from './debug-configuration-manager';
21
- import { DebugCommands } from './debug-frontend-application-contribution';
21
+ import { DebugCommands } from './debug-commands';
22
22
  import { DebugSessionOptions } from './debug-session-options';
23
23
  import { WorkspaceService } from '@theia/workspace/lib/browser';
24
24
  import { LabelProvider } from '@theia/core/lib/browser/label-provider';
@@ -15,7 +15,7 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import { injectable, inject, named, postConstruct } from '@theia/core/shared/inversify';
18
- import { MessageClient } from '@theia/core/lib/common';
18
+ import { CommandService, MessageClient } from '@theia/core/lib/common';
19
19
  import { LabelProvider } from '@theia/core/lib/browser';
20
20
  import { EditorManager } from '@theia/editor/lib/browser';
21
21
  import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
@@ -121,6 +121,8 @@ export class DefaultDebugSessionFactory implements DebugSessionFactory {
121
121
  protected readonly testService: TestService;
122
122
  @inject(WorkspaceService)
123
123
  protected readonly workspaceService: WorkspaceService;
124
+ @inject(CommandService)
125
+ protected commandService: CommandService;
124
126
 
125
127
  get(manager: DebugSessionManager, sessionId: string, options: DebugConfigurationSessionOptions, parentSession?: DebugSession): DebugSession {
126
128
  const connection = new DebugSessionConnection(
@@ -146,7 +148,10 @@ export class DefaultDebugSessionFactory implements DebugSessionFactory {
146
148
  this.messages,
147
149
  this.fileService,
148
150
  this.debugContributionProvider,
149
- this.workspaceService);
151
+ this.workspaceService,
152
+ this.debugPreferences,
153
+ this.commandService
154
+ );
150
155
  }
151
156
 
152
157
  protected getTraceOutputChannel(): OutputChannel | undefined {