@theia/debug 1.18.0 → 1.21.0-next.12

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 (168) hide show
  1. package/lib/browser/console/debug-console-contribution.d.ts +1 -0
  2. package/lib/browser/console/debug-console-contribution.d.ts.map +1 -1
  3. package/lib/browser/console/debug-console-contribution.js +8 -6
  4. package/lib/browser/console/debug-console-contribution.js.map +1 -1
  5. package/lib/browser/console/debug-console-session.d.ts +1 -1
  6. package/lib/browser/console/debug-console-session.js +2 -2
  7. package/lib/browser/console/debug-console-session.js.map +1 -1
  8. package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
  9. package/lib/browser/debug-configuration-manager.js +8 -7
  10. package/lib/browser/debug-configuration-manager.js.map +1 -1
  11. package/lib/browser/debug-frontend-application-contribution.d.ts +5 -12
  12. package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
  13. package/lib/browser/debug-frontend-application-contribution.js +139 -112
  14. package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
  15. package/lib/browser/debug-preferences.d.ts +1 -0
  16. package/lib/browser/debug-preferences.d.ts.map +1 -1
  17. package/lib/browser/debug-preferences.js +22 -6
  18. package/lib/browser/debug-preferences.js.map +1 -1
  19. package/lib/browser/debug-prefix-configuration.d.ts.map +1 -1
  20. package/lib/browser/debug-prefix-configuration.js +3 -3
  21. package/lib/browser/debug-prefix-configuration.js.map +1 -1
  22. package/lib/browser/debug-session-connection.d.ts +23 -18
  23. package/lib/browser/debug-session-connection.d.ts.map +1 -1
  24. package/lib/browser/debug-session-connection.js +86 -65
  25. package/lib/browser/debug-session-connection.js.map +1 -1
  26. package/lib/browser/debug-session-contribution.d.ts +1 -1
  27. package/lib/browser/debug-session-contribution.d.ts.map +1 -1
  28. package/lib/browser/debug-session-contribution.js +1 -1
  29. package/lib/browser/debug-session-contribution.js.map +1 -1
  30. package/lib/browser/debug-session-manager.d.ts +6 -14
  31. package/lib/browser/debug-session-manager.d.ts.map +1 -1
  32. package/lib/browser/debug-session-manager.js +41 -44
  33. package/lib/browser/debug-session-manager.js.map +1 -1
  34. package/lib/browser/debug-session.d.ts +9 -8
  35. package/lib/browser/debug-session.d.ts.map +1 -1
  36. package/lib/browser/debug-session.js +55 -58
  37. package/lib/browser/debug-session.js.map +1 -1
  38. package/lib/browser/model/debug-function-breakpoint.d.ts.map +1 -1
  39. package/lib/browser/model/debug-function-breakpoint.js +4 -3
  40. package/lib/browser/model/debug-function-breakpoint.js.map +1 -1
  41. package/lib/browser/preferences/launch-preferences.d.ts.map +1 -1
  42. package/lib/browser/preferences/launch-preferences.js +2 -1
  43. package/lib/browser/preferences/launch-preferences.js.map +1 -1
  44. package/lib/browser/view/debug-breakpoints-source.d.ts +0 -1
  45. package/lib/browser/view/debug-breakpoints-source.d.ts.map +1 -1
  46. package/lib/browser/view/debug-breakpoints-source.js +1 -7
  47. package/lib/browser/view/debug-breakpoints-source.js.map +1 -1
  48. package/lib/browser/view/debug-breakpoints-widget.d.ts.map +1 -1
  49. package/lib/browser/view/debug-breakpoints-widget.js +2 -1
  50. package/lib/browser/view/debug-breakpoints-widget.js.map +1 -1
  51. package/lib/browser/view/debug-configuration-widget.d.ts +1 -1
  52. package/lib/browser/view/debug-configuration-widget.d.ts.map +1 -1
  53. package/lib/browser/view/debug-configuration-widget.js +8 -8
  54. package/lib/browser/view/debug-configuration-widget.js.map +1 -1
  55. package/lib/browser/view/debug-session-widget.d.ts +2 -1
  56. package/lib/browser/view/debug-session-widget.d.ts.map +1 -1
  57. package/lib/browser/view/debug-session-widget.js +12 -6
  58. package/lib/browser/view/debug-session-widget.js.map +1 -1
  59. package/lib/browser/view/debug-stack-frames-source.d.ts +0 -1
  60. package/lib/browser/view/debug-stack-frames-source.d.ts.map +1 -1
  61. package/lib/browser/view/debug-stack-frames-source.js +2 -5
  62. package/lib/browser/view/debug-stack-frames-source.js.map +1 -1
  63. package/lib/browser/view/debug-stack-frames-widget.d.ts.map +1 -1
  64. package/lib/browser/view/debug-stack-frames-widget.js +2 -1
  65. package/lib/browser/view/debug-stack-frames-widget.js.map +1 -1
  66. package/lib/browser/view/debug-threads-source.d.ts +0 -1
  67. package/lib/browser/view/debug-threads-source.d.ts.map +1 -1
  68. package/lib/browser/view/debug-threads-source.js +1 -7
  69. package/lib/browser/view/debug-threads-source.js.map +1 -1
  70. package/lib/browser/view/debug-threads-widget.d.ts.map +1 -1
  71. package/lib/browser/view/debug-threads-widget.js +2 -1
  72. package/lib/browser/view/debug-threads-widget.js.map +1 -1
  73. package/lib/browser/view/debug-toolbar-widget.d.ts.map +1 -1
  74. package/lib/browser/view/debug-toolbar-widget.js +9 -8
  75. package/lib/browser/view/debug-toolbar-widget.js.map +1 -1
  76. package/lib/browser/view/debug-variables-source.d.ts +0 -1
  77. package/lib/browser/view/debug-variables-source.d.ts.map +1 -1
  78. package/lib/browser/view/debug-variables-source.js +2 -5
  79. package/lib/browser/view/debug-variables-source.js.map +1 -1
  80. package/lib/browser/view/debug-variables-widget.d.ts.map +1 -1
  81. package/lib/browser/view/debug-variables-widget.js +2 -1
  82. package/lib/browser/view/debug-variables-widget.js.map +1 -1
  83. package/lib/browser/view/debug-view-model.js +3 -3
  84. package/lib/browser/view/debug-view-model.js.map +1 -1
  85. package/lib/browser/view/debug-watch-source.d.ts +0 -1
  86. package/lib/browser/view/debug-watch-source.d.ts.map +1 -1
  87. package/lib/browser/view/debug-watch-source.js +2 -5
  88. package/lib/browser/view/debug-watch-source.js.map +1 -1
  89. package/lib/browser/view/debug-watch-widget.d.ts.map +1 -1
  90. package/lib/browser/view/debug-watch-widget.js +2 -1
  91. package/lib/browser/view/debug-watch-widget.js.map +1 -1
  92. package/lib/browser/view/debug-widget.d.ts.map +1 -1
  93. package/lib/browser/view/debug-widget.js +2 -1
  94. package/lib/browser/view/debug-widget.js.map +1 -1
  95. package/lib/common/debug-service.d.ts +10 -0
  96. package/lib/common/debug-service.d.ts.map +1 -1
  97. package/lib/node/debug-adapter-contribution-registry.d.ts +1 -1
  98. package/lib/node/debug-adapter-contribution-registry.d.ts.map +1 -1
  99. package/lib/node/debug-adapter-contribution-registry.js +1 -1
  100. package/lib/node/debug-adapter-contribution-registry.js.map +1 -1
  101. package/lib/node/debug-adapter-factory.d.ts +4 -4
  102. package/lib/node/debug-adapter-factory.d.ts.map +1 -1
  103. package/lib/node/debug-adapter-factory.js +10 -12
  104. package/lib/node/debug-adapter-factory.js.map +1 -1
  105. package/lib/node/debug-adapter-session-manager.d.ts +1 -1
  106. package/lib/node/debug-adapter-session-manager.d.ts.map +1 -1
  107. package/lib/node/debug-adapter-session-manager.js +1 -2
  108. package/lib/node/debug-adapter-session-manager.js.map +1 -1
  109. package/lib/node/debug-adapter-session.d.ts +7 -13
  110. package/lib/node/debug-adapter-session.d.ts.map +1 -1
  111. package/lib/node/debug-adapter-session.js +25 -68
  112. package/lib/node/debug-adapter-session.js.map +1 -1
  113. package/lib/node/debug-backend-module.js +1 -1
  114. package/lib/node/debug-backend-module.js.map +1 -1
  115. package/lib/{common → node}/debug-model.d.ts +37 -19
  116. package/lib/node/debug-model.d.ts.map +1 -0
  117. package/lib/{common → node}/debug-model.js +0 -0
  118. package/lib/node/debug-model.js.map +1 -0
  119. package/lib/node/inline-debug-adapter.d.ts +34 -0
  120. package/lib/node/inline-debug-adapter.d.ts.map +1 -0
  121. package/lib/node/inline-debug-adapter.js +45 -0
  122. package/lib/node/inline-debug-adapter.js.map +1 -0
  123. package/lib/node/stream-debug-adapter.d.ts +52 -0
  124. package/lib/node/stream-debug-adapter.d.ts.map +1 -0
  125. package/lib/node/stream-debug-adapter.js +113 -0
  126. package/lib/node/stream-debug-adapter.js.map +1 -0
  127. package/lib/node/vscode/vscode-debug-adapter-contribution.d.ts +1 -1
  128. package/lib/node/vscode/vscode-debug-adapter-contribution.d.ts.map +1 -1
  129. package/package.json +17 -17
  130. package/src/browser/console/debug-console-contribution.tsx +9 -6
  131. package/src/browser/console/debug-console-session.ts +2 -2
  132. package/src/browser/debug-configuration-manager.ts +10 -8
  133. package/src/browser/debug-frontend-application-contribution.ts +160 -125
  134. package/src/browser/debug-preferences.ts +23 -6
  135. package/src/browser/debug-prefix-configuration.ts +4 -4
  136. package/src/browser/debug-session-connection.ts +102 -76
  137. package/src/browser/debug-session-contribution.ts +3 -4
  138. package/src/browser/debug-session-manager.ts +45 -47
  139. package/src/browser/debug-session.tsx +54 -57
  140. package/src/browser/model/debug-function-breakpoint.tsx +4 -3
  141. package/src/browser/preferences/launch-preferences.ts +2 -1
  142. package/src/browser/view/debug-breakpoints-source.tsx +0 -6
  143. package/src/browser/view/debug-breakpoints-widget.ts +2 -1
  144. package/src/browser/view/debug-configuration-widget.tsx +8 -7
  145. package/src/browser/view/debug-session-widget.ts +12 -6
  146. package/src/browser/view/debug-stack-frames-source.tsx +0 -6
  147. package/src/browser/view/debug-stack-frames-widget.ts +2 -1
  148. package/src/browser/view/debug-threads-source.tsx +0 -6
  149. package/src/browser/view/debug-threads-widget.ts +2 -1
  150. package/src/browser/view/debug-toolbar-widget.tsx +13 -8
  151. package/src/browser/view/debug-variables-source.ts +0 -6
  152. package/src/browser/view/debug-variables-widget.ts +2 -1
  153. package/src/browser/view/debug-view-model.ts +3 -3
  154. package/src/browser/view/debug-watch-source.ts +0 -6
  155. package/src/browser/view/debug-watch-widget.ts +2 -1
  156. package/src/browser/view/debug-widget.ts +2 -1
  157. package/src/common/debug-service.ts +13 -0
  158. package/src/node/debug-adapter-contribution-registry.ts +1 -1
  159. package/src/node/debug-adapter-factory.ts +17 -17
  160. package/src/node/debug-adapter-session-manager.ts +1 -2
  161. package/src/node/debug-adapter-session.ts +32 -80
  162. package/src/node/debug-backend-module.ts +1 -1
  163. package/src/{common → node}/debug-model.ts +38 -18
  164. package/src/node/inline-debug-adapter.ts +47 -0
  165. package/src/node/stream-debug-adapter.ts +126 -0
  166. package/src/node/vscode/vscode-debug-adapter-contribution.ts +1 -1
  167. package/lib/common/debug-model.d.ts.map +0 -1
  168. package/lib/common/debug-model.js.map +0 -1
