@theia/debug 1.65.0-next.6 → 1.65.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 (105) hide show
  1. package/lib/browser/console/debug-console-items.d.ts.map +1 -1
  2. package/lib/browser/console/debug-console-items.js +34 -20
  3. package/lib/browser/console/debug-console-items.js.map +1 -1
  4. package/lib/browser/debug-configuration-manager.d.ts +2 -2
  5. package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
  6. package/lib/browser/debug-configuration-manager.js +8 -9
  7. package/lib/browser/debug-configuration-manager.js.map +1 -1
  8. package/lib/browser/debug-configuration-model.d.ts +1 -1
  9. package/lib/browser/debug-configuration-model.d.ts.map +1 -1
  10. package/lib/browser/debug-configuration-model.js.map +1 -1
  11. package/lib/browser/debug-frontend-application-contribution.d.ts +17 -3
  12. package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
  13. package/lib/browser/debug-frontend-application-contribution.js +208 -44
  14. package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
  15. package/lib/browser/debug-frontend-module.js +2 -2
  16. package/lib/browser/debug-frontend-module.js.map +1 -1
  17. package/lib/browser/debug-prefix-configuration.d.ts +1 -1
  18. package/lib/browser/debug-prefix-configuration.d.ts.map +1 -1
  19. package/lib/browser/debug-prefix-configuration.js +3 -2
  20. package/lib/browser/debug-prefix-configuration.js.map +1 -1
  21. package/lib/browser/debug-schema-updater.d.ts +0 -1
  22. package/lib/browser/debug-schema-updater.d.ts.map +1 -1
  23. package/lib/browser/debug-schema-updater.js +5 -5
  24. package/lib/browser/debug-schema-updater.js.map +1 -1
  25. package/lib/browser/debug-session-contribution.d.ts +1 -1
  26. package/lib/browser/debug-session-contribution.d.ts.map +1 -1
  27. package/lib/browser/debug-session-contribution.js +1 -1
  28. package/lib/browser/debug-session-contribution.js.map +1 -1
  29. package/lib/browser/debug-session-manager.d.ts.map +1 -1
  30. package/lib/browser/debug-session-manager.js +14 -8
  31. package/lib/browser/debug-session-manager.js.map +1 -1
  32. package/lib/browser/debug-session.d.ts +8 -0
  33. package/lib/browser/debug-session.d.ts.map +1 -1
  34. package/lib/browser/debug-session.js +13 -3
  35. package/lib/browser/debug-session.js.map +1 -1
  36. package/lib/browser/disassembly-view/disassembly-view-contribution.js +1 -1
  37. package/lib/browser/disassembly-view/disassembly-view-contribution.js.map +1 -1
  38. package/lib/browser/disassembly-view/disassembly-view-widget.d.ts +2 -2
  39. package/lib/browser/disassembly-view/disassembly-view-widget.d.ts.map +1 -1
  40. package/lib/browser/disassembly-view/disassembly-view-widget.js +3 -3
  41. package/lib/browser/disassembly-view/disassembly-view-widget.js.map +1 -1
  42. package/lib/browser/editor/debug-editor-model.d.ts.map +1 -1
  43. package/lib/browser/editor/debug-editor-model.js +16 -10
  44. package/lib/browser/editor/debug-editor-model.js.map +1 -1
  45. package/lib/browser/editor/debug-inline-value-decorator.d.ts +1 -1
  46. package/lib/browser/editor/debug-inline-value-decorator.d.ts.map +1 -1
  47. package/lib/browser/editor/debug-inline-value-decorator.js +1 -1
  48. package/lib/browser/editor/debug-inline-value-decorator.js.map +1 -1
  49. package/lib/browser/model/debug-breakpoint.d.ts.map +1 -1
  50. package/lib/browser/model/debug-breakpoint.js +3 -2
  51. package/lib/browser/model/debug-breakpoint.js.map +1 -1
  52. package/lib/browser/model/debug-instruction-breakpoint.js +1 -1
  53. package/lib/browser/model/debug-instruction-breakpoint.js.map +1 -1
  54. package/lib/browser/model/debug-source-breakpoint.d.ts.map +1 -1
  55. package/lib/browser/model/debug-source-breakpoint.js +10 -9
  56. package/lib/browser/model/debug-source-breakpoint.js.map +1 -1
  57. package/lib/browser/model/debug-thread.js +1 -1
  58. package/lib/browser/model/debug-thread.js.map +1 -1
  59. package/lib/browser/view/debug-stack-frames-source.d.ts.map +1 -1
  60. package/lib/browser/view/debug-stack-frames-source.js +2 -1
  61. package/lib/browser/view/debug-stack-frames-source.js.map +1 -1
  62. package/lib/browser/view/debug-view-model.d.ts.map +1 -1
  63. package/lib/browser/view/debug-view-model.js +1 -1
  64. package/lib/browser/view/debug-view-model.js.map +1 -1
  65. package/lib/{browser → common}/debug-preferences.d.ts +1 -1
  66. package/lib/{browser → common}/debug-preferences.d.ts.map +1 -1
  67. package/lib/{browser → common}/debug-preferences.js +4 -5
  68. package/lib/common/debug-preferences.js.map +1 -0
  69. package/lib/common/inline-debug-adapter.d.ts +3 -0
  70. package/lib/common/inline-debug-adapter.d.ts.map +1 -1
  71. package/lib/{browser/preferences → common}/launch-preferences.d.ts +2 -1
  72. package/lib/common/launch-preferences.d.ts.map +1 -0
  73. package/lib/{browser/preferences → common}/launch-preferences.js +8 -10
  74. package/lib/common/launch-preferences.js.map +1 -0
  75. package/lib/node/debug-backend-module.d.ts.map +1 -1
  76. package/lib/node/debug-backend-module.js +4 -0
  77. package/lib/node/debug-backend-module.js.map +1 -1
  78. package/package.json +16 -16
  79. package/src/browser/console/debug-console-items.tsx +32 -20
  80. package/src/browser/debug-configuration-manager.ts +5 -6
  81. package/src/browser/debug-configuration-model.ts +1 -2
  82. package/src/browser/debug-frontend-application-contribution.ts +231 -50
  83. package/src/browser/debug-frontend-module.ts +2 -2
  84. package/src/browser/debug-prefix-configuration.ts +3 -3
  85. package/src/browser/debug-schema-updater.ts +2 -2
  86. package/src/browser/debug-session-contribution.ts +1 -1
  87. package/src/browser/debug-session-manager.ts +14 -8
  88. package/src/browser/debug-session.tsx +14 -2
  89. package/src/browser/disassembly-view/disassembly-view-contribution.ts +1 -1
  90. package/src/browser/disassembly-view/disassembly-view-widget.ts +2 -2
  91. package/src/browser/editor/debug-editor-model.ts +15 -10
  92. package/src/browser/editor/debug-inline-value-decorator.ts +1 -1
  93. package/src/browser/model/debug-breakpoint.tsx +3 -2
  94. package/src/browser/model/debug-instruction-breakpoint.tsx +1 -1
  95. package/src/browser/model/debug-source-breakpoint.tsx +13 -10
  96. package/src/browser/model/debug-thread.tsx +1 -1
  97. package/src/browser/style/index.css +6 -2
  98. package/src/browser/view/debug-stack-frames-source.tsx +2 -1
  99. package/src/browser/view/debug-view-model.ts +2 -2
  100. package/src/{browser → common}/debug-preferences.ts +4 -5
  101. package/src/{browser/preferences → common}/launch-preferences.ts +5 -6
  102. package/src/node/debug-backend-module.ts +4 -0
  103. package/lib/browser/debug-preferences.js.map +0 -1
  104. package/lib/browser/preferences/launch-preferences.d.ts.map +0 -1
  105. package/lib/browser/preferences/launch-preferences.js.map +0 -1
