@theia/debug 1.29.0-next.20 → 1.29.0-next.22

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 (51) hide show
  1. package/lib/browser/debug-configuration-manager.d.ts +15 -7
  2. package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
  3. package/lib/browser/debug-configuration-manager.js +81 -31
  4. package/lib/browser/debug-configuration-manager.js.map +1 -1
  5. package/lib/browser/debug-configuration-model.d.ts +3 -0
  6. package/lib/browser/debug-configuration-model.d.ts.map +1 -1
  7. package/lib/browser/debug-configuration-model.js +17 -10
  8. package/lib/browser/debug-configuration-model.js.map +1 -1
  9. package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
  10. package/lib/browser/debug-frontend-application-contribution.js +6 -3
  11. package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
  12. package/lib/browser/debug-prefix-configuration.js +3 -3
  13. package/lib/browser/debug-prefix-configuration.js.map +1 -1
  14. package/lib/browser/debug-schema-updater.d.ts.map +1 -1
  15. package/lib/browser/debug-schema-updater.js +55 -4
  16. package/lib/browser/debug-schema-updater.js.map +1 -1
  17. package/lib/browser/debug-session-contribution.d.ts +2 -2
  18. package/lib/browser/debug-session-contribution.d.ts.map +1 -1
  19. package/lib/browser/debug-session-contribution.js.map +1 -1
  20. package/lib/browser/debug-session-manager.d.ts +10 -4
  21. package/lib/browser/debug-session-manager.d.ts.map +1 -1
  22. package/lib/browser/debug-session-manager.js +64 -7
  23. package/lib/browser/debug-session-manager.js.map +1 -1
  24. package/lib/browser/debug-session-options.d.ts +36 -6
  25. package/lib/browser/debug-session-options.d.ts.map +1 -1
  26. package/lib/browser/debug-session-options.js +53 -10
  27. package/lib/browser/debug-session-options.js.map +1 -1
  28. package/lib/browser/debug-session.d.ts +3 -3
  29. package/lib/browser/debug-session.d.ts.map +1 -1
  30. package/lib/browser/debug-session.js +7 -0
  31. package/lib/browser/debug-session.js.map +1 -1
  32. package/lib/browser/view/debug-configuration-select.d.ts +4 -1
  33. package/lib/browser/view/debug-configuration-select.d.ts.map +1 -1
  34. package/lib/browser/view/debug-configuration-select.js +36 -14
  35. package/lib/browser/view/debug-configuration-select.js.map +1 -1
  36. package/lib/common/debug-compound.d.ts +15 -0
  37. package/lib/common/debug-compound.d.ts.map +1 -0
  38. package/lib/common/debug-compound.js +27 -0
  39. package/lib/common/debug-compound.js.map +1 -0
  40. package/package.json +14 -14
  41. package/src/browser/debug-configuration-manager.ts +92 -40
  42. package/src/browser/debug-configuration-model.ts +19 -10
  43. package/src/browser/debug-frontend-application-contribution.ts +10 -3
  44. package/src/browser/debug-prefix-configuration.ts +3 -3
  45. package/src/browser/debug-schema-updater.ts +56 -5
  46. package/src/browser/debug-session-contribution.ts +2 -2
  47. package/src/browser/debug-session-manager.ts +79 -8
  48. package/src/browser/debug-session-options.ts +72 -15
  49. package/src/browser/debug-session.tsx +8 -2
  50. package/src/browser/view/debug-configuration-select.tsx +42 -20
  51. package/src/common/debug-compound.ts +32 -0
@@ -38,8 +38,9 @@ class DebugConfigurationSelect extends React.Component {
38
38
  this.selectDynamicConfigFromQuickPick(providerType);
39
39
  }
40
40
  else {
41
- const { name, type, request, workspaceFolderUri, providerType } = debug_session_options_1.InternalDebugSessionOptions.parseValue(value);
42
- this.manager.current = this.manager.find({ name, type, request }, workspaceFolderUri, providerType === 'undefined' ? undefined : providerType);
41
+ const data = JSON.parse(value);
42
+ this.manager.current = data;
43
+ this.refreshDebugConfigurations();
43
44
  }
44
45
  };
45
46
  this.refreshDebugConfigurations = async () => {
@@ -50,8 +51,9 @@ class DebugConfigurationSelect extends React.Component {
50
51
  providerTypes.push(type);
51
52
  }
52
53
  }