@@ -51,6 +51,7 @@ import { ColorContribution } from '@theia/core/lib/browser/color-application-con
51
51
  import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
52
52
  import { DebugFunctionBreakpoint } from './model/debug-function-breakpoint';
53
53
  import { DebugBreakpoint } from './model/debug-breakpoint';
54
+ import { nls } from '@theia/core/lib/common/nls';
54
55
 
55
56
  export namespace DebugMenus {
56
57
  export const DEBUG = [...MAIN_MENU_BAR, '6_debug'];
@@ -63,214 +64,242 @@ export namespace DebugMenus {
63
64
  export const DEBUG_BREAKPOINTS = [...DEBUG, 'f_breakpoints'];
64
65
  }
65
66
 
67
+ function nlsEditBreakpoint(breakpointKey: string, breakpoint: string): string {
68
+ return nls.localizeByDefault('Edit {0}...', nls.localize(`vscode/breakpointEditorContribution/${breakpointKey}`, breakpoint));
69
+ }
70
+
71
+ function nlsRemoveBreakpoint(breakpointKey: string, breakpoint: string): string {
72
+ return nls.localizeByDefault('Remove {0}',
73
+ nls.localize(`vscode/breakpointEditorContribution/${breakpointKey}`, breakpoint));
74
+ }
75
+
76
+ function nlsEnableBreakpoint(breakpointKey: string, breakpoint: string): string {
77
+ return nls.localizeByDefault('Enable {0}',
78
+ nls.localize(`vscode/breakpointEditorContribution/${breakpointKey}`, breakpoint));
79
+ }
80
+
81
+ function nlsDisableBreakpoint(breakpointKey: string, breakpoint: string): string {
82
+ return nls.localizeByDefault('Disable {0}',
83
+ nls.localize(`vscode/breakpointEditorContribution/${breakpointKey}`, breakpoint));
84
+ }
85
+
66
86
  export namespace DebugCommands {
67
87
 
68
88
  export const DEBUG_CATEGORY = 'Debug';
89
+ export const DEBUG_CATEGORY_KEY = nls.getDefaultKey(DEBUG_CATEGORY);
69
90
 
70
- export const START: Command = {
91
+ export const START = Command.toDefaultLocalizedCommand({
71
92
  id: 'workbench.action.debug.start',
72
93
  category: DEBUG_CATEGORY,
73
94
  label: 'Start Debugging',
74
95
  iconClass: codicon('debug-alt')
75
- };
76
- export const START_NO_DEBUG: Command = {
96
+ });
97
+ export const START_NO_DEBUG = Command.toDefaultLocalizedCommand({
77
98
  id: 'workbench.action.debug.run',
78
- label: 'Debug: Start Without Debugging'
79
- };
80
- export const STOP: Command = {
99
+ category: DEBUG_CATEGORY,
100
+ label: 'Start Without Debugging'
101
+ });
102
+ export const STOP = Command.toDefaultLocalizedCommand({
81
103
  id: 'workbench.action.debug.stop',
82
104
  category: DEBUG_CATEGORY,
83
- label: 'Stop Debugging',
105
+ label: 'Stop',
84
106
  iconClass: codicon('debug-stop')
85
- };
86
- export const RESTART: Command = {
107
+ });
108
+ export const RESTART = Command.toDefaultLocalizedCommand({
87
109
  id: 'workbench.action.debug.restart',
88
110
  category: DEBUG_CATEGORY,
89
- label: 'Restart Debugging',
90
- };
111
+ label: 'Restart',
112
+ });
91
113
 
92
- export const OPEN_CONFIGURATIONS = {
114
+ export const OPEN_CONFIGURATIONS = Command.toDefaultLocalizedCommand({
93
115
  id: 'debug.configurations.open',
94
- label: 'Debug: Open Configurations'
95
- };
96
- export const ADD_CONFIGURATION = {
116
+ category: DEBUG_CATEGORY,
117
+ label: 'Open Configurations'
118
+ });
119
+ export const ADD_CONFIGURATION = Command.toDefaultLocalizedCommand({
97
120
  id: 'debug.configurations.add',
98
- label: 'Debug: Add Configuration...'
99
- };
121
+ category: DEBUG_CATEGORY,
122
+ label: 'Add Configuration...'
123
+ });
100
124
 
101
- export const STEP_OVER: Command = {
125
+ export const STEP_OVER = Command.toDefaultLocalizedCommand({
102
126
  id: 'workbench.action.debug.stepOver',
103
127
  category: DEBUG_CATEGORY,
104
128
  label: 'Step Over',
105
129
  iconClass: codicon('debug-step-over')
106
- };
107
- export const STEP_INTO: Command = {
130
+ });
131
+ export const STEP_INTO = Command.toDefaultLocalizedCommand({
108
132
  id: 'workbench.action.debug.stepInto',
109
133
  category: DEBUG_CATEGORY,
110
134
  label: 'Step Into',
111
135
  iconClass: codicon('debug-step-into')
112
- };
113
- export const STEP_OUT: Command = {
136
+ });
137
+ export const STEP_OUT = Command.toDefaultLocalizedCommand({
114
138
  id: 'workbench.action.debug.stepOut',
115
139
  category: DEBUG_CATEGORY,
116
140
  label: 'Step Out',
117
141
  iconClass: codicon('debug-step-out')
118
- };
119
- export const CONTINUE: Command = {
142
+ });
143
+ export const CONTINUE = Command.toDefaultLocalizedCommand({
120
144
  id: 'workbench.action.debug.continue',
121
145
  category: DEBUG_CATEGORY,
122
146
  label: 'Continue',
123
147
  iconClass: codicon('debug-continue')
124
- };
125
- export const PAUSE: Command = {
148
+ });
149
+ export const PAUSE = Command.toDefaultLocalizedCommand({
126
150
  id: 'workbench.action.debug.pause',
127
151
  category: DEBUG_CATEGORY,
128
152
  label: 'Pause',
129
153
  iconClass: codicon('debug-pause')
130
- };
131
- export const CONTINUE_ALL: Command = {
154
+ });
155
+ export const CONTINUE_ALL = Command.toLocalizedCommand({
132
156
  id: 'debug.thread.continue.all',
133
157
  category: DEBUG_CATEGORY,
134
158
  label: 'Continue All',
135
159
  iconClass: codicon('debug-continue')
136
- };
137
- export const PAUSE_ALL: Command = {
160
+ }, 'theia/debug/continueAll', DEBUG_CATEGORY_KEY);
161
+ export const PAUSE_ALL = Command.toLocalizedCommand({
138
162
  id: 'debug.thread.pause.all',
139
163
  category: DEBUG_CATEGORY,
140
164
  label: 'Pause All',
141
165
  iconClass: codicon('debug-pause')
142
- };
166
+ }, 'theia/debug/pauseAll', DEBUG_CATEGORY_KEY);
143
167
 
144
- export const TOGGLE_BREAKPOINT: Command = {
168
+ export const TOGGLE_BREAKPOINT = Command.toDefaultLocalizedCommand({
145
169
  id: 'editor.debug.action.toggleBreakpoint',
146
170
  category: DEBUG_CATEGORY,
147
171
  label: 'Toggle Breakpoint',
148
- };
149
- export const INLINE_BREAKPOINT: Command = {
172
+ });
173
+ export const INLINE_BREAKPOINT = Command.toDefaultLocalizedCommand({
150
174
  id: 'editor.debug.action.inlineBreakpoint',
151
175
  category: DEBUG_CATEGORY,
152
176
  label: 'Inline Breakpoint',
153
- };
154
- export const ADD_CONDITIONAL_BREAKPOINT: Command = {
177
+ });
178
+ export const ADD_CONDITIONAL_BREAKPOINT = Command.toDefaultLocalizedCommand({
155
179
  id: 'debug.breakpoint.add.conditional',
156
180
  category: DEBUG_CATEGORY,
157
181
  label: 'Add Conditional Breakpoint...',
158
- };
159
- export const ADD_LOGPOINT: Command = {
182
+ });
183
+ export const ADD_LOGPOINT = Command.toDefaultLocalizedCommand({
160
184
  id: 'debug.breakpoint.add.logpoint',
161
185
  category: DEBUG_CATEGORY,
162
186
  label: 'Add Logpoint...',
163
- };
164
- export const ADD_FUNCTION_BREAKPOINT: Command = {
187
+ });
188
+ export const ADD_FUNCTION_BREAKPOINT = Command.toDefaultLocalizedCommand({
165
189
  id: 'debug.breakpoint.add.function',
166
190
  category: DEBUG_CATEGORY,
167
- label: 'Add Function Breakpoint...',
168
- };
169
- export const ENABLE_ALL_BREAKPOINTS: Command = {
191
+ label: 'Add Function Breakpoint',
192
+ });
193
+ export const ENABLE_ALL_BREAKPOINTS = Command.toDefaultLocalizedCommand({
170
194
  id: 'debug.breakpoint.enableAll',
171
195
  category: DEBUG_CATEGORY,
172
196
  label: 'Enable All Breakpoints',
173
- };
174
- export const DISABLE_ALL_BREAKPOINTS: Command = {
197
+ });
198
+ export const DISABLE_ALL_BREAKPOINTS = Command.toDefaultLocalizedCommand({
175
199
  id: 'debug.breakpoint.disableAll',
176
200
  category: DEBUG_CATEGORY,
177
201
  label: 'Disable All Breakpoints',
178
- };
179
- export const EDIT_BREAKPOINT: Command = {
202
+ });
203
+ export const EDIT_BREAKPOINT = Command.toLocalizedCommand({
180
204
  id: 'debug.breakpoint.edit',
181
205
  category: DEBUG_CATEGORY,
182
- label: 'Edit Breakpoint...',
183
- };
184
- export const EDIT_LOGPOINT: Command = {
206
+ originalLabel: 'Edit Breakpoint...',
207
+ label: nlsEditBreakpoint('breakpoint', 'Breakpoint')
208
+ }, '', DEBUG_CATEGORY_KEY);
209
+ export const EDIT_LOGPOINT = Command.toLocalizedCommand({
185
210
  id: 'debug.logpoint.edit',
186
211
  category: DEBUG_CATEGORY,
187
- label: 'Edit Logpoint...',
188
- };
189
- export const REMOVE_BREAKPOINT: Command = {
212
+ originalLabel: 'Edit Logpoint...',
213
+ label: nlsEditBreakpoint('logPoint', 'Logpoint')
214
+ }, '', DEBUG_CATEGORY_KEY);
215
+ export const REMOVE_BREAKPOINT = Command.toLocalizedCommand({
190
216
  id: 'debug.breakpoint.remove',
191
217
  category: DEBUG_CATEGORY,
192
- label: 'Remove Breakpoint',
193
- };
194
- export const REMOVE_LOGPOINT: Command = {
218
+ originalLabel: 'Remove Breakpoint',
219
+ label: nlsRemoveBreakpoint('breakpoint', 'Breakpoint')
220
+ }, '', DEBUG_CATEGORY_KEY);
221
+ export const REMOVE_LOGPOINT = Command.toLocalizedCommand({
195
222
  id: 'debug.logpoint.remove',
196
223
  category: DEBUG_CATEGORY,
197
- label: 'Remove Logpoint',
198
- };
199
- export const REMOVE_ALL_BREAKPOINTS: Command = {
224
+ originalLabel: 'Remove Logpoint',
225
+ label: nlsRemoveBreakpoint('logPoint', 'Logpoint')
226
+ }, '', DEBUG_CATEGORY_KEY);
227
+ export const REMOVE_ALL_BREAKPOINTS = Command.toDefaultLocalizedCommand({
200
228
  id: 'debug.breakpoint.removeAll',
201
229
  category: DEBUG_CATEGORY,
202
230
  label: 'Remove All Breakpoints',
203
- };
204
- export const TOGGLE_BREAKPOINTS_ENABLED: Command = {
231
+ });
232
+ export const TOGGLE_BREAKPOINTS_ENABLED = Command.toLocalizedCommand({
205
233
  id: 'debug.breakpoint.toggleEnabled'
206
- };
207
- export const SHOW_HOVER = {
234
+ });
235
+ export const SHOW_HOVER = Command.toDefaultLocalizedCommand({
208
236
  id: 'editor.debug.action.showDebugHover',
209
- label: 'Debug: Show Hover'
210
- };
237
+ category: DEBUG_CATEGORY,
238
+ label: 'Show Hover'
239
+ });
211
240
 
212
- export const RESTART_FRAME: Command = {
241
+ export const RESTART_FRAME = Command.toDefaultLocalizedCommand({
213
242
  id: 'debug.frame.restart',
214
243
  category: DEBUG_CATEGORY,
215
244
  label: 'Restart Frame',
216
- };
217
- export const COPY_CALL_STACK: Command = {
245
+ });
246
+ export const COPY_CALL_STACK = Command.toDefaultLocalizedCommand({
218
247
  id: 'debug.callStack.copy',
219
248
  category: DEBUG_CATEGORY,
220
249
  label: 'Copy Call Stack',
221
- };
250
+ });
222
251
 
223
- export const SET_VARIABLE_VALUE: Command = {
252
+ export const SET_VARIABLE_VALUE = Command.toDefaultLocalizedCommand({
224
253
  id: 'debug.variable.setValue',
225
254
  category: DEBUG_CATEGORY,
226
255
  label: 'Set Value',
227
- };
228
- export const COPY_VARIABLE_VALUE: Command = {
256
+ });
257
+ export const COPY_VARIABLE_VALUE = Command.toDefaultLocalizedCommand({
229
258
  id: 'debug.variable.copyValue',
230
259
  category: DEBUG_CATEGORY,
231
260
  label: 'Copy Value',
232
- };
233
- export const COPY_VARIABLE_AS_EXPRESSION: Command = {
261
+ });
262
+ export const COPY_VARIABLE_AS_EXPRESSION = Command.toDefaultLocalizedCommand({
234
263
  id: 'debug.variable.copyAsExpression',
235
264
  category: DEBUG_CATEGORY,
236
- label: 'Copy As Expression',
237
- };
238
- export const WATCH_VARIABLE: Command = {
265
+ label: 'Copy as Expression',
266
+ });
267
+ export const WATCH_VARIABLE = Command.toDefaultLocalizedCommand({
239
268
  id: 'debug.variable.watch',
240
269
  category: DEBUG_CATEGORY,
241
270
  label: 'Add to Watch',
242
- };
271
+ });
243
272
 
244
- export const ADD_WATCH_EXPRESSION: Command = {
273
+ export const ADD_WATCH_EXPRESSION = Command.toDefaultLocalizedCommand({
245
274
  id: 'debug.watch.addExpression',
246
275
  category: DEBUG_CATEGORY,
247
- label: 'Add Watch Expression'
248
- };
249
- export const EDIT_WATCH_EXPRESSION: Command = {
276
+ label: 'Add Expression'
277
+ });
278
+ export const EDIT_WATCH_EXPRESSION = Command.toDefaultLocalizedCommand({
250
279
  id: 'debug.watch.editExpression',
251
280
  category: DEBUG_CATEGORY,
252
- label: 'Edit Watch Expression'
253
- };
254
- export const COPY_WATCH_EXPRESSION_VALUE: Command = {
281
+ label: 'Edit Expression'
282
+ });
283
+ export const COPY_WATCH_EXPRESSION_VALUE = Command.toLocalizedCommand({
255
284
  id: 'debug.watch.copyExpressionValue',
256
285
  category: DEBUG_CATEGORY,
257
- label: 'Copy Watch Expression Value'
258
- };
259
- export const REMOVE_WATCH_EXPRESSION: Command = {
286
+ label: 'Copy Expression Value'
287
+ }, 'theia/debug/copyExpressionValue', DEBUG_CATEGORY_KEY);
288
+ export const REMOVE_WATCH_EXPRESSION = Command.toDefaultLocalizedCommand({
260
289
  id: 'debug.watch.removeExpression',
261
290
  category: DEBUG_CATEGORY,
262
- label: 'Remove Watch Expression'
263
- };
264
- export const COLLAPSE_ALL_WATCH_EXPRESSIONS: Command = {
291
+ label: 'Remove Expression'
292
+ });
293
+ export const COLLAPSE_ALL_WATCH_EXPRESSIONS = Command.toDefaultLocalizedCommand({
265
294
  id: 'debug.watch.collapseAllExpressions',
266
295
  category: DEBUG_CATEGORY,
267
- label: 'Collapse All Watch Expressions'
268
- };
269
- export const REMOVE_ALL_WATCH_EXPRESSIONS: Command = {
296
+ label: 'Collapse All'
297
+ });
298
+ export const REMOVE_ALL_WATCH_EXPRESSIONS = Command.toDefaultLocalizedCommand({
270
299
  id: 'debug.watch.removeAllExpressions',
271
300
  category: DEBUG_CATEGORY,
272
- label: 'Remove All Watch Expressions'
273
- };
301
+ label: 'Remove All Expressions'
302
+ });
274
303
  }
275
304
  export namespace DebugThreadContextCommands {
276
305
  export const STEP_OVER = {
@@ -478,6 +507,10 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
478
507
  this.watchManager.save();
479
508
  }
480
509
 
510
+ onWillStop(): boolean {
511
+ return this.preference['debug.confirmOnExit'] === 'always' && !!this.manager.currentSession;
512
+ }
513
+
481
514
  registerMenus(menus: MenuModelRegistry): void {
482
515
  super.registerMenus(menus);
483
516
  const registerMenuActions = (menuPath: string[], ...commands: Command[]) => {
@@ -493,7 +526,7 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
493
526
  }
494
527
  };
495
528
 
496
- menus.registerSubmenu(DebugMenus.DEBUG, 'Run');
529
+ menus.registerSubmenu(DebugMenus.DEBUG, nls.localizeByDefault('Run'));
497
530
  registerMenuActions(DebugMenus.DEBUG_CONTROLS,
498
531
  DebugCommands.START,
499
532
  DebugCommands.START_NO_DEBUG,
@@ -518,7 +551,7 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
518
551
  registerMenuActions(DebugMenus.DEBUG_BREAKPOINT,
519
552
  DebugCommands.TOGGLE_BREAKPOINT
520
553
  );
521
- menus.registerSubmenu(DebugMenus.DEBUG_NEW_BREAKPOINT, 'New Breakpoint');
554
+ menus.registerSubmenu(DebugMenus.DEBUG_NEW_BREAKPOINT, nls.localizeByDefault('New Breakpoint'));
522
555
  registerMenuActions(DebugMenus.DEBUG_NEW_BREAKPOINT,
523
556
  DebugCommands.ADD_CONDITIONAL_BREAKPOINT,
524
557
  DebugCommands.INLINE_BREAKPOINT,
@@ -541,15 +574,15 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
541
574
  { ...DebugCommands.CONTINUE_ALL, ...DebugSessionContextCommands.CONTINUE_ALL }
542
575
  );
543
576
  registerMenuActions(DebugThreadsWidget.TERMINATE_MENU,
544
- { ...DebugCommands.RESTART, ...DebugSessionContextCommands.RESTART, label: 'Restart' },
545
- { ...DebugCommands.STOP, ...DebugSessionContextCommands.STOP, label: 'Stop' },
546
- { ...DebugThreadContextCommands.TERMINATE, label: 'Terminate Thread' }
577
+ { ...DebugCommands.RESTART, ...DebugSessionContextCommands.RESTART },
578
+ { ...DebugCommands.STOP, ...DebugSessionContextCommands.STOP },
579
+ { ...DebugThreadContextCommands.TERMINATE, label: nls.localizeByDefault('Terminate Thread') }
547
580
  );
548
581
  registerMenuActions(DebugThreadsWidget.OPEN_MENU,
549
- { ...DebugSessionContextCommands.REVEAL, label: 'Reveal' },
550
- { ...DebugSessionContextCommands.OPEN_LEFT, label: 'Open Left' },
551
- { ...DebugSessionContextCommands.OPEN_RIGHT, label: 'Open Right' },
552
- { ...DebugSessionContextCommands.OPEN_BOTTOM, label: 'Open Bottom' }
582
+ { ...DebugSessionContextCommands.REVEAL, label: nls.localize('theia/debug/reveal', 'Reveal') },
583
+ { ...DebugSessionContextCommands.OPEN_LEFT, label: nls.localize('theia/debug/openLeft', 'Open Left') },
584
+ { ...DebugSessionContextCommands.OPEN_RIGHT, label: nls.localize('theia/debug/openRight', 'Open Right') },
585
+ { ...DebugSessionContextCommands.OPEN_BOTTOM, label: nls.localize('theia/debug/openBottom', 'Open Bottom') }
553
586
  );
554
587
 
555
588
  registerMenuActions(DebugStackFramesWidget.CONTEXT_MENU,
@@ -567,12 +600,12 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
567
600
  );
568
601
 
569
602
  registerMenuActions(DebugWatchWidget.EDIT_MENU,
570
- { ...DebugCommands.EDIT_WATCH_EXPRESSION, label: 'Edit Expression' },
571
- { ...DebugCommands.COPY_WATCH_EXPRESSION_VALUE, label: 'Copy Value' }
603
+ DebugCommands.EDIT_WATCH_EXPRESSION,
604
+ DebugCommands.COPY_WATCH_EXPRESSION_VALUE
572
605
  );
573
606
  registerMenuActions(DebugWatchWidget.REMOVE_MENU,
574
- { ...DebugCommands.REMOVE_WATCH_EXPRESSION, label: 'Remove Expression' },
575
- { ...DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS, label: 'Remove All Expressions' }
607
+ DebugCommands.REMOVE_WATCH_EXPRESSION,
608
+ DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS
576
609
  );
577
610
 
578
611
  registerMenuActions(DebugBreakpointsWidget.EDIT_MENU,
@@ -590,17 +623,17 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
590
623
  );
591
624
 
592
625
  registerMenuActions(DebugEditorModel.CONTEXT_MENU,
593
- { ...DebugEditorContextCommands.ADD_BREAKPOINT, label: 'Add Breakpoint' },
626
+ { ...DebugEditorContextCommands.ADD_BREAKPOINT, label: nls.localizeByDefault('Add Breakpoint') },
594
627
  { ...DebugEditorContextCommands.ADD_CONDITIONAL_BREAKPOINT, label: DebugCommands.ADD_CONDITIONAL_BREAKPOINT.label },
595
628
  { ...DebugEditorContextCommands.ADD_LOGPOINT, label: DebugCommands.ADD_LOGPOINT.label },
596
629
  { ...DebugEditorContextCommands.REMOVE_BREAKPOINT, label: DebugCommands.REMOVE_BREAKPOINT.label },
597
630
  { ...DebugEditorContextCommands.EDIT_BREAKPOINT, label: DebugCommands.EDIT_BREAKPOINT.label },
598
- { ...DebugEditorContextCommands.ENABLE_BREAKPOINT, label: 'Enable Breakpoint' },
599
- { ...DebugEditorContextCommands.DISABLE_BREAKPOINT, label: 'Disable Breakpoint' },
631
+ { ...DebugEditorContextCommands.ENABLE_BREAKPOINT, label: nlsEnableBreakpoint('breakpoint', 'Breakpoint') },
632
+ { ...DebugEditorContextCommands.DISABLE_BREAKPOINT, label: nlsDisableBreakpoint('breakpoint', 'Breakpoint') },
600
633
  { ...DebugEditorContextCommands.REMOVE_LOGPOINT, label: DebugCommands.REMOVE_LOGPOINT.label },
601
634
  { ...DebugEditorContextCommands.EDIT_LOGPOINT, label: DebugCommands.EDIT_LOGPOINT.label },
602
- { ...DebugEditorContextCommands.ENABLE_LOGPOINT, label: 'Enable Logpoint' },
603
- { ...DebugEditorContextCommands.DISABLE_LOGPOINT, label: 'Disable Logpoint' }
635
+ { ...DebugEditorContextCommands.ENABLE_LOGPOINT, label: nlsEnableBreakpoint('logPoint', 'Logpoint') },
636
+ { ...DebugEditorContextCommands.DISABLE_LOGPOINT, label: nlsDisableBreakpoint('logPoint', 'Logpoint') }
604
637
  );
605
638
  }
606
639
 
@@ -613,11 +646,11 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
613
646
  execute: (config?: DebugSessionOptions) => this.start(true, config)
614
647
  });