@@ -24,9 +24,9 @@ import { WorkspaceService } from '@theia/workspace/lib/browser';
24
24
  import { LabelProvider } from '@theia/core/lib/browser/label-provider';
25
25
  import URI from '@theia/core/lib/common/uri';
26
26
  import { QuickAccessContribution, QuickAccessProvider, QuickAccessRegistry, QuickInputService, StatusBar, StatusBarAlignment } from '@theia/core/lib/browser';
27
- import { DebugPreferences } from './debug-preferences';
27
+ import { DebugPreferences } from '../common/debug-preferences';
28
28
  import { filterItems, QuickPickItemOrSeparator, QuickPicks } from '@theia/core/lib/browser/quick-input/quick-input-service';
29
- import { CancellationToken } from '@theia/core/lib/common';
29
+ import { CancellationToken, nls } from '@theia/core/lib/common';
30
30
 
31
31
  @injectable()
32
32
  export class DebugPrefixConfiguration implements CommandContribution, CommandHandler, QuickAccessContribution, QuickAccessProvider {
@@ -103,7 +103,7 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan
103
103
  getInstance: () => this,
104
104
  prefix: DebugPrefixConfiguration.PREFIX,
105
105
  placeholder: '',
106
- helpEntries: [{ description: 'Debug Configuration', needsEditor: false }]
106
+ helpEntries: [{ description: nls.localize('theia/debug/debugConfiguration', 'Debug Configuration'), needsEditor: false }]
107
107
  });
