@theia/debug 1.65.0-next.19 → 1.65.0-next.28

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 (63) hide show
  1. package/lib/browser/debug-configuration-manager.d.ts +2 -2
  2. package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
  3. package/lib/browser/debug-configuration-manager.js +5 -6
  4. package/lib/browser/debug-configuration-manager.js.map +1 -1
  5. package/lib/browser/debug-configuration-model.d.ts +1 -1
  6. package/lib/browser/debug-configuration-model.d.ts.map +1 -1
  7. package/lib/browser/debug-configuration-model.js.map +1 -1
  8. package/lib/browser/debug-frontend-application-contribution.d.ts +12 -3
  9. package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
  10. package/lib/browser/debug-frontend-application-contribution.js +130 -3
  11. package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
  12. package/lib/browser/debug-frontend-module.js +2 -2
  13. package/lib/browser/debug-frontend-module.js.map +1 -1
  14. package/lib/browser/debug-prefix-configuration.d.ts +1 -1
  15. package/lib/browser/debug-prefix-configuration.d.ts.map +1 -1
  16. package/lib/browser/debug-prefix-configuration.js +1 -1
  17. package/lib/browser/debug-prefix-configuration.js.map +1 -1
  18. package/lib/browser/debug-schema-updater.d.ts +0 -1
  19. package/lib/browser/debug-schema-updater.d.ts.map +1 -1
  20. package/lib/browser/debug-schema-updater.js +5 -5
  21. package/lib/browser/debug-schema-updater.js.map +1 -1
  22. package/lib/browser/debug-session-contribution.d.ts +1 -1
  23. package/lib/browser/debug-session-contribution.d.ts.map +1 -1
  24. package/lib/browser/debug-session-contribution.js +1 -1
  25. package/lib/browser/debug-session-contribution.js.map +1 -1
  26. package/lib/browser/disassembly-view/disassembly-view-widget.d.ts +2 -2
  27. package/lib/browser/disassembly-view/disassembly-view-widget.d.ts.map +1 -1
  28. package/lib/browser/disassembly-view/disassembly-view-widget.js +3 -3
  29. package/lib/browser/disassembly-view/disassembly-view-widget.js.map +1 -1
  30. package/lib/browser/editor/debug-editor-model.js +3 -2
  31. package/lib/browser/editor/debug-editor-model.js.map +1 -1
  32. package/lib/browser/editor/debug-inline-value-decorator.d.ts +1 -1
  33. package/lib/browser/editor/debug-inline-value-decorator.d.ts.map +1 -1
  34. package/lib/browser/editor/debug-inline-value-decorator.js +1 -1
  35. package/lib/browser/editor/debug-inline-value-decorator.js.map +1 -1
  36. package/lib/{browser → common}/debug-preferences.d.ts +1 -1
  37. package/lib/{browser → common}/debug-preferences.d.ts.map +1 -1
  38. package/lib/{browser → common}/debug-preferences.js +1 -2
  39. package/lib/common/debug-preferences.js.map +1 -0
  40. package/lib/{browser/preferences → common}/launch-preferences.d.ts +2 -1
  41. package/lib/common/launch-preferences.d.ts.map +1 -0
  42. package/lib/{browser/preferences → common}/launch-preferences.js +8 -10
  43. package/lib/common/launch-preferences.js.map +1 -0
  44. package/lib/node/debug-backend-module.d.ts.map +1 -1
  45. package/lib/node/debug-backend-module.js +4 -0
  46. package/lib/node/debug-backend-module.js.map +1 -1
  47. package/package.json +15 -15
  48. package/src/browser/debug-configuration-manager.ts +2 -3
  49. package/src/browser/debug-configuration-model.ts +1 -2
  50. package/src/browser/debug-frontend-application-contribution.ts +146 -8
  51. package/src/browser/debug-frontend-module.ts +2 -2
  52. package/src/browser/debug-prefix-configuration.ts +1 -1
  53. package/src/browser/debug-schema-updater.ts +2 -2
  54. package/src/browser/debug-session-contribution.ts +1 -1
  55. package/src/browser/disassembly-view/disassembly-view-widget.ts +2 -2
  56. package/src/browser/editor/debug-editor-model.ts +2 -2
  57. package/src/browser/editor/debug-inline-value-decorator.ts +1 -1
  58. package/src/{browser → common}/debug-preferences.ts +1 -2
  59. package/src/{browser/preferences → common}/launch-preferences.ts +5 -6
  60. package/src/node/debug-backend-module.ts +4 -0
  61. package/lib/browser/debug-preferences.js.map +0 -1
  62. package/lib/browser/preferences/launch-preferences.d.ts.map +0 -1
  63. package/lib/browser/preferences/launch-preferences.js.map +0 -1
