@theia/debug 1.27.0-next.7 → 1.27.0-next.72

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 (155) hide show
  1. package/lib/browser/console/debug-console-contribution.js +2 -2
  2. package/lib/browser/console/debug-console-contribution.js.map +1 -1
  3. package/lib/browser/debug-configuration-manager.d.ts +21 -5
  4. package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
  5. package/lib/browser/debug-configuration-manager.js +81 -11
  6. package/lib/browser/debug-configuration-manager.js.map +1 -1
  7. package/lib/browser/debug-frontend-application-contribution.d.ts +1 -15
  8. package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
  9. package/lib/browser/debug-frontend-application-contribution.js +9 -60
  10. package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
  11. package/lib/browser/debug-frontend-module.d.ts.map +1 -1
  12. package/lib/browser/debug-frontend-module.js +11 -2
  13. package/lib/browser/debug-frontend-module.js.map +1 -1
  14. package/lib/browser/debug-preferences.d.ts +0 -1
  15. package/lib/browser/debug-preferences.d.ts.map +1 -1
  16. package/lib/browser/debug-preferences.js +0 -5
  17. package/lib/browser/debug-preferences.js.map +1 -1
  18. package/lib/browser/debug-prefix-configuration.d.ts +2 -7
  19. package/lib/browser/debug-prefix-configuration.d.ts.map +1 -1
  20. package/lib/browser/debug-prefix-configuration.js +6 -13
  21. package/lib/browser/debug-prefix-configuration.js.map +1 -1
  22. package/lib/browser/debug-session-connection.d.ts +4 -4
  23. package/lib/browser/debug-session-connection.d.ts.map +1 -1
  24. package/lib/browser/debug-session-connection.js.map +1 -1
  25. package/lib/browser/debug-session-contribution.js +2 -2
  26. package/lib/browser/debug-session-contribution.js.map +1 -1
  27. package/lib/browser/debug-session-options.d.ts +9 -2
  28. package/lib/browser/debug-session-options.d.ts.map +1 -1
  29. package/lib/browser/debug-session-options.js +18 -1
  30. package/lib/browser/debug-session-options.js.map +1 -1
  31. package/lib/browser/editor/debug-breakpoint-widget.js +1 -1
  32. package/lib/browser/editor/debug-breakpoint-widget.js.map +1 -1
  33. package/lib/browser/view/debug-breakpoints-widget.d.ts +1 -0
  34. package/lib/browser/view/debug-breakpoints-widget.d.ts.map +1 -1
  35. package/lib/browser/view/debug-breakpoints-widget.js +2 -1
  36. package/lib/browser/view/debug-breakpoints-widget.js.map +1 -1
  37. package/lib/browser/view/debug-configuration-select.d.ts +59 -0
  38. package/lib/browser/view/debug-configuration-select.d.ts.map +1 -0
  39. package/lib/browser/view/debug-configuration-select.js +183 -0
  40. package/lib/browser/view/debug-configuration-select.js.map +1 -0
  41. package/lib/browser/view/debug-configuration-widget.d.ts +5 -10
  42. package/lib/browser/view/debug-configuration-widget.d.ts.map +1 -1
  43. package/lib/browser/view/debug-configuration-widget.js +21 -54
  44. package/lib/browser/view/debug-configuration-widget.js.map +1 -1
  45. package/lib/browser/view/debug-session-widget.d.ts +8 -11
  46. package/lib/browser/view/debug-session-widget.d.ts.map +1 -1
  47. package/lib/browser/view/debug-session-widget.js +23 -34
  48. package/lib/browser/view/debug-session-widget.js.map +1 -1
  49. package/lib/browser/view/debug-stack-frames-source.d.ts.map +1 -1
  50. package/lib/browser/view/debug-stack-frames-source.js +1 -3
  51. package/lib/browser/view/debug-stack-frames-source.js.map +1 -1
  52. package/lib/browser/view/debug-stack-frames-widget.d.ts +2 -1
  53. package/lib/browser/view/debug-stack-frames-widget.d.ts.map +1 -1
  54. package/lib/browser/view/debug-stack-frames-widget.js +4 -3
  55. package/lib/browser/view/debug-stack-frames-widget.js.map +1 -1
  56. package/lib/browser/view/debug-threads-widget.d.ts +1 -0
  57. package/lib/browser/view/debug-threads-widget.d.ts.map +1 -1
  58. package/lib/browser/view/debug-threads-widget.js +2 -1
  59. package/lib/browser/view/debug-threads-widget.js.map +1 -1
  60. package/lib/browser/view/debug-variables-widget.d.ts +1 -0
  61. package/lib/browser/view/debug-variables-widget.d.ts.map +1 -1
  62. package/lib/browser/view/debug-variables-widget.js +2 -1
  63. package/lib/browser/view/debug-variables-widget.js.map +1 -1
  64. package/lib/browser/view/debug-view-model.d.ts +0 -9
  65. package/lib/browser/view/debug-view-model.d.ts.map +1 -1
  66. package/lib/browser/view/debug-view-model.js +9 -43
  67. package/lib/browser/view/debug-view-model.js.map +1 -1
  68. package/lib/browser/view/debug-watch-widget.d.ts +1 -0
  69. package/lib/browser/view/debug-watch-widget.d.ts.map +1 -1
  70. package/lib/browser/view/debug-watch-widget.js +2 -1
  71. package/lib/browser/view/debug-watch-widget.js.map +1 -1
  72. package/lib/browser/view/debug-widget.d.ts.map +1 -1
  73. package/lib/browser/view/debug-widget.js +1 -6
  74. package/lib/browser/view/debug-widget.js.map +1 -1
  75. package/lib/{node → common}/debug-adapter-contribution-registry.d.ts +2 -2
  76. package/lib/common/debug-adapter-contribution-registry.d.ts.map +1 -0
  77. package/lib/{node → common}/debug-adapter-contribution-registry.js +1 -1
  78. package/lib/common/debug-adapter-contribution-registry.js.map +1 -0
  79. package/lib/{node → common}/debug-adapter-session.d.ts +2 -2
  80. package/lib/common/debug-adapter-session.d.ts.map +1 -0
  81. package/lib/{node → common}/debug-adapter-session.js +0 -0
  82. package/lib/common/debug-adapter-session.js.map +1 -0
  83. package/lib/common/debug-configuration.d.ts +0 -5
  84. package/lib/common/debug-configuration.d.ts.map +1 -1
  85. package/lib/common/debug-configuration.js.map +1 -1
  86. package/lib/{node → common}/debug-model.d.ts +4 -4
  87. package/lib/{node → common}/debug-model.d.ts.map +1 -1
  88. package/lib/{node → common}/debug-model.js +0 -0
  89. package/lib/common/debug-model.js.map +1 -0
  90. package/lib/common/debug-service.d.ts +26 -4
  91. package/lib/common/debug-service.d.ts.map +1 -1
  92. package/lib/common/debug-service.js +31 -1
  93. package/lib/common/debug-service.js.map +1 -1
  94. package/lib/common/inline-debug-adapter.d.ts +19 -0
  95. package/lib/common/inline-debug-adapter.d.ts.map +1 -0
  96. package/lib/common/inline-debug-adapter.js +45 -0
  97. package/lib/common/inline-debug-adapter.js.map +1 -0
  98. package/lib/node/debug-adapter-factory.d.ts +1 -1
  99. package/lib/node/debug-adapter-factory.d.ts.map +1 -1
  100. package/lib/node/debug-adapter-factory.js +1 -1
  101. package/lib/node/debug-adapter-factory.js.map +1 -1
  102. package/lib/node/debug-adapter-session-manager.d.ts +2 -2
  103. package/lib/node/debug-adapter-session-manager.d.ts.map +1 -1
  104. package/lib/node/debug-adapter-session-manager.js +4 -4
  105. package/lib/node/debug-adapter-session-manager.js.map +1 -1
  106. package/lib/node/debug-backend-module.js +2 -2
  107. package/lib/node/debug-backend-module.js.map +1 -1
  108. package/lib/node/debug-service-impl.d.ts +5 -1
  109. package/lib/node/debug-service-impl.d.ts.map +1 -1
  110. package/lib/node/debug-service-impl.js +13 -1
  111. package/lib/node/debug-service-impl.js.map +1 -1
  112. package/lib/node/stream-debug-adapter.d.ts +1 -1
  113. package/lib/node/stream-debug-adapter.d.ts.map +1 -1
  114. package/lib/node/vscode/vscode-debug-adapter-contribution.d.ts +1 -1
  115. package/lib/node/vscode/vscode-debug-adapter-contribution.d.ts.map +1 -1
  116. package/package.json +14 -14
  117. package/src/browser/console/debug-console-contribution.tsx +2 -2
  118. package/src/browser/debug-call-stack-item-type-key.ts +1 -1
  119. package/src/browser/debug-configuration-manager.ts +111 -16
  120. package/src/browser/debug-frontend-application-contribution.ts +11 -71
  121. package/src/browser/debug-frontend-module.ts +12 -5
  122. package/src/browser/debug-preferences.ts +0 -6
  123. package/src/browser/debug-prefix-configuration.ts +6 -14
  124. package/src/browser/debug-session-connection.ts +4 -4
  125. package/src/browser/debug-session-contribution.ts +4 -4
  126. package/src/browser/debug-session-options.ts +30 -3
  127. package/src/browser/editor/debug-breakpoint-widget.tsx +1 -1
  128. package/src/browser/view/debug-breakpoints-widget.ts +2 -1
  129. package/src/browser/view/debug-configuration-select.tsx +234 -0
  130. package/src/browser/view/debug-configuration-widget.tsx +24 -55
  131. package/src/browser/view/debug-session-widget.ts +22 -33
  132. package/src/browser/view/debug-stack-frames-source.tsx +1 -4
  133. package/src/browser/view/debug-stack-frames-widget.ts +4 -3
  134. package/src/browser/view/debug-threads-widget.ts +2 -1
  135. package/src/browser/view/debug-variables-widget.ts +2 -1
  136. package/src/browser/view/debug-view-model.ts +8 -46
  137. package/src/browser/view/debug-watch-widget.ts +2 -1
  138. package/src/browser/view/debug-widget.ts +2 -6
  139. package/src/{node → common}/debug-adapter-contribution-registry.ts +2 -2
  140. package/src/{node → common}/debug-adapter-session.ts +3 -3
  141. package/src/common/debug-configuration.ts +0 -8
  142. package/src/{node → common}/debug-model.ts +4 -4
  143. package/src/common/debug-service.ts +47 -5
  144. package/src/common/inline-debug-adapter.ts +47 -0
  145. package/src/node/debug-adapter-factory.ts +2 -2
  146. package/src/node/debug-adapter-session-manager.ts +6 -6
  147. package/src/node/debug-backend-module.ts +2 -2
  148. package/src/node/debug-service-impl.ts +14 -2
  149. package/src/node/stream-debug-adapter.ts +1 -1
  150. package/src/node/vscode/vscode-debug-adapter-contribution.ts +1 -1
  151. package/lib/node/debug-adapter-contribution-registry.d.ts.map +0 -1
  152. package/lib/node/debug-adapter-contribution-registry.js.map +0 -1
  153. package/lib/node/debug-adapter-session.d.ts.map +0 -1
  154. package/lib/node/debug-adapter-session.js.map +0 -1
  155. package/lib/node/debug-model.js.map +0 -1