615
648
  registry.registerCommand(DebugCommands.STOP, {
616
- execute: () => this.manager.terminateSessions(),
649
+ execute: () => this.manager.terminateSession(),
617
650
  isEnabled: () => this.manager.state !== DebugState.Inactive
618
651
  });
619
652
  registry.registerCommand(DebugCommands.RESTART, {
620
- execute: () => this.manager.restartSessions(),
653
+ execute: () => this.manager.restartSession(),
621
654
  isEnabled: () => this.manager.state !== DebugState.Inactive
622
655
  });
623
656
 
@@ -689,12 +722,12 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
689
722
  });
690
723
 
691
724
  registry.registerCommand(DebugSessionContextCommands.STOP, {
692
- execute: () => this.selectedSession && this.selectedSession.terminate(),
725
+ execute: () => this.selectedSession && this.manager.terminateSession(this.selectedSession),
693
726
  isEnabled: () => !!this.selectedSession && this.selectedSession.state !== DebugState.Inactive,
694
727
  isVisible: () => !this.selectedThread
695
728
  });
696
729
  registry.registerCommand(DebugSessionContextCommands.RESTART, {
697
- execute: () => this.selectedSession && this.manager.restart(this.selectedSession),
730
+ execute: () => this.selectedSession && this.manager.restartSession(this.selectedSession),
698
731
  isEnabled: () => !!this.selectedSession && this.selectedSession.state !== DebugState.Inactive,
699
732
  isVisible: () => !this.selectedThread
700
733
  });