@@ -20,11 +20,12 @@ 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 } from '@theia/core/lib/common';
23
+ import { MenuModelRegistry, CommandRegistry, MAIN_MENU_BAR, Command, Emitter, Mutable, URI, Event, MessageService, CancellationError } from '@theia/core/lib/common';
24
+ import { waitForEvent } from '@theia/core/lib/common/promise-util';
24
25
  import { EDITOR_CONTEXT_MENU, EDITOR_LINENUMBER_CONTEXT_MENU, EditorManager } from '@theia/editor/lib/browser';
25
26
  import { DebugSessionManager } from './debug-session-manager';
26
27
  import { DebugWidget } from './view/debug-widget';
27
- import { FunctionBreakpoint } from './breakpoint/breakpoint-marker';
28
+ import { FunctionBreakpoint, SourceBreakpoint } from './breakpoint/breakpoint-marker';
28
29
  import { BreakpointManager } from './breakpoint/breakpoint-manager';
29
30
  import { DebugConfigurationManager } from './debug-configuration-manager';
30
31
  import { DebugState, DebugSession } from './debug-session';
@@ -42,7 +43,7 @@ import { DebugEditorService } from './editor/debug-editor-service';
42
43
  import { DebugConsoleContribution } from './console/debug-console-contribution';
43
44
  import { DebugService } from '../common/debug-service';
44
45
  import { DebugSchemaUpdater } from './debug-schema-updater';
45
- import { DebugPreferences } from './debug-preferences';
46
+ import { DebugPreferences } from '../common/debug-preferences';
46
47
  import { RenderedToolbarAction, TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
47
48
  import { DebugWatchWidget } from './view/debug-watch-widget';
48
49
  import { DebugWatchExpression } from './view/debug-watch-expression';
@@ -263,6 +264,16 @@ export namespace DebugCommands {
263
264
  category: DEBUG_CATEGORY,
264
265
  label: 'Jump to Cursor'
265
266
  });
267
+ export const RUN_TO_CURSOR = Command.toDefaultLocalizedCommand({
268
+ id: 'editor.debug.action.runToCursor',
269
+ category: DEBUG_CATEGORY,
270
+ label: 'Run to Cursor'
271
+ });
272
+ export const RUN_TO_LINE = Command.toDefaultLocalizedCommand({
273
+ id: 'editor.debug.action.runToLine',
274
+ category: DEBUG_CATEGORY,
275
+ label: 'Run to Line'
276
+ });
266
277
 