@@ -27,7 +27,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.DebugServiceImpl = void 0;
28
28
  const inversify_1 = require("@theia/core/shared/inversify");
29
29
  const debug_adapter_session_manager_1 = require("./debug-adapter-session-manager");
30
- const debug_adapter_contribution_registry_1 = require("./debug-adapter-contribution-registry");
30
+ const debug_adapter_contribution_registry_1 = require("../common/debug-adapter-contribution-registry");
31
+ const core_1 = require("@theia/core");
31
32
  /**
32
33
  * DebugService implementation.
33
34
  */
@@ -35,6 +36,9 @@ let DebugServiceImpl = class DebugServiceImpl {
35
36
  constructor() {
36
37
  this.sessions = new Set();
37
38
  }
39
+ get onDidChangeDebugConfigurationProviders() {
40
+ return core_1.Event.None;
41
+ }
38
42
  dispose() {
39
43
  this.terminateDebugSession();
40
44
  }
@@ -57,6 +61,14 @@ let DebugServiceImpl = class DebugServiceImpl {
57
61
  async provideDebugConfigurations(debugType, workspaceFolderUri) {
58
62
  return this.registry.provideDebugConfigurations(debugType, workspaceFolderUri);
59
63
  }
64
+ async provideDynamicDebugConfigurations() {
65
+ // TODO: Support dynamic debug configurations through Theia extensions?
66
+ return {};
67
+ }
68
+ fetchDynamicDebugConfiguration(name, type) {
69
+ // TODO: Support dynamic debug configurations through Theia extensions?
70
+ return Promise.resolve(undefined);
71
+ }
60
72
  async resolveDebugConfiguration(config, workspaceFolderUri) {
61
73
  return this.registry.resolveDebugConfiguration(config, workspaceFolderUri);
62
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"debug-service-impl.js","sourceRoot":"","sources":["../../src/node/debug-service-impl.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;;;;;;;;;;;;AAEhF,4DAAkE;AAKlE,mFAA6E;AAC7E,+FAAyF;AAEzF;;GAEG;AAEH,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAA7B;QA2CuB,aAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAmCpD,CAAC;IAtEG,OAAO;QACH,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,UAAU;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACtC,CAAC;IAED,uBAAuB,CAAC,QAAgB;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,mB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AC;IACS,KAAK,CAAC,MAAM,CAAC,SAAiB;QACpC,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzD,IAAI,YAAY,EAAE;YACd,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAChC,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;SAC7B;IACL,CAAC;CACJ,CAAA;AAtFG;IADC,IAAA,kBAAM,EAAC,0DAA0B,CAAC;8BACA,0DAA0B;wDAAC;AAG9D;IADC,IAAA,kBAAM,EAAC,sEAAgC,CAAC;8BACZ,sEAAgC;kDAAC;AANrD,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAyF5B;AAzFY,4CAAgB"}
@@ -4,7 +4,7 @@ import { Event } from '@theia/core/lib/common/event';
4
4
  import { ChildProcess } from 'child_process';
5
5
  import * as stream from 'stream';
6
6
  import * as net from 'net';
7
- import { DebugAdapter } from './debug-model';
7
+ import { DebugAdapter } from '../common/debug-model';
8
8
  declare abstract class StreamDebugAdapter extends DisposableCollection {
9
9
  private fromAdapter;
10
10
  private toAdapter;
@@ -1 +1 @@
1
- {"version":3,"file":"stream-debug-adapter.d.ts","sourceRoot":"","sources":["../../src/node/stream-debug-adapter.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAW,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,uBAAe,kBAAmB,SAAQ,oBAAoB;IAc9C,OAAO,CA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B"}
@@ -1,4 +1,4 @@
1
- import { DebugAdapterExecutable, DebugAdapterContribution } from '../debug-model';
1
+ import { DebugAdapterExecutable, DebugAdapterContribution } from '../../common/debug-model';
2
2
  import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-schema';
3
3
  export interface VSCodeExtensionPackage {
4
4
  contributes: {
@@ -1 +1 @@
1
- {"version":3,"file":"vscode-debug-adapter-contribution.d.ts","sourceRoot":"","sources":["../../../src/node/vscode/vscode-debug-adapter-contribution.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAgBrF,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE;QACT,SAAS,EAAE,0BAA0B,EAAE,CAAA;KAC1C,CAAA;CACJ;AACD,MAAM,WAAW,yCAAyC;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AACD,MAAM,WAAW,0BAA2B,SAAQ,yCAAyC;IACzF,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,qBAAqB,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAC5C,uBAAuB,CAAC,EAAE;QACtB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAA;KACjC,CAAA;IACD,GAAG,CAAC,EAAE,yCAAyC,CAAC;IAChD,MAAM,CAAC,EAAE,yCAAyC,CAAC;IACnD,OAAO,CAAC,EAAE,yCAAyC,CAAC;IACpD,GAAG,CAAC,EAAE,yCAAyC,CAAC;IAChD,KAAK,CAAC,EAAE,yCAAyC,CAAC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OAAO,CAAC,0BAA0B,CAAC,CAAC;IAE7E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;gBAGxB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM;cAU/B,KAAK,IAAI,OAAO,CAAC,sBAAsB,CAAC;cAexC,2BAA2B,IAAI,OAAO,CAAC,0BAA0B,CAAC;IASlF,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,SAAS,CAAC;IACzD,mBAAmB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;cAGnC,uBAAuB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAsF3D,wBAAwB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAKzD,6BAA6B,IAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;CA+BrF"}
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@theia/debug",
3
- "version": "1.27.0-next.7+5f887e22825",
3
+ "version": "1.27.0-next.72+1af3f9e1a07",
4
4
  "description": "Theia - Debug Extension",
5
5
  "dependencies": {
6
- "@theia/console": "1.27.0-next.7+5f887e22825",
7
- "@theia/core": "1.27.0-next.7+5f887e22825",
8
- "@theia/editor": "1.27.0-next.7+5f887e22825",
9
- "@theia/filesystem": "1.27.0-next.7+5f887e22825",
10
- "@theia/markers": "1.27.0-next.7+5f887e22825",
11
- "@theia/monaco": "1.27.0-next.7+5f887e22825",
6
+ "@theia/console": "1.27.0-next.72+1af3f9e1a07",
7
+ "@theia/core": "1.27.0-next.72+1af3f9e1a07",
8
+ "@theia/editor": "1.27.0-next.72+1af3f9e1a07",
9
+ "@theia/filesystem": "1.27.0-next.72+1af3f9e1a07",
10
+ "@theia/markers": "1.27.0-next.72+1af3f9e1a07",
11
+ "@theia/monaco": "1.27.0-next.72+1af3f9e1a07",
12
12
  "@theia/monaco-editor-core": "1.65.2",
13
- "@theia/output": "1.27.0-next.7+5f887e22825",
14
- "@theia/process": "1.27.0-next.7+5f887e22825",
15
- "@theia/task": "1.27.0-next.7+5f887e22825",
16
- "@theia/terminal": "1.27.0-next.7+5f887e22825",
17
- "@theia/variable-resolver": "1.27.0-next.7+5f887e22825",
18
- "@theia/workspace": "1.27.0-next.7+5f887e22825",
13
+ "@theia/output": "1.27.0-next.72+1af3f9e1a07",
14
+ "@theia/process": "1.27.0-next.72+1af3f9e1a07",
15
+ "@theia/task": "1.27.0-next.72+1af3f9e1a07",
16
+ "@theia/terminal": "1.27.0-next.72+1af3f9e1a07",
17
+ "@theia/variable-resolver": "1.27.0-next.72+1af3f9e1a07",
18
+ "@theia/workspace": "1.27.0-next.72+1af3f9e1a07",
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": "5f887e22825c7284b16104b517678ca0a2824319"
71
+ "gitHead": "1af3f9e1a071c3c818395f575940372e429a342f"
72
72
  }
@@ -189,7 +189,7 @@ export class DebugConsoleContribution extends AbstractViewContribution<ConsoleWi
189
189
  return <SelectComponent
190
190
  key="debugConsoleSeverity"
191
191
  options={severityElements}
192
- value={this.consoleSessionManager.severity || Severity.Ignore}
192
+ defaultValue={this.consoleSessionManager.severity || Severity.Ignore}
193
193
  onChange={this.changeSeverity} />;
194
194
  }
195
195
 
@@ -207,7 +207,7 @@ export class DebugConsoleContribution extends AbstractViewContribution<ConsoleWi
207
207
  return <SelectComponent
208
208
  key="debugConsoleSelector"
209
209
  options={availableConsoles}
210
- value={0}
210
+ defaultValue={0}
211
211
  onChange={this.changeDebugConsole} />;
212
212
  }
213
213
 
@@ -17,4 +17,4 @@
17
17
  import { ContextKey } from '@theia/core/lib/browser/context-key-service';
18
18
 
19
19
  export const DebugCallStackItemTypeKey = Symbol('DebugCallStackItemTypeKey');
20
- export type DebugCallStackItemTypeKey = ContextKey<'session' | 'thread' | 'stackFrame'>;
20
+ export type DebugCallStackItemTypeKey = ContextKey<'session' | 'thread' | 'stackFrame'>;
@@ -86,10 +86,16 @@ export class DebugConfigurationManager {
86
86
  return this.onWillProvideDynamicDebugConfigurationEmitter.event;
87
87
  }
88
88
 
89
+ get onDidChangeConfigurationProviders(): Event<void> {
90
+ return this.debug.onDidChangeDebugConfigurationProviders;
91
+ }
92
+
89
93
  protected debugConfigurationTypeKey: ContextKey<string>;
90
94
 
91
95
  protected initialized: Promise<void>;
92
96
 
97
+ protected recentDynamicOptionsTracker: DebugSessionOptions[] = [];
98
+
93
99
  @postConstruct()
94
100
  protected async init(): Promise<void> {
95
101
  this.debugConfigurationTypeKey = this.contextKeyService.createKey<string>('debugConfigurationType', undefined);
@@ -126,6 +132,9 @@ export class DebugConfigurationManager {
126
132
  this.updateCurrent();
127
133
  }, 500);
128
134
 
135
+ /**
136
+ * All _non-dynamic_ debug configurations.
137
+ */
129
138
  get all(): IterableIterator<DebugSessionOptions> {
130
139
  return this.getAll();
131
140
  }
@@ -160,11 +169,61 @@ export class DebugConfigurationManager {
160
169
  get current(): DebugSessionOptions | undefined {
161
170
  return this._currentOptions;
162
171
  }
172
+
173
+ async getSelectedConfiguration(): Promise<DebugSessionOptions | undefined> {
174
+ // providerType applies to dynamic configurations only
175
+ if (!this._currentOptions?.providerType) {
176
+ return this._currentOptions;
177
+ }
178
+
179
+ // Refresh a dynamic configuration from the provider.
180
+ // This allow providers to update properties before the execution e.g. program
181
+ const { providerType, configuration: { name } } = this._currentOptions;
182
+ const configuration = await this.fetchDynamicDebugConfiguration(name, providerType);
183
+
184
+ if (!configuration) {
185
+ const message = nls.localize(
186
+ 'theia/debug/missingConfiguration',
187
+ "Dynamic configuration '{0}:{1}' is missing or not applicable", providerType, name);
188
+ throw new Error(message);
189
+ }
190
+
191
+ return { configuration, providerType };
192
+ }
193
+
163
194
  set current(option: DebugSessionOptions | undefined) {
164
195
  this.updateCurrent(option);
196
+ this.updateRecentlyUsedDynamicConfigurationOptions(option);
197
+ }
198
+
199
+ protected updateRecentlyUsedDynamicConfigurationOptions(option: DebugSessionOptions | undefined): void {
200
+ if (option?.providerType) { // if it's a dynamic configuration option
201
+ // Removing an item already present in the list
202
+ const index = this.recentDynamicOptionsTracker.findIndex(item => this.dynamicOptionsMatch(item, option));
203
+ if (index > -1) {
204
+ this.recentDynamicOptionsTracker.splice(index, 1);
205
+ }
206
+ // Adding new item, most recent at the top of the list
207
+ const recentMax = 3;
208
+ if (this.recentDynamicOptionsTracker.unshift(option) > recentMax) {
209
+ // Keep the latest 3 dynamic configuration options to not clutter the dropdown.
210
+ this.recentDynamicOptionsTracker.splice(recentMax);
211
+ }
212
+ }
165
213
  }
214
+
215
+ protected dynamicOptionsMatch(one: DebugSessionOptions, other: DebugSessionOptions): boolean {
216
+ return one.providerType !== undefined
217
+ && one.configuration.name === other.configuration.name
218
+ && one.providerType === other.providerType;
219
+ }
220
+
221
+ get recentDynamicOptions(): readonly DebugSessionOptions[] {
222
+ return this.recentDynamicOptionsTracker;
223
+ }
224
+
166
225
  protected updateCurrent(options: DebugSessionOptions | undefined = this._currentOptions): void {
167
- this._currentOptions = options && !options.configuration.dynamic ? this.find(options.configuration.name, options.workspaceFolderUri) : options;
226
+ this._currentOptions = options && this.find(options.configuration, options.workspaceFolderUri, options.providerType);
168
227
 
169
228
  if (!this._currentOptions) {
170
229
  const model = this.getModel();
@@ -181,7 +240,24 @@ export class DebugConfigurationManager {
181
240
  this.debugConfigurationTypeKey.set(this.current && this.current.configuration.type);
182
241
  this.onDidChangeEmitter.fire(undefined);
183
242
  }
184
- find(name: string, workspaceFolderUri: string | undefined): DebugSessionOptions | undefined {
243
+
244
+ /**
245
+ * @deprecated since v1.27.0
246
+ */
247
+ find(name: string, workspaceFolderUri: string): DebugSessionOptions | undefined;
248
+ /**
249
+ * Find / Resolve DebugSessionOptions from a given target debug configuration
250
+ */
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;
185
261
  for (const model of this.models.values()) {
186
262
  if (model.workspaceFolderUri === workspaceFolderUri) {
187
263
  for (const configuration of model.configurations) {
@@ -194,7 +270,6 @@ export class DebugConfigurationManager {
194
270
  }
195
271
  }
196
272
  }
197
- return undefined;
198
273
  }
199
274
 
200
275
  async openConfiguration(): Promise<void> {
@@ -349,7 +424,13 @@ export class DebugConfigurationManager {
349
424
  return this.debug.provideDynamicDebugConfigurations!();
350
425
  }
351
426
 
427
+ async fetchDynamicDebugConfiguration(name: string, type: string): Promise<DebugConfiguration | undefined> {
428
+ await this.fireWillProvideDynamicDebugConfiguration();
429
+ return this.debug.fetchDynamicDebugConfiguration(name, type);
430
+ }
431
+
352
432
  protected async fireWillProvideDynamicDebugConfiguration(): Promise<void> {
433
+ await this.initialized;
353
434
  await WaitUntilEvent.fire(this.onWillProvideDynamicDebugConfigurationEmitter, {});
354
435
  }
355
436
 
@@ -384,29 +465,43 @@ export class DebugConfigurationManager {
384
465
  async load(): Promise<void> {
385
466
  await this.initialized;
386
467
  const data = await this.storage.getData<DebugConfigurationManager.Data>('debug.configurations', {});
387
- if (data.current) {
388
- this.current = this.find(data.current.name, data.current.workspaceFolderUri);
468
+ this.resolveRecentDynamicOptionsFromData(data.recentDynamicOptions);
469
+
470
+ // Between versions v1.26 and v1.27, the expected format of the data changed so that old stored data
471
+ // may not contain the configuration key.
472
+ if (data.current && 'configuration' in data.current) {
473
+ this.current = this.find(data.current.configuration, data.current.workspaceFolderUri, data.current.providerType);
474
+ }
475
+ }
476
+
477
+ protected resolveRecentDynamicOptionsFromData(options?: DebugSessionOptions[]): void {
478
+ if (!options || this.recentDynamicOptionsTracker.length !== 0) {
479
+ return;
389
480
  }
481
+
482
+ this.recentDynamicOptionsTracker = options;
390
483
  }
391
484
 
392
485
  save(): void {
393
486
  const data: DebugConfigurationManager.Data = {};
394
- const { current } = this;
487
+ const { current, recentDynamicOptionsTracker } = this;
395
488
  if (current) {
396
- data.current = {
397
- name: current.configuration.name,
398
- workspaceFolderUri: current.workspaceFolderUri
399
- };
489
+ data.current = current;
400
490
  }
401
- this.storage.setData('debug.configurations', data);
402
- }
403
491
 
492
+ if (this.recentDynamicOptionsTracker.length > 0) {
493
+ data.recentDynamicOptions = recentDynamicOptionsTracker;
494
+ }
495
+
496
+ if (Object.keys(data).length > 0) {
497
+ this.storage.setData('debug.configurations', data);
498
+ }
499
+ }
404
500
  }
501
+
405
502
  export namespace DebugConfigurationManager {
406
503
  export interface Data {
407
- current?: {
408
- name: string
409
- workspaceFolderUri?: string
410
- }
504
+ current?: DebugSessionOptions,
505
+ recentDynamicOptions?: DebugSessionOptions[]
411
506
  }
412
507
  }
@@ -14,11 +14,10 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { AbstractViewContribution, ApplicationShell, KeybindingRegistry, Widget, CompositeTreeNode, LabelProvider, codicon } from '@theia/core/lib/browser';
17
+ import { AbstractViewContribution, KeybindingRegistry, Widget, CompositeTreeNode, LabelProvider, codicon } from '@theia/core/lib/browser';
18
18
  import { injectable, inject } from '@theia/core/shared/inversify';
19
19
  import * as monaco from '@theia/monaco-editor-core';
20
20
  import { MenuModelRegistry, CommandRegistry, MAIN_MENU_BAR, Command, Emitter, Mutable } from '@theia/core/lib/common';
21
- import { DebugViewLocation } from '../common/debug-configuration';
22
21
  import { EditorKeybindingContexts, EditorManager } from '@theia/editor/lib/browser';
23
22
  import { DebugSessionManager } from './debug-session-manager';
24
23
  import { DebugWidget } from './view/debug-widget';
@@ -34,7 +33,7 @@ import { DebugStackFramesWidget } from './view/debug-stack-frames-widget';
34
33
  import { DebugStackFrame } from './model/debug-stack-frame';
35
34
  import { DebugVariablesWidget } from './view/debug-variables-widget';
36
35
  import { DebugVariable } from './console/debug-console-items';
37
- import { DebugSessionWidget, DebugSessionWidgetFactory } from './view/debug-session-widget';
36
+ import { DebugSessionWidget } from './view/debug-session-widget';
38
37
  import { DebugKeybindingContexts } from './debug-keybinding-contexts';
39
38
  import { DebugEditorModel } from './editor/debug-editor-model';
40
39
  import { DebugEditorService } from './editor/debug-editor-service';
@@ -334,15 +333,6 @@ export namespace DebugSessionContextCommands {
334
333
  export const REVEAL = {
335
334
  id: 'debug.session.context.reveal'
336
335
  };
337
- export const OPEN_LEFT = {
338
- id: 'debug.session.context.openLeft'
339
- };
340
- export const OPEN_RIGHT = {
341
- id: 'debug.session.context.openRight'
342
- };
343
- export const OPEN_BOTTOM = {
344
- id: 'debug.session.context.openBottom'
345
- };
346
336
  }
347
337
  export namespace DebugEditorContextCommands {
348
338
  export const ADD_BREAKPOINT = {
@@ -403,9 +393,6 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
403
393
  @inject(BreakpointManager)
404
394
  protected readonly breakpointManager: BreakpointManager;
405
395
 
406
- @inject(DebugSessionWidgetFactory)
407
- protected readonly sessionWidgetFactory: DebugSessionWidgetFactory;
408
-
409
396
  @inject(DebugEditorService)
410
397
  protected readonly editors: DebugEditorService;
411
398
 
@@ -556,12 +543,7 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
556
543
  { ...DebugCommands.STOP, ...DebugSessionContextCommands.STOP },
557
544
  { ...DebugThreadContextCommands.TERMINATE, label: nls.localizeByDefault('Terminate Thread') }
558
545
  );
559
- registerMenuActions(DebugThreadsWidget.OPEN_MENU,
560
- { ...DebugSessionContextCommands.REVEAL, label: nls.localize('theia/debug/reveal', 'Reveal') },
561
- { ...DebugSessionContextCommands.OPEN_LEFT, label: nls.localize('theia/debug/openLeft', 'Open Left') },
562
- { ...DebugSessionContextCommands.OPEN_RIGHT, label: nls.localize('theia/debug/openRight', 'Open Right') },
563
- { ...DebugSessionContextCommands.OPEN_BOTTOM, label: nls.localize('theia/debug/openBottom', 'Open Bottom') }
564
- );
546
+ registerMenuActions(DebugThreadsWidget.OPEN_MENU, { ...DebugSessionContextCommands.REVEAL, label: nls.localize('theia/debug/reveal', 'Reveal') });
565
547
 
566
548
  registerMenuActions(DebugStackFramesWidget.CONTEXT_MENU,
567
549
  DebugCommands.RESTART_FRAME,
@@ -721,31 +703,9 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
721
703
  });
722
704
  registry.registerCommand(DebugSessionContextCommands.REVEAL, {
723
705
  execute: () => this.selectedSession && this.revealSession(this.selectedSession),
724
- isEnabled: () => this.hasSessionWidget,
725
- isVisible: () => !this.selectedThread && this.hasSessionWidget
726
- });
727
- registry.registerCommand(DebugSessionContextCommands.OPEN_LEFT, {
728
- execute: () => this.selectedSession && this.openSession(this.selectedSession, {
729
- debugViewLocation: 'left'
730
- }),
731
- isEnabled: () => !this.hasSessionWidget,
732
- isVisible: () => !this.selectedThread && !this.hasSessionWidget
733
- });
734
- registry.registerCommand(DebugSessionContextCommands.OPEN_RIGHT, {
735
- execute: () => this.selectedSession && this.openSession(this.selectedSession, {
736
- debugViewLocation: 'right'
737
- }),
738
- isEnabled: () => !this.hasSessionWidget,
739
- isVisible: () => !this.selectedThread && !this.hasSessionWidget
740
- });
741
- registry.registerCommand(DebugSessionContextCommands.OPEN_BOTTOM, {
742
- execute: () => this.selectedSession && this.openSession(this.selectedSession, {
743
- debugViewLocation: 'bottom'
744
- }),
745
- isEnabled: () => !this.hasSessionWidget,
746
- isVisible: () => !this.selectedThread && !this.hasSessionWidget
706
+ isEnabled: () => Boolean(this.selectedSession),
707
+ isVisible: () => !this.selectedThread && Boolean(this.selectedSession)
747
708
  });
748
-
749
709
  registry.registerCommand(DebugCommands.TOGGLE_BREAKPOINT, {
750
710
  execute: () => this.editors.toggleBreakpoint(),
751
711
  isEnabled: () => !!this.editors.model
@@ -1131,43 +1091,23 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
1131
1091
  });
1132
1092
  }
1133
1093
 
1134
- protected readonly sessionWidgets = new Map<string, DebugSessionWidget>();
1135
- get hasSessionWidget(): boolean {
1136
- return !!this.selectedSession && this.sessionWidgets.has(this.selectedSession.label);
1137
- }
1138
1094
  protected async openSession(
1139
1095
  session: DebugSession,
1140
1096
  options?: {
1141
- debugViewLocation?: DebugViewLocation;
1142
1097
  reveal?: boolean;
1143
1098
  }
1144
1099
  ): Promise<DebugWidget | DebugSessionWidget> {
1145
- const { debugViewLocation, reveal } = {
1146
- debugViewLocation: session.configuration.debugViewLocation || this.preference['debug.debugViewLocation'],
1100
+ const { reveal } = {
1147
1101
  reveal: true,
1148
1102
  ...options
1149
1103
  };
1150
- const sessionWidget = this.revealSession(session);
1151
- if (sessionWidget) {
1152
- return sessionWidget;
1153
- }
1154
- const area = ApplicationShell.isSideArea(debugViewLocation) ? debugViewLocation : 'debug';
1155
- if (area === 'debug') {
1156
- return this.openView({ reveal });
1157
- }
1158
- const newSessionWidget = this.sessionWidgetFactory({ session });
1159
- this.sessionWidgets.set(session.label, newSessionWidget);
1160
- newSessionWidget.disposed.connect(() =>
1161
- this.sessionWidgets.delete(session.label)
1162
- );
1163
- this.shell.addWidget(newSessionWidget, { area });
1164
- if (reveal) {
1165
- this.shell.revealWidget(newSessionWidget.id);
1166
- }
1167
- return newSessionWidget;
1104
+ const debugWidget = await this.openView({ reveal });
1105
+ debugWidget.sessionManager.currentSession = session;
1106
+ return debugWidget['sessionWidget'];
1168
1107
  }
1108
+
1169
1109
  protected revealSession(session: DebugSession): DebugSessionWidget | undefined {
1170
- const widget = this.sessionWidgets.get(session.label);
1110
+ const widget = this.tryGetWidget()?.['sessionWidget'];
1171
1111
  if (widget) {
1172
1112
  this.shell.revealWidget(widget.id);
1173
1113
  }
@@ -39,8 +39,6 @@ import { DebugFrontendApplicationContribution } from './debug-frontend-applicati
39
39
  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
- import { DebugViewOptions } from './view/debug-view-model';
43
- import { DebugSessionWidget, DebugSessionWidgetFactory } from './view/debug-session-widget';
44
42
  import { InDebugModeContext, BreakpointWidgetInputFocusContext, BreakpointWidgetInputStrictFocusContext } from './debug-keybinding-contexts';
45
43
  import { DebugEditorModelFactory, DebugEditorModel } from './editor/debug-editor-model';
46
44
  import { bindDebugPreferences } from './debug-preferences';
@@ -60,6 +58,9 @@ import { TabBarDecorator } from '@theia/core/lib/browser/shell/tab-bar-decorator
60
58
  import { DebugTabBarDecorator } from './debug-tab-bar-decorator';
61
59
  import { DebugContribution } from './debug-contribution';
62
60
  import { QuickAccessContribution } from '@theia/core/lib/browser/quick-input/quick-access';
61
+ import { DebugViewModel } from './view/debug-view-model';
62
+ import { DebugToolBar } from './view/debug-toolbar-widget';
63
+ import { DebugSessionWidget } from './view/debug-session-widget';
63
64
 
64
65
  export default new ContainerModule((bind: interfaces.Bind) => {
65
66
  bindContributionProvider(bind, DebugContribution);
@@ -81,9 +82,6 @@ export default new ContainerModule((bind: interfaces.Bind) => {
81
82
  return service;
82
83
  });
83
84
 
84
- bind(DebugSessionWidgetFactory).toDynamicValue(({ container }) =>
85
- (options: DebugViewOptions) => DebugSessionWidget.createWidget(container, options)
86
- ).inSingletonScope();
87
85
  bind(WidgetFactory).toDynamicValue(({ container }) => ({
88
86
  id: DebugWidget.ID,
89
87
  createWidget: () => DebugWidget.createWidget(container)
@@ -124,4 +122,13 @@ export default new ContainerModule((bind: interfaces.Bind) => {
124
122
 
125
123
  bind(DebugTabBarDecorator).toSelf().inSingletonScope();
126
124
  bind(TabBarDecorator).toService(DebugTabBarDecorator);
125
+
126
+ bind(DebugViewModel).toSelf().inSingletonScope();
127
+ bind(DebugToolBar).toSelf().inSingletonScope();
128
+ for (const subwidget of DebugSessionWidget.subwidgets) {
129
+ bind(WidgetFactory).toDynamicValue(({ container }) => ({
130
+ id: subwidget.FACTORY_ID,
131
+ createWidget: () => subwidget.createWidget(container),
132
+ }));
133
+ }
127
134
  });
@@ -26,11 +26,6 @@ export const debugPreferencesSchema: PreferenceSchema = {
26
26
  default: false,
27
27
  description: nls.localize('theia/debug/toggleTracing', 'Enable/disable tracing communications with debug adapters')
28
28
  },
29
- 'debug.debugViewLocation': {
30
- enum: ['default', 'left', 'right', 'bottom'],
31
- default: 'default',
32
- description: nls.localize('theia/debug/debugViewLocation', 'Controls the location of the debug view.')
33
- },
34
29
  'debug.openDebug': {
35
30
  enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'],
36
31
  default: 'openOnSessionStart',
@@ -71,7 +66,6 @@ export const debugPreferencesSchema: PreferenceSchema = {
71
66
 
72
67
  export class DebugConfiguration {
73
68
  'debug.trace': boolean;
74
- 'debug.debugViewLocation': 'default' | 'left' | 'right' | 'bottom';
75
69
  'debug.openDebug': 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart' | 'openOnDebugBreak';
76
70
  'debug.internalConsoleOptions': 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart';
77
71
  'debug.inlineValues': boolean;
@@ -123,10 +123,10 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan
123
123
 
124
124
  // Resolve dynamic configurations from providers
125
125
  const record = await this.debugConfigurationManager.provideDynamicDebugConfigurations();
126
- for (const [type, dynamicConfigurations] of Object.entries(record)) {
126
+ for (const [providerType, dynamicConfigurations] of Object.entries(record)) {
127
127
  if (dynamicConfigurations.length > 0) {
128
128
  items.push({
129
- label: type,
129
+ label: providerType,
130
130
  type: 'separator'
131
131
  });
132
132
  }
@@ -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.runDynamicConfiguration({ configuration })
137
+ execute: () => this.runConfiguration({ configuration, providerType })
138
138
  });
139
139
  }
140
140
  }
@@ -145,21 +145,13 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan
145
145
  /**
146
146
  * Set the current debug configuration, and execute debug start command.
147
147
  *
148
- * @param configuration the `DebugSessionOptions`.
148
+ * @param configurationOptions the `DebugSessionOptions`.
149
149
  */
150
- protected runConfiguration(configuration: DebugSessionOptions): void {
151
- this.debugConfigurationManager.current = { ...configuration };
150
+ protected runConfiguration(configurationOptions: DebugSessionOptions): void {
151
+ this.debugConfigurationManager.current = configurationOptions;
152
152
  this.commandRegistry.executeCommand(DebugCommands.START.id);
153
153
  }
154
154
 
155
- /**
156
- * Execute the debug start command without affecting the current debug configuration
157
- * @param configuration the `DebugSessionOptions`.
158
- */
159
- protected runDynamicConfiguration(configuration: DebugSessionOptions): void {
160
- this.commandRegistry.executeCommand(DebugCommands.START.id, configuration);
161
- }
162
-
163
155
  /**
164
156
  * Handle the visibility of the debug status bar.
165
157
  * @param event the preference change event.
@@ -21,7 +21,7 @@ import { Deferred } from '@theia/core/lib/common/promise-util';
21
21
  import { Event, Emitter, DisposableCollection, Disposable, MaybePromise } from '@theia/core';
22
22
  import { OutputChannel } from '@theia/output/lib/browser/output-channel';
23
23
 
24
- import { Channel } from '../common/debug-service';
24
+ import { DebugChannel } from '../common/debug-service';
25
25
 
26
26
  export type DebugRequestHandler = (request: DebugProtocol.Request) => MaybePromise<any>;
27
27
 
@@ -121,7 +121,7 @@ export class DebugSessionConnection implements Disposable {
121
121
  private sequence = 1;
122
122
 
123
123
  protected readonly pendingRequests = new Map<number, Deferred<DebugProtocol.Response>>();
124
- protected readonly connectionPromise: Promise<Channel>;
124
+ protected readonly connectionPromise: Promise<DebugChannel>;
125
125
 
126
126
  protected readonly requestHandlers = new Map<string, DebugRequestHandler>();
127
127
 
@@ -141,7 +141,7 @@ export class DebugSessionConnection implements Disposable {
141
141
 
142
142
  constructor(
143
143
  readonly sessionId: string,
144
- connectionFactory: (sessionId: string) => Promise<Channel>,
144
+ connectionFactory: (sessionId: string) => Promise<DebugChannel>,
145
145
  protected readonly traceOutputChannel: OutputChannel | undefined
146
146
  ) {
147
147
  this.connectionPromise = this.createConnection(connectionFactory);
@@ -161,7 +161,7 @@ export class DebugSessionConnection implements Disposable {
161
161
  this.toDispose.dispose();
162
162
  }
163
163
 
164
- protected async createConnection(connectionFactory: (sessionId: string) => Promise<Channel>): Promise<Channel> {
164
+ protected async createConnection(connectionFactory: (sessionId: string) => Promise<DebugChannel>): Promise<DebugChannel> {
165
165
  const connection = await connectionFactory(this.sessionId);
166
166
  connection.onClose(() => {
167
167
  this.isClosed = true;