@@ -1074,7 +1107,9 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1074
1107
  priority: 1
1075
1108
  };
1076
1109
  const updateToggleBreakpointsEnabled = () => {
1077
- const tooltip = this.breakpointManager.breakpointsEnabled ? 'Deactivate Breakpoints' : 'Activate Breakpoints';
1110
+ const activateBreakpoints = nls.localizeByDefault('Enable All Breakpoints');
1111
+ const deactivateBreakpoints = nls.localizeByDefault('Disable All Breakpoints');
1112
+ const tooltip = this.breakpointManager.breakpointsEnabled ? deactivateBreakpoints : activateBreakpoints;
1078
1113
  if (toggleBreakpointsEnabled.tooltip !== tooltip) {
1079
1114
  toggleBreakpointsEnabled.tooltip = tooltip;
1080
1115
  onDidChangeToggleBreakpointsEnabled.fire(undefined);
@@ -1084,7 +1119,7 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1084
1119
  id: DebugCommands.ADD_FUNCTION_BREAKPOINT.id,
1085
1120
  command: DebugCommands.ADD_FUNCTION_BREAKPOINT.id,
1086
1121
  icon: codicon('add'),
1087
- tooltip: 'Add Function Breakpoint'
1122
+ tooltip: DebugCommands.ADD_FUNCTION_BREAKPOINT.label
1088
1123
  });