53
- this.selectRef.current.value = this.currentValue;
54
- this.setState({ providerTypes, currentValue: this.currentValue });
54
+ const value = this.currentValue;
55
+ this.selectRef.current.value = value;
56
+ this.setState({ providerTypes, currentValue: value });
55
57
  };
56
58
  this.manager = props.manager;
57
59
  this.quickInputService = props.quickInputService;
@@ -67,11 +69,26 @@ class DebugConfigurationSelect extends React.Component {
67
69
  this.refreshDebugConfigurations();
68
70
  }
69
71
  render() {
70
- return React.createElement(select_component_1.SelectComponent, { options: this.renderOptions(), defaultValue: this.currentValue, onChange: option => this.setCurrentConfiguration(option), onFocus: () => this.refreshDebugConfigurations(), onBlur: () => this.refreshDebugConfigurations(), ref: this.selectRef });
72
+ return React.createElement(select_component_1.SelectComponent, { options: this.renderOptions(), defaultValue: this.state.currentValue, onChange: option => this.setCurrentConfiguration(option), onFocus: () => this.refreshDebugConfigurations(), onBlur: () => this.refreshDebugConfigurations(), ref: this.selectRef });
71
73
  }
72
74
  get currentValue() {
73
75
  const { current } = this.manager;
74
- return current ? debug_session_options_1.InternalDebugSessionOptions.toValue(current) : DebugConfigurationSelect.NO_CONFIGURATION;
76
+ const matchingOption = this.getCurrentOption(current);
77
+ return matchingOption ? matchingOption.value : current ? JSON.stringify(current) : DebugConfigurationSelect.NO_CONFIGURATION;
78
+ }
79
+ getCurrentOption(current) {
80
+ if (!current || !this.selectRef.current) {
81
+ return;
82
+ }
83
+ const matchingOption = this.selectRef.current.options.find(option => option.userData === DebugConfigurationSelect.CONFIG_MARKER
84
+ && this.matchesOption(JSON.parse(option.value), current));
85
+ return matchingOption;
86
+ }
87
+ matchesOption(sessionOption, current) {
88
+ const matchesNameAndWorkspace = sessionOption.name === current.name && sessionOption.workspaceFolderUri === current.workspaceFolderUri;
89
+ return debug_session_options_1.DebugSessionOptions.isConfiguration(sessionOption) && debug_session_options_1.DebugSessionOptions.isConfiguration(current)
90
+ ? matchesNameAndWorkspace && sessionOption.providerType === current.providerType
91
+ : matchesNameAndWorkspace;
75
92
  }
76
93
  toPickValue(providerType) {
77
94
  return DebugConfigurationSelect.PICK + providerType;
@@ -114,10 +131,11 @@ class DebugConfigurationSelect extends React.Component {
114
131
  const options = [];
115
132
  // Add non dynamic debug configurations
116
133
  for (const config of this.manager.all) {
117
- const value = debug_session_options_1.InternalDebugSessionOptions.toValue(config);
134
+ const value = JSON.stringify(config);
118
135
  options.push({
119
136
  value,
120
- label: this.toName(config, this.props.isMultiRoot)
137
+ label: this.toName(config, this.props.isMultiRoot),
138
+ userData: DebugConfigurationSelect.CONFIG_MARKER
121
139
  });
122
140
  }
123
141
  // Add recently used dynamic debug configurations
@@ -129,10 +147,11 @@ class DebugConfigurationSelect extends React.Component {
129
147
  });
130
148
  }
131
149
  for (const dynamicOption of recentDynamicOptions) {
132
- const value = debug_session_options_1.InternalDebugSessionOptions.toValue(dynamicOption);
150
+ const value = JSON.stringify(dynamicOption);
133
151
  options.push({
134
152
  value,
135
- label: this.toName(dynamicOption, this.props.isMultiRoot) + ' (' + dynamicOption.providerType + ')'
153
+ label: this.toName(dynamicOption, this.props.isMultiRoot) + ' (' + dynamicOption.providerType + ')',
154
+ userData: DebugConfigurationSelect.CONFIG_MARKER
136
155
  });
137
156
  }
138
157
  }
@@ -168,11 +187,13 @@ class DebugConfigurationSelect extends React.Component {
168
187
  });
169
188
  return options;
170
189
  }