267
278
  export const RESTART_FRAME = Command.toDefaultLocalizedCommand({
268
279
  id: 'debug.frame.restart',
@@ -401,6 +412,9 @@ export namespace DebugEditorContextCommands {
401
412
  export const JUMP_TO_CURSOR = {
402
413
  id: 'debug.editor.context.jumpToCursor'
403
414
  };
415
+ export const RUN_TO_LINE = {
416
+ id: 'debug.editor.context.runToLine'
417
+ };
404
418
  }
405
419
  export namespace DebugBreakpointWidgetCommands {
406
420
  export const ACCEPT = {
@@ -448,6 +462,9 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
448
462
  @inject(EditorManager)
449
463
  protected readonly editorManager: EditorManager;
450
464
 
465
+ @inject(MessageService)
466
+ protected readonly messageService: MessageService;
467
+
451
468
  constructor() {
452
469
  super({
453
470
  widgetId: DebugWidget.ID,
@@ -643,10 +660,12 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
643
660
 
644
661
  const DEBUG_EDITOR_CONTEXT_MENU_GROUP = [...EDITOR_CONTEXT_MENU, '2_debug'];
645
662
  registerMenuActions(DEBUG_EDITOR_CONTEXT_MENU_GROUP,
646
- DebugCommands.JUMP_TO_CURSOR
663
+ DebugCommands.JUMP_TO_CURSOR,
664
+ DebugCommands.RUN_TO_CURSOR,
665
+ DebugCommands.RUN_TO_LINE
647
666
  );
648
667
 
649
- registerMenuActions(DebugEditorModel.CONTEXT_MENU,
668
+ registerMenuActions([...DebugEditorModel.CONTEXT_MENU, '1_breakpoint'],
650
669
  { ...DebugEditorContextCommands.ADD_BREAKPOINT, label: nls.localizeByDefault('Add Breakpoint') },
651
670
  { ...DebugEditorContextCommands.ADD_CONDITIONAL_BREAKPOINT, label: DebugCommands.ADD_CONDITIONAL_BREAKPOINT.label },
652
671
  { ...DebugEditorContextCommands.ADD_LOGPOINT, label: DebugCommands.ADD_LOGPOINT.label },
@@ -657,8 +676,11 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
657
676
  { ...DebugEditorContextCommands.REMOVE_LOGPOINT, label: DebugCommands.REMOVE_LOGPOINT.label },
658
677
  { ...DebugEditorContextCommands.EDIT_LOGPOINT, label: DebugCommands.EDIT_LOGPOINT.label },
659
678
  { ...DebugEditorContextCommands.ENABLE_LOGPOINT, label: nlsEnableBreakpoint('Logpoint') },
660
- { ...DebugEditorContextCommands.DISABLE_LOGPOINT, label: nlsDisableBreakpoint('Logpoint') },
661
- { ...DebugEditorContextCommands.JUMP_TO_CURSOR, label: nls.localizeByDefault('Jump to Cursor') }
679
+ { ...DebugEditorContextCommands.DISABLE_LOGPOINT, label: nlsDisableBreakpoint('Logpoint') }
680
+ );
681
+ registerMenuActions([...DebugEditorModel.CONTEXT_MENU, '2_control'],
682
+ { ...DebugEditorContextCommands.JUMP_TO_CURSOR, label: nls.localizeByDefault('Jump to Cursor') },
683
+ { ...DebugEditorContextCommands.RUN_TO_LINE, label: DebugCommands.RUN_TO_LINE.label }
662
684
  );
663
685
  menus.linkCompoundMenuNode({ newParentPath: EDITOR_LINENUMBER_CONTEXT_MENU, submenuPath: DebugEditorModel.CONTEXT_MENU });
664
686
 
@@ -902,6 +924,29 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
902
924
  isVisible: () => !!this.manager.currentThread && this.manager.currentThread.supportsGoto
903
925
  });
904
926
 
927
+ registry.registerCommand(DebugCommands.RUN_TO_CURSOR, {
928
+ execute: async () => {
929
+ const { model } = this.editors;
930
+ if (model) {
931
+ const { editor, position } = model;
932
+ await this.runTo(editor.getResourceUri(), position.lineNumber, position.column);
933
+ }
934
+ },
935
+ isEnabled: () => !!this.editors.model && !!this.manager.currentThread?.stopped,
936
+ isVisible: () => !!this.editors.model && !!this.manager.currentThread?.stopped
937
+ });
938
+ registry.registerCommand(DebugCommands.RUN_TO_LINE, {
939
+ execute: async () => {
940
+ const { model } = this.editors;
941
+ if (model) {
942
+ const { editor, position } = model;
943
+ await this.runTo(editor.getResourceUri(), position.lineNumber);
944
+ }
945
+ },
946
+ isEnabled: () => !!this.editors.model && !!this.manager.currentThread?.stopped,
947
+ isVisible: () => !!this.editors.model && !!this.manager.currentThread?.stopped
948
+ });
949
+
905
950
  registry.registerCommand(DebugCommands.RESTART_FRAME, {
906
951
  execute: () => this.selectedFrame && this.selectedFrame.restart(),
907
952
  isEnabled: () => !!this.selectedFrame
@@ -1010,6 +1055,18 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1010
1055
  isEnabled: () => !!this.manager.currentThread && this.manager.currentThread.supportsGoto,
1011
1056
  isVisible: () => !!this.manager.currentThread && this.manager.currentThread.supportsGoto
1012
1057
  });
1058
+ registry.registerCommand(DebugEditorContextCommands.RUN_TO_LINE, {
1059
+ execute: async position => {
1060
+ if (this.isPosition(position)) {
1061
+ const { currentUri } = this.editors;
1062
+ if (currentUri) {
1063
+ await this.runTo(currentUri, position.lineNumber);
1064
+ }
1065
+ }
1066
+ },
1067
+ isEnabled: position => this.isPosition(position) && !!this.editors.currentUri && !!this.manager.currentThread?.stopped,
1068
+ isVisible: position => this.isPosition(position) && !!this.editors.currentUri && !!this.manager.currentThread?.stopped
1069
+ });
1013
1070
 
1014
1071
  registry.registerCommand(DebugBreakpointWidgetCommands.ACCEPT, {
1015
1072
  execute: () => this.editors.acceptBreakpoint()
@@ -1258,6 +1315,87 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1258
1315
  await this.manager.start(current);
1259
1316
  }
1260
1317
 
1318
+ async runTo(uri: URI, line: number, column?: number): Promise<void> {
1319
+ const thread = this.manager.currentThread;
1320
+ if (!thread) {
1321
+ return;
1322
+ }
1323
+ const checkThread = () => {
1324
+ if (thread.stopped && thread === this.manager.currentThread) {
1325
+ return true;
1326
+ }
1327
+ console.warn('Cannot run to the specified location. The current thread has changed or is not stopped.');
1328
+ return false;
1329
+ };
1330
+ if (!checkThread()) {
1331
+ return;
1332
+ }
1333
+ const breakpoint = SourceBreakpoint.create(uri, { line, column });
1334
+ let shouldRemoveBreakpoint = this.breakpointManager.addBreakpoint(breakpoint);
1335
+ const removeBreakpoint = () => {
1336
+ const breakpoints = this.breakpointManager.getBreakpoints(uri);
1337
+ const newBreakpoints = breakpoints.filter(bp => bp.id !== breakpoint.id);
1338
+ if (breakpoints.length !== newBreakpoints.length) {
1339
+ this.breakpointManager.setBreakpoints(uri, newBreakpoints);
1340
+ }
1341
+ };
1342
+ try {
1343
+ const sessionBreakpoint = await this.verifyBreakpoint(breakpoint, thread.session);
1344
+ if (!checkThread()) {
1345
+ return;
1346
+ }
1347
+ if (!sessionBreakpoint || !sessionBreakpoint.installed || !sessionBreakpoint.verified) {
1348
+ this.messageService.warn(nls.localize('theia/debug/cannotRunToThisLocation',
1349
+ 'Could not run the current thread to the specified location.'
1350
+ ));
1351
+ return;
1352
+ }
1353
+ const rawBreakpoint = sessionBreakpoint.raw!; // an installed breakpoint always has the underlying raw breakpoint
1354
+ if (rawBreakpoint.line !== line || (column && rawBreakpoint.column !== column)) {
1355
+ const shouldRun = await new ConfirmDialog({
1356
+ title: nls.localize('theia/debug/confirmRunToShiftedPosition_title',
1357
+ 'Cannot run the current thread to exactly the specified location'),
1358
+ msg: nls.localize('theia/debug/confirmRunToShiftedPosition_msg',
1359
+ 'The target position will be shifted to Ln {0}, Col {1}. Run anyway?', rawBreakpoint.line, rawBreakpoint.column || 1),
1360
+ ok: Dialog.YES,
1361
+ cancel: Dialog.NO
1362
+ }).open();
1363
+ if (!shouldRun || !checkThread()) {
1364
+ return;
1365
+ }
1366
+ }
1367
+ if (shouldRemoveBreakpoint) {
1368
+ Event.toPromise(Event.filter(
1369
+ Event.any(this.manager.onDidStopDebugSession, this.manager.onDidDestroyDebugSession),
1370
+ session => session === thread.session
1371
+ )).then(removeBreakpoint);
1372
+ }
1373
+ await thread.continue();
1374
+ shouldRemoveBreakpoint = false;
1375
+ } finally {
1376
+ if (shouldRemoveBreakpoint) {
1377
+ removeBreakpoint();
1378
+ }
1379
+ }
1380
+ }
1381
+
1382
+ protected async verifyBreakpoint(breakpoint: SourceBreakpoint, session: DebugSession, timeout = 2000): Promise<DebugBreakpoint | undefined> {
1383
+ let sessionBreakpoint = session.getBreakpoint(breakpoint.id);
1384
+ if (!sessionBreakpoint || !sessionBreakpoint.installed || !sessionBreakpoint.verified) {
1385
+ try {
1386
+ await waitForEvent(Event.filter(session.onDidChangeBreakpoints, () => {
1387
+ sessionBreakpoint = session.getBreakpoint(breakpoint.id);
1388
+ return !!sessionBreakpoint && sessionBreakpoint.installed && sessionBreakpoint.verified;
1389
+ }), timeout); // wait up to `timeout` ms for the breakpoint to become installed and verified
1390
+ } catch (e) {
1391
+ if (!(e instanceof CancellationError)) { // ignore the `CancellationError` on timeout
1392
+ throw e;
1393
+ }
1394
+ }
1395
+ }
1396
+ return sessionBreakpoint;
1397
+ }
1398
+
1261
1399
  get threads(): DebugThreadsWidget | undefined {
1262
1400
  const { currentWidget } = this.shell;
1263
1401
  return currentWidget instanceof DebugThreadsWidget && currentWidget || undefined;
@@ -1344,7 +1482,7 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1344
1482
  return watch && watch.selectedElement instanceof DebugWatchExpression && watch.selectedElement || undefined;
1345
1483
  }
1346
1484
 
1347
- protected isPosition(position: unknown): boolean {
1485
+ protected isPosition(position: unknown): position is monaco.IPosition {
1348
1486
  return monaco.Position.isIPosition(position);
1349
1487
  }
1350
1488
 
@@ -40,10 +40,10 @@ import { DebugConsoleContribution } from './console/debug-console-contribution';
40
40
  import { BreakpointManager } from './breakpoint/breakpoint-manager';
41
41
  import { DebugEditorService } from './editor/debug-editor-service';
42
42
  import { DebugEditorModelFactory, DebugEditorModel } from './editor/debug-editor-model';
43
- import { bindDebugPreferences } from './debug-preferences';
43
+ import { bindDebugPreferences } from '../common/debug-preferences';
44
44
  import { DebugSchemaUpdater } from './debug-schema-updater';
45
45
  import { DebugCallStackItemTypeKey } from './debug-call-stack-item-type-key';
46
- import { bindLaunchPreferences } from './preferences/launch-preferences';
46
+ import { bindLaunchPreferences } from '../common/launch-preferences';
47
47
  import { DebugPrefixConfiguration } from './debug-prefix-configuration';
48
48
  import { CommandContribution } from '@theia/core/lib/common/command';
49
49
  import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
@@ -24,7 +24,7 @@ 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
29
  import { CancellationToken } from '@theia/core/lib/common';
30
30
 
@@ -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';
@@ -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';
@@ -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: {
@@ -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';
@@ -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',
@@ -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":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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;;;AAEhF,oDAAiD;AACjD,qEAA0J;AAG7I,QAAA,sBAAsB,GAAqB;IACpD,IAAI,EAAE,QAAQ;IACd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uB,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"}