1089
1124
  updateToggleBreakpointsEnabled();
1090
1125
  this.breakpointManager.onDidChangeBreakpoints(updateToggleBreakpointsEnabled);
@@ -1100,20 +1135,20 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1100
1135
  id: DebugCommands.ADD_WATCH_EXPRESSION.id,
1101
1136
  command: DebugCommands.ADD_WATCH_EXPRESSION.id,
1102
1137
  icon: codicon('add'),
1103
- tooltip: 'Add Expression'
1138
+ tooltip: DebugCommands.ADD_WATCH_EXPRESSION.label
1104
1139
  });
1105
1140
  toolbar.registerItem({
1106
1141
  id: DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS.id,
1107
1142
  command: DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS.id,
1108
1143
  icon: codicon('collapse-all'),
1109
- tooltip: 'Collapse All',
1144
+ tooltip: DebugCommands.COLLAPSE_ALL_WATCH_EXPRESSIONS.label,
1110
1145
  priority: 1
1111
1146
  });
1112
1147
  toolbar.registerItem({
1113
1148
  id: DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS.id,
1114
1149
  command: DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS.id,
1115
1150
  icon: codicon('close-all'),
1116
- tooltip: 'Remove All Expressions',
1151
+ tooltip: DebugCommands.REMOVE_ALL_WATCH_EXPRESSIONS.label,
1117
1152
  priority: 2
1118
1153
  });