108
108
  }
109
109
 
@@ -20,10 +20,11 @@ import { deepClone, nls } from '@theia/core/lib/common';
20
20
  import { IJSONSchema } from '@theia/core/lib/common/json-schema';
21
21
  import URI from '@theia/core/lib/common/uri';
22
22
  import { DebugService } from '../common/debug-service';
23
- import { debugPreferencesSchema } from './debug-preferences';
23
+ import { debugPreferencesSchema } from '../common/debug-preferences';
24
24
  import { inputsSchema } from '@theia/variable-resolver/lib/browser/variable-input-schema';
25
25
  import { WorkspaceService } from '@theia/workspace/lib/browser';
26
26
  import { defaultCompound } from '../common/debug-compound';
27
+ import { launchSchemaId } from '../common/launch-preferences';
27
28
 
28
29
  @injectable()
29
30
  export class DebugSchemaUpdater implements JsonSchemaContribution {
@@ -68,7 +69,6 @@ export class DebugSchemaUpdater implements JsonSchemaContribution {
68
69
  }
69
70
  }
70
71
 
71
- export const launchSchemaId = 'vscode://schemas/launch';
72
72
  const launchSchema: IJSONSchema = {
73
73
  $id: launchSchemaId,
74
74
  type: 'object',
@@ -23,7 +23,7 @@ import { DebugSession } from './debug-session';
23
23
  import { BreakpointManager } from './breakpoint/breakpoint-manager';
24
24
  import { DebugConfigurationSessionOptions, DebugSessionOptions } from './debug-session-options';
25
25
  import { OutputChannelManager, OutputChannel } from '@theia/output/lib/browser/output-channel';
26
- import { DebugPreferences } from './debug-preferences';
26
+ import { DebugPreferences } from '../common/debug-preferences';
27
27
  import { DebugSessionConnection } from './debug-session-connection';
28
28
  import { DebugChannel, DebugAdapterPath, ForwardingDebugChannel } from '../common/debug-service';
29
29
  import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
@@ -210,7 +210,7 @@ export class DebugSessionManager {
210
210
  }
211
211
 
212
212
  protected async startConfiguration(options: DebugConfigurationSessionOptions): Promise<DebugSession | undefined> {
213
- return this.progressService.withProgress('Start...', 'debug', async () => {
213
+ return this.progressService.withProgress(nls.localizeByDefault('Starting...'), 'debug', async () => {
214
214
  try {
215
215
  // If a parent session is available saving should be handled by the parent
216
216
  if (!options.configuration.parentSessionId && !options.configuration.suppressSaveBeforeStart && !await this.saveAll()) {
@@ -258,11 +258,11 @@ export class DebugSessionManager {
258
258
  return this.doStart(sessionId, resolved);
259
259
  } catch (e) {
260
260
  if (DebugError.NotFound.is(e)) {
261
- this.messageService.error(`The debug session type "${e.data.type}" is not supported.`);
261
+ this.messageService.error(nls.localize('theia/debug/debugSessionTypeNotSupported', 'The debug session type "{0}" is not supported.', e.data.type));
262
262
  return undefined;
263
263
  }
264
264
 
265
- this.messageService.error('There was an error starting the debug session, check the logs for more details.');
265
+ this.messageService.error(nls.localize('theia/debug/errorStartingDebugSession', 'There was an error starting the debug session, check the logs for more details.'));
266
266
  console.error('Error starting the debug session', e);
267
267
  throw e;
268
268
  }
@@ -652,8 +652,9 @@ export class DebugSessionManager {
652
652
  return true;
653
653
  }
654
654
 
655
+ const taskLabel = typeof taskName === 'string' ? taskName : JSON.stringify(taskName);
655
656
  if (!taskInfo) {
656
- return this.doPostTaskAction(`Could not run the task '${taskName}'.`);
657
+ return this.doPostTaskAction(nls.localize('theia/debug/couldNotRunTask', "Could not run the task '{0}'.", taskLabel));
657
658
  }
658
659
 
659
660
  const getExitCodePromise: Promise<TaskEndedInfo> = this.taskService.getExitCode(taskInfo.taskId).then(result =>
@@ -671,19 +672,24 @@ export class DebugSessionManager {
671
672
  if (taskEndedInfo.taskEndedType === TaskEndedTypes.TaskExited && taskEndedInfo.value === 0) {
672
673
  return true;
673
674
  } else if (taskEndedInfo.taskEndedType === TaskEndedTypes.TaskExited && taskEndedInfo.value !== undefined) {
674
- return this.doPostTaskAction(`Task '${taskName}' terminated with exit code ${taskEndedInfo.value}.`);
675
+ return this.doPostTaskAction(nls.localize('theia/debug/taskTerminatedWithExitCode', "Task '{0}' terminated with exit code {1}.", taskLabel, taskEndedInfo.value));
675
676
  } else {
676
677
  const signal = await this.taskService.getTerminateSignal(taskInfo.taskId);
677
678
  if (signal !== undefined) {
678
- return this.doPostTaskAction(`Task '${taskName}' terminated by signal ${signal}.`);
679
+ return this.doPostTaskAction(nls.localize('theia/debug/taskTerminatedBySignal', "Task '{0}' terminated by signal {1}.", taskLabel, signal));
679
680
  } else {
680
- return this.doPostTaskAction(`Task '${taskName}' terminated for unknown reason.`);
681
+ return this.doPostTaskAction(nls.localize('theia/debug/taskTerminatedForUnknownReason', "Task '{0}' terminated for unknown reason.", taskLabel));
681
682
  }
682
683
  }
683
684
  }
684
685
 
685
686
  protected async doPostTaskAction(errorMessage: string): Promise<boolean> {
686
- const actions = ['Open launch.json', 'Cancel', 'Configure Task', 'Debug Anyway'];
687
+ const actions = [
688
+ nls.localizeByDefault('Open {0}', 'launch.json'),
689
+ nls.localizeByDefault('Cancel'),
690
+ nls.localizeByDefault('Configure Task'),
691
+ nls.localizeByDefault('Debug Anyway')
692
+ ];
687
693
  const result = await this.messageService.error(errorMessage, ...actions);
688
694
  switch (result) {
689
695
  case actions[0]: // open launch.json
@@ -66,6 +66,17 @@ export function debugStateContextValue(state: DebugState): string {
66
66
  }
67
67
  }
68
68
 
69
+ const formatMessageRegexp = /\{([^}]+)\}/g;
70
+
71
+ /**
72
+ * Returns a formatted message string. The format is compatible with {@link DebugProtocol.Message.format}.
73
+ * @param format A format string for the message. Embedded variables have the form `{name}`.
74
+ * @param variables An object used as a dictionary for looking up the variables in the format string.
75
+ */
76
+ export function formatMessage(format: string, variables?: { [key: string]: string; }): string {
77
+ return variables ? format.replace(formatMessageRegexp, (match, group) => variables.hasOwnProperty(group) ? variables[group] : match) : format;
78
+ }
79
+
69
80
  // FIXME: make injectable to allow easily inject services
70
81
  export class DebugSession implements CompositeTreeElement {
71
82
  protected readonly deferredOnDidConfigureCapabilities = new Deferred<void>();
@@ -331,7 +342,7 @@ export class DebugSession implements CompositeTreeElement {
331
342
  try {
332
343
  const response = await this.connection.sendRequest('initialize', {
333
344
  clientID: 'Theia',
334
- clientName: 'Theia IDE',
345
+ clientName: nls.localize('theia/debug/TheiaIDE', 'Theia IDE'),
335
346
  adapterID: this.configuration.type,
336
347
  locale: 'en-US',
337
348
  linesStartAt1: true,
@@ -353,7 +364,8 @@ export class DebugSession implements CompositeTreeElement {
353
364
  try {
354
365
  await this.sendRequest((this.configuration.request as keyof DebugRequestTypes), this.configuration);
355
366
  } catch (reason) {
356
- this.showMessage(MessageType.Error, reason.message || 'Debug session initialization failed. See console for details.');
367
+ this.showMessage(MessageType.Error, reason.message || nls.localize('theia/debug/debugSessionInitializationFailed',
368
+ 'Debug session initialization failed. See console for details.'));
357
369
  throw reason;
358
370
  }
359
371
  }
@@ -46,7 +46,7 @@ export class DisassemblyViewContribution extends AbstractViewContribution<Disass
46
46
  constructor() {
47
47
  super({
48
48
  widgetId: DisassemblyViewWidget.ID,
49
- widgetName: 'Disassembly View',
49
+ widgetName: nls.localizeByDefault('Disassembly View'),
50
50
  defaultWidgetOptions: { area: 'main' }
51
51
  });
52
52
  }
@@ -26,9 +26,9 @@ import { nls } from '@theia/core';
26
26
  import { BareFontInfo } from '@theia/monaco-editor-core/esm/vs/editor/common/config/fontInfo';
27
27
  import { WorkbenchTable } from '@theia/monaco-editor-core/esm/vs/platform/list/browser/listService';
28
28
  import { DebugState, DebugSession } from '../debug-session';
29
- import { EditorPreferences } from '@theia/editor/lib/browser';
29
+ import { EditorPreferences } from '@theia/editor/lib/common/editor-preferences';
30
30
  import { PixelRatio } from '@theia/monaco-editor-core/esm/vs/base/browser/pixelRatio';
31
- import { DebugPreferences } from '../debug-preferences';
31
+ import { DebugPreferences } from '../../common/debug-preferences';
32
32
  import { DebugThread } from '../model/debug-thread';
33
33
  import { Event } from '@theia/monaco-editor-core/esm/vs/base/common/event';
34
34
  import { DisassembledInstructionEntry } from './disassembly-view-utilities';
@@ -191,7 +191,7 @@ export class DebugEditorModel implements Disposable {
191
191
  range: columnUntilEOLRange
192
192
  });
193
193
  const firstNonWhitespaceColumn = this.editor.document.textEditorModel.getLineFirstNonWhitespaceColumn(currentFrame.raw.line);
194
- if (currentFrame.raw.column > firstNonWhitespaceColumn) {
194
+ if (firstNonWhitespaceColumn !== 0 && currentFrame.raw.column > firstNonWhitespaceColumn) {
195
195
  decorations.push({
196
196
  options: DebugEditorModel.TOP_STACK_FRAME_INLINE_DECORATION,
197
197
  range: columnUntilEOLRange
@@ -246,8 +246,8 @@ export class DebugEditorModel implements Disposable {
246
246
  }
247
247
  protected createBreakpointDecoration(breakpoint: SourceBreakpoint): monaco.editor.IModelDeltaDecoration {
248
248
  const lineNumber = breakpoint.raw.line;
249
- const column = breakpoint.raw.column;
250
- const range = typeof column === 'number' ? new monaco.Range(lineNumber, column, lineNumber, column + 1) : new monaco.Range(lineNumber, 1, lineNumber, 2);
249
+ const column = breakpoint.raw.column || this.editor.getControl().getModel()?.getLineFirstNonWhitespaceColumn(lineNumber) || 1;
250
+ const range = new monaco.Range(lineNumber, column, lineNumber, column + 1);
251
251
  return {
252
252
  range,
253
253
  options: {
@@ -314,19 +314,24 @@ export class DebugEditorModel implements Disposable {
314
314
  }
315
315
  protected createBreakpoints(): SourceBreakpoint[] {
316
316
  const { uri } = this;
317
- const lines = new Set<number>();
317
+ const positions = new Set<string>();
318
318
  const breakpoints: SourceBreakpoint[] = [];
319
319
  for (const decoration of this.breakpointDecorations) {
320
320
  const range = this.editor.getControl().getModel()?.getDecorationRange(decoration);
321
- if (range && !lines.has(range.startLineNumber)) {
321
+ if (range) {
322
322
  const line = range.startLineNumber;
323
323
  const column = range.startColumn;
324
324
  const oldBreakpoint = this.breakpointRanges.get(decoration)?.[1];
325
- const isLineBreakpoint = oldBreakpoint?.raw.line !== undefined && oldBreakpoint?.raw.column === undefined;
326
- const change = isLineBreakpoint ? { line } : { line, column };
327
- const breakpoint = SourceBreakpoint.create(uri, change, oldBreakpoint);
328
- breakpoints.push(breakpoint);
329
- lines.add(line);
325
+ if (oldBreakpoint) {
326
+ const isLineBreakpoint = oldBreakpoint.raw.line !== undefined && oldBreakpoint.raw.column === undefined;
327
+ const position = isLineBreakpoint ? `${line}` : `${line}:${column}`;
328
+ if (!positions.has(position)) {
329
+ const change = isLineBreakpoint ? { line } : { line, column };
330
+ const breakpoint = SourceBreakpoint.create(uri, change, oldBreakpoint);
331
+ breakpoints.push(breakpoint);
332
+ positions.add(position);
333
+ }
334
+ }
330
335
  }
331
336
  }
332
337
  return breakpoints;
@@ -32,7 +32,7 @@ import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model
32
32
  import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures';
33
33
  import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
34
34
  import { DebugVariable, ExpressionContainer, ExpressionItem } from '../console/debug-console-items';
35
- import { DebugPreferences } from '../debug-preferences';
35
+ import { DebugPreferences } from '../../common/debug-preferences';
36
36
  import { DebugStackFrame } from '../model/debug-stack-frame';
37
37
  import { DebugEditorModel } from './debug-editor-model';
38
38
  import { ICodeEditorService } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/codeEditorService';
@@ -23,6 +23,7 @@ import { TreeElement } from '@theia/core/lib/browser/source-tree';
23
23
  import { DebugSession } from '../debug-session';
24
24
  import { BaseBreakpoint } from '../breakpoint/breakpoint-marker';
25
25
  import { BreakpointManager } from '../breakpoint/breakpoint-manager';
26
+ import { nls } from '@theia/core';
26
27
 
27
28
  export class DebugBreakpointData {
28
29
  readonly raw?: DebugProtocol.Breakpoint;
@@ -123,7 +124,7 @@ export abstract class DebugBreakpoint<T extends BaseBreakpoint = BaseBreakpoint>
123
124
  const decoration = this.getBreakpointDecoration();
124
125
  return {
125
126
  className: decoration.className + '-unverified',
126
- message: [this.message || 'Unverified ' + decoration.message[0]]
127
+ message: [this.message || nls.localize('theia/debug/unverifiedBreakpoint', 'Unverified {0}', decoration.message[0])]
127
128
  };
128
129
  }
129
130
 
@@ -131,7 +132,7 @@ export abstract class DebugBreakpoint<T extends BaseBreakpoint = BaseBreakpoint>
131
132
  const decoration = this.getBreakpointDecoration();
132
133
  return {
133
134
  className: decoration.className + '-disabled',
134
- message: [message || ('Disabled ' + decoration.message[0])]
135
+ message: [message || nls.localize('theia/debug/disabledBreakpoint', 'Disabled {0}', decoration.message[0])]
135
136
  };
136
137
  }
137
138
 
@@ -57,7 +57,7 @@ export class DebugInstructionBreakpoint extends DebugBreakpoint<InstructionBreak
57
57
  if (this.origin.condition || this.origin.hitCondition) {
58
58
  return {
59
59
  className: 'codicon-debug-breakpoint-conditional',
60
- message: message || [nls.localizeByDefault('Conditional Breakpoint...')]
60
+ message: message || [nls.localize('theia/debug/conditionalBreakpoint', 'Conditional Breakpoint')]
61
61
  };
62
62
  }
63
63
  return {
@@ -16,7 +16,7 @@
16
16
 
17
17
  import * as React from '@theia/core/shared/react';
18
18
  import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol';
19
- import { RecursivePartial } from '@theia/core';
19
+ import { nls, RecursivePartial } from '@theia/core';
20
20
  import URI from '@theia/core/lib/common/uri';
21
21
  import { EditorWidget, Range } from '@theia/editor/lib/browser';
22
22
  import { TREE_NODE_INFO_CLASS, WidgetOpenerOptions } from '@theia/core/lib/browser';
@@ -163,21 +163,24 @@ export class DebugSourceBreakpoint extends DebugBreakpoint<SourceBreakpoint> imp
163
163
  const { session } = this;
164
164
  if (this.logMessage) {
165
165
  if (session && !session.capabilities.supportsLogPoints) {
166
- return this.getUnsupportedBreakpointDecoration('Logpoints not supported by this debug type');
166
+ return this.getUnsupportedBreakpointDecoration(nls.localize('theia/debug/logpointsNotSupported',
167
+ 'Logpoints not supported by this debug type'));
167
168
  }
168
- messages.push('Log Message: ' + this.logMessage);
169
+ messages.push(nls.localizeByDefault('Log Message: {0}', this.logMessage));
169
170
  }
170
171
  if (this.condition) {
171
172
  if (session && !session.capabilities.supportsConditionalBreakpoints) {
172
- return this.getUnsupportedBreakpointDecoration('Conditional breakpoints not supported by this debug type');
173
+ return this.getUnsupportedBreakpointDecoration(nls.localize('theia/debug/conditionalBreakpointsNotSupported',
174
+ 'Conditional breakpoints not supported by this debug type'));
173
175
  }
174
- messages.push('Expression: ' + this.condition);
176
+ messages.push(nls.localizeByDefault('Condition: {0}', this.condition));
175
177
  }
176
178
  if (this.hitCondition) {
177
179
  if (session && !session.capabilities.supportsHitConditionalBreakpoints) {
178
- return this.getUnsupportedBreakpointDecoration('Hit conditional breakpoints not supported by this debug type');
180
+ return this.getUnsupportedBreakpointDecoration(nls.localize('theia/debug/htiConditionalBreakpointsNotSupported',
181
+ 'Hit conditional breakpoints not supported by this debug type'));
179
182
  }
180
- messages.push('Hit Count: ' + this.hitCondition);
183
+ messages.push(nls.localizeByDefault('Hit Count: {0}', this.hitCondition));
181
184
  }
182
185
  }
183
186
  return super.doGetDecoration(messages);
@@ -194,18 +197,18 @@ export class DebugSourceBreakpoint extends DebugBreakpoint<SourceBreakpoint> imp
194
197
  if (this.logMessage) {
195
198
  return {
196
199
  className: 'codicon-debug-breakpoint-log',
197
- message: message || ['Logpoint']
200
+ message: message || [nls.localizeByDefault('Logpoint')]
198
201
  };
199
202
  }
200
203
  if (this.condition || this.hitCondition) {
201
204
  return {
202
205
  className: 'codicon-debug-breakpoint-conditional',
203
- message: message || ['Conditional Breakpoint']
206
+ message: message || [nls.localize('theia/debug/conditionalBreakpoint', 'Conditional Breakpoint')]
204
207
  };
205
208
  }
206
209
  return {
207
210
  className: 'codicon-debug-breakpoint',
208
- message: message || ['Breakpoint']
211
+ message: message || [nls.localizeByDefault('Breakpoint')]
209
212
  };
210
213
  }
211
214
 
@@ -127,7 +127,7 @@ export class DebugThread extends DebugThreadData implements TreeElement {
127
127
  const response: DebugProtocol.GotoTargetsResponse = await this.session.sendRequest('gotoTargets', { source, line: position.lineNumber, column: position.column });
128
128
 
129
129
  if (response && response.body.targets.length === 0) {
130
- this.session.showMessage(MessageType.Warning, 'No executable code is associated at the current cursor position.');
130
+ this.session.showMessage(MessageType.Warning, nls.localizeByDefault('No executable code is associated at the current cursor position.'));
131
131
  return;
132
132
  }
133
133
 
@@ -71,6 +71,10 @@
71
71
  border-radius: 2px;
72
72
  }
73
73
 
74
+ .theia-source-breakpoint > .theia-input {
75
+ min-height: auto;
76
+ }
77
+
74
78
  .theia-debug-session .status,
75
79
  .theia-debug-thread .status {
76
80
  text-transform: uppercase;
@@ -279,10 +283,10 @@
279
283
  position: absolute;
280
284
  }
281
285
 
282
- .monaco-editor .theia-debug-breakpoint-column::before {
283
- height: 0.9em;
286
+ .monaco-editor .theia-debug-breakpoint-column {
284
287
  display: inline-flex;
285
288
  vertical-align: middle;
289
+ margin-top: -1px;
286
290
  }
287
291
 
288
292
  .monaco-editor .theia-debug-top-stack-frame-column::before {
@@ -20,6 +20,7 @@ import { TreeSource, TreeElement } from '@theia/core/lib/browser/source-tree';
20
20
  import { DebugThread } from '../model/debug-thread';
21
21
  import { DebugViewModel } from './debug-view-model';
22
22
  import debounce = require('p-debounce');
23
+ import { nls } from '@theia/core';
23
24
 
24
25
  @injectable()
25
26
  export class DebugStackFramesSource extends TreeSource {
@@ -62,7 +63,7 @@ export class LoadMoreStackFrames implements TreeElement {
62
63
  ) { }
63
64
 
64
65
  render(): React.ReactNode {
65
- return <span className='theia-load-more-frames'>Load More Stack Frames</span>;
66
+ return <span className='theia-load-more-frames'>{nls.localizeByDefault('Load More Stack Frames')}</span>;
66
67
  }
67
68
 
68
69
  async open(): Promise<void> {
@@ -16,7 +16,7 @@
16
16
 
17
17
  import debounce from 'p-debounce';
18
18
  import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
19
- import { Disposable, DisposableCollection, Event, Emitter, deepClone } from '@theia/core/lib/common';
19
+ import { Disposable, DisposableCollection, Event, Emitter, deepClone, nls } from '@theia/core/lib/common';
20
20
  import URI from '@theia/core/lib/common/uri';
21
21
  import { DebugSession, DebugState } from '../debug-session';
22
22
  import { DebugSessionManager } from '../debug-session-manager';
@@ -78,7 +78,7 @@ export class DebugViewModel implements Disposable {
78
78
  return this.session && this.session.id || '-1';
79
79
  }
80
80
  get label(): string {
81
- return this.session && this.session.label || 'Unknown Session';
81
+ return this.session && this.session.label || nls.localize('theia/debug/unknownSession', 'Unknown Session');
82
82
  }
83
83
 
84
84
  @postConstruct()
@@ -15,11 +15,10 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import { nls } from '@theia/core/lib/common/nls';
18
- import { PreferenceSchema, PreferenceProxy, PreferenceService, createPreferenceProxy, PreferenceContribution } from '@theia/core/lib/browser/preferences';
18
+ import { PreferenceContribution, PreferenceProxy, PreferenceSchema, PreferenceService, createPreferenceProxy } from '@theia/core/lib/common/preferences';
19
19
  import { interfaces } from '@theia/core/shared/inversify';
20
20
 
21
21
  export const debugPreferencesSchema: PreferenceSchema = {
22
- type: 'object',
23
22
  properties: {
24
23
  'debug.trace': {
25
24
  type: 'boolean',
@@ -52,12 +51,12 @@ export const debugPreferencesSchema: PreferenceSchema = {
52
51
  default: 'onFirstSessionStart'
53
52
  },
54
53
  'debug.confirmOnExit': {
55
- description: 'Controls whether to confirm when the window closes if there are active debug sessions.',
54
+ description: nls.localizeByDefault('Controls whether to confirm when the window closes if there are active debug sessions.'),
56
55
  type: 'string',
57
56
  enum: ['never', 'always'],
58
57
  enumDescriptions: [
59
- 'Never confirm.',
60
- 'Always confirm if there are debug sessions.',
58
+ nls.localizeByDefault('Never confirm.'),
59
+ nls.localizeByDefault('Always confirm if there are debug sessions.'),
61
60
  ],
62
61
  default: 'never'
63
62
  },
@@ -15,19 +15,18 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import { interfaces } from '@theia/core/shared/inversify';
18
- import { PreferenceContribution, PreferenceSchema } from '@theia/core/lib/browser/preferences/preference-contribution';
19
- import { launchSchemaId } from '../debug-schema-updater';
20
- import { PreferenceConfiguration } from '@theia/core/lib/browser/preferences/preference-configurations';
21
18
  import { nls } from '@theia/core/lib/common/nls';
19
+ import { PreferenceConfiguration, PreferenceContribution, PreferenceSchema, PreferenceScope } from '@theia/core/lib/common';
20
+
21
+ export const launchSchemaId = 'vscode://schemas/launch';
22
22
 
23
23
  export const launchPreferencesSchema: PreferenceSchema = {
24
- type: 'object',
25
- scope: 'resource',
24
+ scope: PreferenceScope.Folder,
26
25
  properties: {
27
26
  'launch': {
28
27
  $ref: launchSchemaId,
29
28
  description: nls.localizeByDefault("Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces."),
30
- defaultValue: { configurations: [], compounds: [] }
29
+ default: { configurations: [], compounds: [] }
31
30
  }
32
31
  }
33
32
  };
@@ -34,6 +34,8 @@ import {
34
34
  import { DebugServiceImpl } from './debug-service-impl';
35
35
  import { DebugAdapterContributionRegistry } from '../common/debug-adapter-contribution-registry';
36
36
  import { DebugAdapterSessionManager } from './debug-adapter-session-manager';
37
+ import { bindDebugPreferences } from '../common/debug-preferences';
38
+ import { bindLaunchPreferences } from '../common/launch-preferences';
37
39
 
38
40
  const debugConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService }) => {
39
41
  bindContributionProvider(bind, DebugAdapterContribution);
@@ -50,4 +52,6 @@ export default new ContainerModule(bind => {
50
52
  bind(DebugAdapterFactory).to(LaunchBasedDebugAdapterFactory).inSingletonScope();
51
53
  bind(DebugAdapterSessionManager).toSelf().inSingletonScope();
52
54
  bind(MessagingService.Contribution).toService(DebugAdapterSessionManager);
55
+ bindDebugPreferences(bind);
56
+ bindLaunchPreferences(bind);
53
57
  });
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-preferences.js","sourceRoot":"","sources":["../../src/browser/debug-preferences.ts"],"names":[],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"launch-preferences.d.ts","sourceRoot":"","sources":["../../../src/browser/preferences/launch-preferences.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAA0B,gBAAgB,EAAE,MAAM,6DAA6D,CAAC;AAKvH,eAAO,MAAM,uBAAuB,EAAE,gBAUrC,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAGjE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"launch-preferences.js","sourceRoot":"","sources":["../../../src/browser/preferences/launch-preferences.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAGhF,yGAAuH;AACvH,kEAAyD;AACzD,6GAAwG;AACxG,oDAAiD;AAEpC,QAAA,uBAAuB,GAAqB;IACrD,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,UAAU;IACjB,UAAU,EAAE;QACR,QAAQ,EAAE;YACN,IAAI,EAAE,qCAAc;YACpB,WAAW,EAAE,SAAG,CAAC,iBAAiB,CAAC,wHAAwH,CAAC;YAC5J,YAAY,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;SACtD;KACJ;CACJ,CAAC;AAEF,SAAgB,qBAAqB,CAAC,IAAqB;IACvD,IAAI,CAAC,gDAAsB,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,+BAAuB,EAAE,CAAC,CAAC;IAClF,IAAI,CAAC,mDAAuB,CAAC,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AACtE,CAAC;AAHD,sDAGC"}