171
- toName({ configuration, workspaceFolderUri }, multiRoot) {
172
- if (!workspaceFolderUri || !multiRoot) {
173
- return configuration.name;
190
+ toName(options, multiRoot) {
191
+ var _a, _b;
192
+ const name = (_b = (_a = options.configuration) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : options.name;
193
+ if (!options.workspaceFolderUri || !multiRoot) {
194
+ return name;
174
195
  }
175
- return `${configuration.name} (${new uri_1.default(workspaceFolderUri).path.base})`;
196
+ return `${name} (${new uri_1.default(options.workspaceFolderUri).path.base})`;
176
197
  }
177
198
  }
178
199
  exports.DebugConfigurationSelect = DebugConfigurationSelect;
@@ -180,4 +201,5 @@ DebugConfigurationSelect.SEPARATOR = '──────────';
180
201
  DebugConfigurationSelect.PICK = '__PICK__';
181
202
  DebugConfigurationSelect.NO_CONFIGURATION = '__NO_CONF__';
182
203
  DebugConfigurationSelect.ADD_CONFIGURATION = '__ADD_CONF__';
204
+ DebugConfigurationSelect.CONFIG_MARKER = '__CONFIG__';
183
205
  //# sourceMappingURL=debug-configuration-select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"debug-configuration-select.js","sourceRoot":"","sources":["../../../src/browser/view/debug-configuration-select.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,oDAA6C;AAC7C,kDAAkD;AAElD,oEAA4F;AAC5F,uFAAiG;AAEjG,oDAAiD;AAejD,MAAa,wBAAyB,SAAQ,KAAK,CAAC,SAAkE;IAUlH,YAAY,KAAoC;QAC5C,KAAK,CAAC,KAAK,CAAC,CAAC;QALA,cAAS,GAAG,KAAK,CAAC,SAAS,EAAmB,CAAC;QAqC7C,4BAAuB,GAAG,CAAC,MAAoB,EAAE,EAAE;YAClE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;YAC3B,IAAI,CAAC,KAAK,EAAE;gBACR,OAAO,KAAK,CAAC;aAChB;iBAAM,IAAI,KAAK,KAAK,wBAAwB,CAAC,iBAAiB,EAAE;gBAC7D,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;aACnC;iBAAM,IAAI,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE;gBACxD,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBAChD,IAAI,CAAC,gCAAgC,CAAC,YAAY,CAAC,CAAC;aACvD;iBAAM;gBACH,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAG,mDAA2B,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBAChH,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CACpC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EACvB,kBAAkB,EAClB,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAA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;YACnC,OAAO,aAAa,CAAC,IAAI,CAAC;SAC7B;QACD,OAAO,GAAG,aAAa,CAAC,IAAI,KAAK,IAAI,aAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;IAC9E,CAAC;;AAnML,4DAoMC;AAnM6B,kCAAS,GAAG,YAAY,CAAC;AACzB,6BAAI,GAAG,UAAU,CAAC;AAClB,yCAAgB,GAAG,aAAa,CAAC;AACjC,0CAAiB,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"debug-configuration-select.js","sourceRoot":"","sources":["../../../src/browser/view/debug-configuration-select.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,oDAA6C;AAC7C,kDAAkD;AAElD,oEAA+D;AAC/D,uFAAiG;AAEjG,oDAAiD;AAejD,MAAa,wBAAyB,SAAQ,KAAK,CAAC,SAAkE;IAWlH,YAAY,KAAoC;QAC5C,KAAK,CAAC,KAAK,CAAC,CAAC;QALA,cAAS,GAAG,KAAK,CAAC,SAAS,EAAmB,CAAC;QAwD7C,4BAAuB,GAAG,CAAC,MAAoB,EAAE,EAAE;YAClE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;YAC3B,IAAI,CAAC,KAAK,EAAE;gBACR,OAAO,KAAK,CAAC;aAChB;iBAAM,IAAI,KAAK,KAAK,wBAAwB,CAAC,iBAAiB,EAAE;gBAC7D,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;aACnC;iBAAM,IAAI,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE;gBACxD,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBAChD,IAAI,CAAC,gCAAgC,CAAC,YAAY,CAAC,CAAC;aACvD;iBAAM;gBACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAwB,CAAC;gBACtD,IAAI,CAAC,OAAO,CAA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,IAAI,aAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;IACxE,CAAC;;AAzNL,4DA0NC;AAzN6B,kCAAS,GAAG,YAAY,CAAC;AACzB,6BAAI,GAAG,UAAU,CAAC;AAClB,yCAAgB,GAAG,aAAa,CAAC;AACjC,0CAAiB,GAAG,cAAc,CAAC;AACnC,sCAAa,GAAG,YAAY,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { TaskIdentifier } from '@theia/task/lib/common';
2
+ export declare const defaultCompound: DebugCompound;
3
+ export interface DebugCompound {
4
+ name: string;
5
+ stopAll?: boolean;
6
+ preLaunchTask?: string | TaskIdentifier;
7
+ configurations: (string | {
8
+ name: string;
9
+ folder: string;
10
+ })[];
11
+ }
12
+ export declare namespace DebugCompound {
13
+ function is(arg: unknown): arg is DebugCompound;
14
+ }
15
+ //# sourceMappingURL=debug-compound.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-compound.d.ts","sourceRoot":"","sources":["../../src/common/debug-compound.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,eAAO,MAAM,eAAe,EAAE,aAAwD,CAAC;AAEvF,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;IACxC,cAAc,EAAE,CAAC,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CACjE;AAED,yBAAiB,aAAa,CAAC;IAC3B,SAAgB,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,aAAa,CAErD;CACJ"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2022 EclipseSource and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DebugCompound = exports.defaultCompound = void 0;
19
+ exports.defaultCompound = { name: 'Compound', configurations: [] };
20
+ var DebugCompound;
21
+ (function (DebugCompound) {
22
+ function is(arg) {
23
+ return !!arg && typeof arg === 'object' && 'name' in arg && 'configurations' in arg;
24
+ }
25
+ DebugCompound.is = is;
26
+ })(DebugCompound = exports.DebugCompound || (exports.DebugCompound = {}));
27
+ //# sourceMappingURL=debug-compound.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-compound.js","sourceRoot":"","sources":["../../src/common/debug-compound.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAInE,QAAA,eAAe,GAAkB,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;AASvF,IAAiB,aAAa,CAI7B;AAJD,WAAiB,aAAa;IAC1B,SAAgB,EAAE,CAAC,GAAY;QAC3B,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,IAAI,GAAG,IAAI,gBAAgB,IAAI,GAAG,CAAC;IACxF,CAAC;IAFe,gBAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAI7B"}
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@theia/debug",
3
- "version": "1.29.0-next.20+1c0253adc71",
3
+ "version": "1.29.0-next.22+e5333672c80",
4
4
  "description": "Theia - Debug Extension",
5
5
  "dependencies": {
6
- "@theia/console": "1.29.0-next.20+1c0253adc71",
7
- "@theia/core": "1.29.0-next.20+1c0253adc71",
8
- "@theia/editor": "1.29.0-next.20+1c0253adc71",
9
- "@theia/filesystem": "1.29.0-next.20+1c0253adc71",
10
- "@theia/markers": "1.29.0-next.20+1c0253adc71",
11
- "@theia/monaco": "1.29.0-next.20+1c0253adc71",
6
+ "@theia/console": "1.29.0-next.22+e5333672c80",
7
+ "@theia/core": "1.29.0-next.22+e5333672c80",
8
+ "@theia/editor": "1.29.0-next.22+e5333672c80",
9
+ "@theia/filesystem": "1.29.0-next.22+e5333672c80",
10
+ "@theia/markers": "1.29.0-next.22+e5333672c80",
11
+ "@theia/monaco": "1.29.0-next.22+e5333672c80",
12
12
  "@theia/monaco-editor-core": "1.67.2",
13
- "@theia/output": "1.29.0-next.20+1c0253adc71",
14
- "@theia/process": "1.29.0-next.20+1c0253adc71",
15
- "@theia/task": "1.29.0-next.20+1c0253adc71",
16
- "@theia/terminal": "1.29.0-next.20+1c0253adc71",
17
- "@theia/variable-resolver": "1.29.0-next.20+1c0253adc71",
18
- "@theia/workspace": "1.29.0-next.20+1c0253adc71",
13
+ "@theia/output": "1.29.0-next.22+e5333672c80",
14
+ "@theia/process": "1.29.0-next.22+e5333672c80",
15
+ "@theia/task": "1.29.0-next.22+e5333672c80",
16
+ "@theia/terminal": "1.29.0-next.22+e5333672c80",
17
+ "@theia/variable-resolver": "1.29.0-next.22+e5333672c80",
18
+ "@theia/workspace": "1.29.0-next.22+e5333672c80",
19
19
  "jsonc-parser": "^2.2.0",
20
20
  "mkdirp": "^0.5.0",
21
21
  "p-debounce": "^2.1.0",
@@ -68,5 +68,5 @@
68
68
  "nyc": {
69
69
  "extends": "../../configs/nyc.json"
70
70
  },
71
- "gitHead": "1c0253adc71fa59d6ca7aef0797d3ba0c7d7d36c"
71
+ "gitHead": "e5333672c80f6aaa99198717f7601e991a35182f"
72
72
  }
@@ -30,7 +30,7 @@ import { LabelProvider, PreferenceScope, PreferenceService, QuickPickValue, Stor
30
30
  import { QuickPickService } from '@theia/core/lib/common/quick-pick-service';
31
31
  import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
32
32
  import { DebugConfigurationModel } from './debug-configuration-model';
33
- import { DebugSessionOptions } from './debug-session-options';
33
+ import { DebugSessionOptions, DynamicDebugConfigurationSessionOptions } from './debug-session-options';
34
34
  import { DebugService } from '../common/debug-service';
35
35
  import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service';
36
36
  import { DebugConfiguration } from '../common/debug-common';
@@ -41,6 +41,7 @@ import * as monaco from '@theia/monaco-editor-core';
41
41
  import { ICommandService } from '@theia/monaco-editor-core/esm/vs/platform/commands/common/commands';
42
42
  import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
43
43
  import { nls } from '@theia/core';
44
+ import { DebugCompound } from '../common/debug-compound';
44
45
 
45
46
  export interface WillProvideDebugConfiguration extends WaitUntilEvent {
46
47
  }
@@ -94,7 +95,7 @@ export class DebugConfigurationManager {
94
95
 
95
96
  protected initialized: Promise<void>;
96
97
 
97
- protected recentDynamicOptionsTracker: DebugSessionOptions[] = [];
98
+ protected recentDynamicOptionsTracker: DynamicDebugConfigurationSessionOptions[] = [];
98
99
 
99
100
  @postConstruct()
100
101
  protected async init(): Promise<void> {
@@ -141,10 +142,10 @@ export class DebugConfigurationManager {
141
142
  protected *getAll(): IterableIterator<DebugSessionOptions> {
142
143
  for (const model of this.models.values()) {
143
144
  for (const configuration of model.configurations) {
144
- yield {
145
- configuration,
146
- workspaceFolderUri: model.workspaceFolderUri
147
- };
145
+ yield this.configurationToOptions(configuration, model.workspaceFolderUri);
146
+ }
147
+ for (const compound of model.compounds) {
148
+ yield this.compoundToOptions(compound, model.workspaceFolderUri);
148
149
  }
149
150
  }
150
151
  }
@@ -159,7 +160,7 @@ export class DebugConfigurationManager {
159
160
  }
160
161
  protected *doGetSupported(debugTypes: Set<string>): IterableIterator<DebugSessionOptions> {
161
162
  for (const options of this.getAll()) {
162
- if (debugTypes.has(options.configuration.type)) {
163
+ if (options.configuration && debugTypes.has(options.configuration.type)) {
163
164
  yield options;
164
165
  }
165
166
  }
@@ -171,8 +172,7 @@ export class DebugConfigurationManager {
171
172
  }
172
173
 
173
174
  async getSelectedConfiguration(): Promise<DebugSessionOptions | undefined> {
174
- // providerType applies to dynamic configurations only
175
- if (!this._currentOptions?.providerType) {
175
+ if (!DebugSessionOptions.isDynamic(this._currentOptions)) {
176
176
  return this._currentOptions;
177
177
  }
178
178
 
@@ -188,7 +188,7 @@ export class DebugConfigurationManager {
188
188
  throw new Error(message);
189
189
  }
190
190
 
191
- return { configuration, providerType };
191
+ return { name, configuration, providerType };
192
192
  }
193
193
 
194
194
  set current(option: DebugSessionOptions | undefined) {
@@ -197,7 +197,7 @@ export class DebugConfigurationManager {
197
197
  }
198
198
 
199
199
  protected updateRecentlyUsedDynamicConfigurationOptions(option: DebugSessionOptions | undefined): void {
200
- if (option?.providerType) { // if it's a dynamic configuration option
200
+ if (DebugSessionOptions.isDynamic(option)) {
201
201
  // Removing an item already present in the list
202
202
  const index = this.recentDynamicOptionsTracker.findIndex(item => this.dynamicOptionsMatch(item, option));
203
203
  if (index > -1) {
@@ -212,32 +212,33 @@ export class DebugConfigurationManager {
212
212
  }
213
213
  }
214
214
 
215
- protected dynamicOptionsMatch(one: DebugSessionOptions, other: DebugSessionOptions): boolean {
215
+ protected dynamicOptionsMatch(one: DynamicDebugConfigurationSessionOptions, other: DynamicDebugConfigurationSessionOptions): boolean {
216
216
  return one.providerType !== undefined
217
- && one.configuration.name === other.configuration.name
218
- && one.providerType === other.providerType;
217
+ && one.configuration.name === other.configuration.name
218
+ && one.providerType === other.providerType;
219
219
  }
220
220
 
221
- get recentDynamicOptions(): readonly DebugSessionOptions[] {
221
+ get recentDynamicOptions(): readonly DynamicDebugConfigurationSessionOptions[] {
222
222
  return this.recentDynamicOptionsTracker;
223
223
  }
224
224
 
225
225
  protected updateCurrent(options: DebugSessionOptions | undefined = this._currentOptions): void {
226
- this._currentOptions = options && this.find(options.configuration, options.workspaceFolderUri, options.providerType);
226
+ if (DebugSessionOptions.isCompound(options)) {
227
+ this._currentOptions = options && this.find(options.compound, options.workspaceFolderUri);
228
+ } else {
229
+ this._currentOptions = options && this.find(options.configuration, options.workspaceFolderUri, options.providerType);
230
+ }
227
231
 
228
232
  if (!this._currentOptions) {
229
233
  const model = this.getModel();
230
234
  if (model) {
231
235
  const configuration = model.configurations[0];
232
236
  if (configuration) {
233
- this._currentOptions = {
234
- configuration,
235
- workspaceFolderUri: model.workspaceFolderUri
236
- };
237
+ this._currentOptions = this.configurationToOptions(configuration, model.workspaceFolderUri);
237
238
  }
238
239
  }
239
240
  }
240
- this.debugConfigurationTypeKey.set(this.current && this.current.configuration.type);
241
+ this.debugConfigurationTypeKey.set(this.current && this.current.configuration?.type);
241
242
  this.onDidChangeEmitter.fire(undefined);
242
243
  }
243
244
 
@@ -248,24 +249,57 @@ export class DebugConfigurationManager {
248
249
  /**
249
250
  * Find / Resolve DebugSessionOptions from a given target debug configuration
250
251
  */
251
- find(targetConfiguration: DebugConfiguration, workspaceFolderUri?: string, providerType?: string): DebugSessionOptions | undefined;
252
- find(nameOrTargetConfiguration: string | DebugConfiguration, workspaceFolderUri?: string, providerType?: string): DebugSessionOptions | undefined {
253
- // providerType is only applicable to dynamic debug configurations
254
- if (typeof nameOrTargetConfiguration === 'object' && providerType) {
255
- return {
256
- configuration: nameOrTargetConfiguration,
257
- providerType
258
- };
259
- }
260
- const name = typeof nameOrTargetConfiguration === 'string' ? nameOrTargetConfiguration : nameOrTargetConfiguration.name;
252
+ find(compound: DebugCompound, workspaceFolderUri?: string): DebugSessionOptions | undefined;
253
+ find(configuration: DebugConfiguration, workspaceFolderUri?: string, providerType?: string): DebugSessionOptions | undefined;
254
+ find(name: string, workspaceFolderUri?: string, providerType?: string): DebugSessionOptions | undefined;
255
+ find(nameOrConfigurationOrCompound: string | DebugConfiguration | DebugCompound, workspaceFolderUri?: string, providerType?: string): DebugSessionOptions | undefined {
256
+ if (DebugConfiguration.is(nameOrConfigurationOrCompound) && providerType) {
257
+ // providerType is only applicable to dynamic debug configurations and may only be created if we have a configuration given
258
+ return this.configurationToOptions(nameOrConfigurationOrCompound, workspaceFolderUri, providerType);
259
+ }
260
+ const name = typeof nameOrConfigurationOrCompound === 'string' ? nameOrConfigurationOrCompound : nameOrConfigurationOrCompound.name;
261
+ const configuration = this.findConfiguration(name, workspaceFolderUri);
262
+ if (configuration) {
263
+ return this.configurationToOptions(configuration, workspaceFolderUri);
264
+ }
265
+ const compound = this.findCompound(name, workspaceFolderUri);
266
+ if (compound) {
267
+ return this.compoundToOptions(compound, workspaceFolderUri);
268
+ }
269
+ }
270
+
271
+ findConfigurations(name: string, workspaceFolderUri?: string): DebugConfiguration[] {
272
+ const matches = [];
261
273
  for (const model of this.models.values()) {
262
274
  if (model.workspaceFolderUri === workspaceFolderUri) {
263
275
  for (const configuration of model.configurations) {
264
276
  if (configuration.name === name) {
265
- return {
266
- configuration,
267
- workspaceFolderUri
268
- };
277
+ matches.push(configuration);
278
+ }
279
+ }
280
+ }
281
+ }
282
+ return matches;
283
+ }
284
+
285
+ findConfiguration(name: string, workspaceFolderUri?: string): DebugConfiguration | undefined {
286
+ for (const model of this.models.values()) {
287
+ if (model.workspaceFolderUri === workspaceFolderUri) {
288
+ for (const configuration of model.configurations) {
289
+ if (configuration.name === name) {
290
+ return configuration;
291
+ }
292
+ }
293
+ }
294
+ }
295
+ }
296
+
297
+ findCompound(name: string, workspaceFolderUri?: string): DebugCompound | undefined {
298
+ for (const model of this.models.values()) {
299
+ if (model.workspaceFolderUri === workspaceFolderUri) {
300
+ for (const compound of model.compounds) {
301
+ if (compound.name === name) {
302
+ return compound;
269
303
  }
270
304
  }
271
305
  }
@@ -279,6 +313,14 @@ export class DebugConfigurationManager {
279
313
  }
280
314
  }
281
315
 
316
+ protected configurationToOptions(configuration: DebugConfiguration, workspaceFolderUri?: string, providerType?: string): DebugSessionOptions {
317
+ return { name: configuration.name, configuration, providerType, workspaceFolderUri };
318
+ }
319
+
320
+ protected compoundToOptions(compound: DebugCompound, workspaceFolderUri?: string): DebugSessionOptions {
321
+ return { name: compound.name, compound, workspaceFolderUri };
322
+ }
323
+
282
324
  async addConfiguration(): Promise<void> {
283
325
  let rootUri: URI | undefined = undefined;
284
326
  if (this.workspaceService.saved && this.workspaceService.tryGetRoots().length > 1) {
@@ -345,7 +387,8 @@ export class DebugConfigurationManager {
345
387
  });
346
388
  }
347
389
  const root = await this.quickPickService.show(items, {
348
- placeholder: nls.localize('theia/debug/addConfigurationPlaceholder', 'Select workspace root to add configuration to')
390
+ placeholder: nls.localize('theia/debug/addConfigurationPlaceholder', 'Select workspace root to add configuration to'),
391
+ ignoreFocusOut: true
349
392
  });
350
393
  return root?.value;
351
394
  }
@@ -469,17 +512,26 @@ export class DebugConfigurationManager {
469
512
 
470
513
  // Between versions v1.26 and v1.27, the expected format of the data changed so that old stored data
471
514
  // may not contain the configuration key.
472
- if (data.current && 'configuration' in data.current) {
515
+ if (DebugSessionOptions.isConfiguration(data.current)) {
516
+ // ensure options name is reflected from old configurations data
517
+ data.current.name = data.current.name ?? data.current.configuration?.name;
473
518
  this.current = this.find(data.current.configuration, data.current.workspaceFolderUri, data.current.providerType);
519
+ } else if (DebugSessionOptions.isCompound(data.current)) {
520
+ this.current = this.find(data.current.name, data.current.workspaceFolderUri);
474
521
  }
475
522
  }
476
523
 
477
- protected resolveRecentDynamicOptionsFromData(options?: DebugSessionOptions[]): void {
524
+ protected resolveRecentDynamicOptionsFromData(options?: DynamicDebugConfigurationSessionOptions[]): void {
478
525
  if (!options || this.recentDynamicOptionsTracker.length !== 0) {
479
526
  return;
480
527
  }
481
528
 
482
- this.recentDynamicOptionsTracker = options;
529
+ // ensure options name is reflected from old configurations data
530
+ const dynamicOptions = options.map(option => {
531
+ option.name = option.name ?? option.configuration.name;
532
+ return option;
533
+ }).filter(DebugSessionOptions.isDynamic);
534
+ this.recentDynamicOptionsTracker = dynamicOptions;
483
535
  }
484
536
 
485
537
  save(): void {
@@ -502,6 +554,6 @@ export class DebugConfigurationManager {
502
554
  export namespace DebugConfigurationManager {
503
555
  export interface Data {
504
556
  current?: DebugSessionOptions,
505
- recentDynamicOptions?: DebugSessionOptions[]
557
+ recentDynamicOptions?: DynamicDebugConfigurationSessionOptions[]
506
558
  }
507
559
  }
@@ -19,6 +19,7 @@ import { Emitter, Event } from '@theia/core/lib/common/event';
19
19
  import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
20
20
  import { DebugConfiguration } from '../common/debug-common';
21
21
  import { PreferenceService } from '@theia/core/lib/browser/preferences/preference-service';
22
+ import { DebugCompound } from '../common/debug-compound';
22
23
 
23
24
  export class DebugConfigurationModel implements Disposable {
24
25
 
@@ -58,6 +59,10 @@ export class DebugConfigurationModel implements Disposable {
58
59
  return this.json.configurations;
59
60
  }
60
61
 
62
+ get compounds(): DebugCompound[] {
63
+ return this.json.compounds;
64
+ }
65
+
61
66
  async reconcile(): Promise<void> {
62
67
  this.json = this.parseConfigurations();
63
68
  this.onDidChangeEmitter.fire(undefined);
@@ -66,19 +71,22 @@ export class DebugConfigurationModel implements Disposable {
66
71
  const configurations: DebugConfiguration[] = [];
67
72
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
73
  const { configUri, value } = this.preferences.resolve<any>('launch', undefined, this.workspaceFolderUri);
69
- if (value && typeof value === 'object' && 'configurations' in value) {
70
- if (Array.isArray(value.configurations)) {
71
- for (const configuration of value.configurations) {
72
- if (DebugConfiguration.is(configuration)) {
73
- configurations.push(configuration);
74
- }
74
+ if (value && typeof value === 'object' && Array.isArray(value.configurations)) {
75
+ for (const configuration of value.configurations) {
76
+ if (DebugConfiguration.is(configuration)) {
77
+ configurations.push(configuration);
78
+ }
79
+ }
80
+ }
81
+ const compounds: DebugCompound[] = [];
82
+ if (value && typeof value === 'object' && Array.isArray(value.compounds)) {
83
+ for (const compound of value.compounds) {
84
+ if (DebugCompound.is(compound)) {
85
+ compounds.push(compound);
75
86
  }
76
87
  }
77
88
  }
78
- return {
79
- uri: configUri,
80
- configurations
81
- };
89
+ return { uri: configUri, configurations, compounds };
82
90
  }
83
91
 
84
92
  }
@@ -86,5 +94,6 @@ export namespace DebugConfigurationModel {
86
94
  export interface JsonContent {
87
95
  uri?: URI
88
96
  configurations: DebugConfiguration[]
97
+ compounds: DebugCompound[]
89
98
  }
90
99
  }
@@ -1122,8 +1122,9 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1122
1122
  await this.configurations.addConfiguration();
1123
1123
  return;
1124
1124
  }
1125
- if (current) {
1126
- if (noDebug !== undefined) {
1125
+
1126
+ if (noDebug !== undefined) {
1127
+ if (current.configuration) {
1127
1128
  current = {
1128
1129
  ...current,
1129
1130
  configuration: {
@@ -1131,9 +1132,15 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1131
1132
  noDebug
1132
1133
  }
1133
1134
  };
1135
+ } else {
1136
+ current = {
1137
+ ...current,
1138
+ noDebug
1139
+ };
1134
1140
  }
1135
- await this.manager.start(current);
1136
1141
  }
1142
+
1143
+ await this.manager.start(current);
1137
1144
  }
1138
1145
 
1139
1146
  get threads(): DebugThreadsWidget | undefined {
@@ -113,7 +113,7 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan
113
113
 
114
114
  for (const config of configurations) {
115
115
  items.push({
116
- label: config.configuration.name,
116
+ label: config.name,
117
117
  description: this.workspaceService.isMultiRootWorkspaceOpened
118
118
  ? this.labelProvider.getName(new URI(config.workspaceFolderUri))
119
119
  : '',
@@ -134,7 +134,7 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan
134
134
  for (const configuration of dynamicConfigurations) {
135
135
  items.push({
136
136
  label: configuration.name,
137
- execute: () => this.runConfiguration({ configuration, providerType })
137
+ execute: () => this.runConfiguration({ name: configuration.name, configuration, providerType })
138
138
  });
139
139
  }
140
140
  }
@@ -170,7 +170,7 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan
170
170
  */
171
171
  protected updateStatusBar(): void {
172
172
  const text: string = this.debugConfigurationManager.current
173
- ? this.debugConfigurationManager.current.configuration.name
173
+ ? this.debugConfigurationManager.current.name
174
174
  : '';
175
175
  const icon = '$(codicon-debug-alt-small)';
176
176
  this.statusBar.setElement(this.statusBarId, {