1119
1154
  }
@@ -1125,8 +1160,8 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1125
1160
  protected async openSession(
1126
1161
  session: DebugSession,
1127
1162
  options?: {
1128
- debugViewLocation?: DebugViewLocation
1129
- reveal?: boolean
1163
+ debugViewLocation?: DebugViewLocation;
1164
+ reveal?: boolean;
1130
1165
  }
1131
1166
  ): Promise<DebugWidget | DebugSessionWidget> {
1132
1167
  const { debugViewLocation, reveal } = {
@@ -14,6 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
+ import { nls } from '@theia/core/lib/common/nls';
17
18
  import { PreferenceSchema, PreferenceProxy, PreferenceService, createPreferenceProxy, PreferenceContribution } from '@theia/core/lib/browser/preferences';
18
19
  import { interfaces } from '@theia/core/shared/inversify';
19
20
 
@@ -23,32 +24,47 @@ export const debugPreferencesSchema: PreferenceSchema = {
23
24
  'debug.trace': {
24
25
  type: 'boolean',
25
26
  default: false,
26
- description: 'Enable/disable tracing communications with debug adapters'
27
+ description: nls.localize('theia/debug/toggleTracing', 'Enable/disable tracing communications with debug adapters')
27
28
  },
28
29
  'debug.debugViewLocation': {
29
30
  enum: ['default', 'left', 'right', 'bottom'],
30
31
  default: 'default',
31
- description: 'Controls the location of the debug view.'
32
+ description: nls.localize('theia/debug/debugViewLocation', 'Controls the location of the debug view.')
32
33
  },
33
34
  'debug.openDebug': {
34
35
  enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'],
35
36
  default: 'openOnSessionStart',
36
- description: 'Controls when the debug view should open.'
37
+ description: nls.localizeByDefault('Controls when the debug view should open.')
37
38
  },
38
39
  'debug.internalConsoleOptions': {
39
40
  enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'],
40
41
  default: 'openOnFirstSessionStart',
41
- description: 'Controls when the internal debug console should open.'
42
+ description: nls.localizeByDefault('Controls when the internal debug console should open.')
42
43
  },
43
44
  'debug.inlineValues': {
44
45
  type: 'boolean',
45
46
  default: false,
46
- description: 'Show variable values inline in editor while debugging.'
47
+ description: nls.localizeByDefault('Show variable values inline in editor while debugging.')
47
48
  },
48
49
  'debug.showInStatusBar': {
49
50
  enum: ['never', 'always', 'onFirstSessionStart'],
50
- description: 'Controls when the debug status bar should be visible.',
51
+ enumDescriptions: [
52
+ nls.localizeByDefault('Never show debug in status bar'),
53
+ nls.localizeByDefault('Always show debug in status bar'),
54
+ nls.localizeByDefault('Show debug in status bar only after debug was started for the first time')
55
+ ],
56
+ description: nls.localizeByDefault('Controls when the debug status bar should be visible.'),
51
57
  default: 'onFirstSessionStart'
58
+ },
59
+ 'debug.confirmOnExit': {
60
+ description: 'Controls whether to confirm when the window closes if there are active debug sessions.',
61
+ type: 'string',
62
+ enum: ['never', 'always'],
63
+ enumDescriptions: [
64
+ 'Never confirm.',
65
+ 'Always confirm if there are debug sessions.',
66
+ ],
67
+ default: 'never'
52
68
  }
53
69
  }
54
70
  };
@@ -60,6 +76,7 @@ export class DebugConfiguration {
60
76
  'debug.internalConsoleOptions': 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart';
61
77
  'debug.inlineValues': boolean;
62
78
  'debug.showInStatusBar': 'never' | 'always' | 'onFirstSessionStart';
79
+ 'debug.confirmOnExit': 'never' | 'always';
63
80
  }
64
81
 
65
82
  export const DebugPreferenceContribution = Symbol('DebugPreferenceContribution');
@@ -61,11 +61,11 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan
61
61
 
62
62
  readonly statusBarId = 'select-run-debug-statusbar-item';
63
63
 
64
- private readonly command: Command = {
64
+ private readonly command = Command.toDefaultLocalizedCommand({
65
65
  id: 'select.debug.configuration',
66
- category: 'Debug',
66
+ category: DebugCommands.DEBUG_CATEGORY,
67
67
  label: 'Select and Start Debugging'
68
- };
68
+ });
69
69
 
70
70
  @postConstruct()
71
71
  protected initialize(): void {
@@ -135,7 +135,7 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan
135
135
  for (const configuration of dynamicConfigurations) {
136
136
  items.push({
137
137
  label: configuration.name,
138
- execute: () => this.runConfiguration({configuration})
138
+ execute: () => this.runConfiguration({ configuration })
139
139
  });
140
140
  }
141
141
  }