@theia/debug 1.17.0-next.ff9e0507 → 1.18.0-next.04e2816d

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 (139) hide show
  1. package/lib/browser/breakpoint/breakpoint-manager.js +159 -382
  2. package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
  3. package/lib/browser/breakpoint/breakpoint-marker.js +4 -15
  4. package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -1
  5. package/lib/browser/console/debug-console-contribution.d.ts.map +1 -1
  6. package/lib/browser/console/debug-console-contribution.js +132 -221
  7. package/lib/browser/console/debug-console-contribution.js.map +1 -1
  8. package/lib/browser/console/debug-console-items.js +231 -451
  9. package/lib/browser/console/debug-console-items.js.map +1 -1
  10. package/lib/browser/console/debug-console-session.js +86 -223
  11. package/lib/browser/console/debug-console-session.js.map +1 -1
  12. package/lib/browser/debug-configuration-manager.js +281 -623
  13. package/lib/browser/debug-configuration-manager.js.map +1 -1
  14. package/lib/browser/debug-configuration-model.js +31 -108
  15. package/lib/browser/debug-configuration-model.js.map +1 -1
  16. package/lib/browser/debug-frontend-application-contribution.d.ts +1 -0
  17. package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
  18. package/lib/browser/debug-frontend-application-contribution.js +577 -780
  19. package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
  20. package/lib/browser/debug-frontend-module.js +46 -82
  21. package/lib/browser/debug-frontend-module.js.map +1 -1
  22. package/lib/browser/debug-keybinding-contexts.js +41 -59
  23. package/lib/browser/debug-keybinding-contexts.js.map +1 -1
  24. package/lib/browser/debug-monaco-contribution.js +17 -17
  25. package/lib/browser/debug-monaco-contribution.js.map +1 -1
  26. package/lib/browser/debug-package.spec.js +2 -2
  27. package/lib/browser/debug-package.spec.js.map +1 -1
  28. package/lib/browser/debug-preferences.js +7 -11
  29. package/lib/browser/debug-preferences.js.map +1 -1
  30. package/lib/browser/debug-prefix-configuration.js +101 -117
  31. package/lib/browser/debug-prefix-configuration.js.map +1 -1
  32. package/lib/browser/debug-resource.js +29 -79
  33. package/lib/browser/debug-resource.js.map +1 -1
  34. package/lib/browser/debug-schema-updater.js +54 -193
  35. package/lib/browser/debug-schema-updater.js.map +1 -1
  36. package/lib/browser/debug-session-connection.js +137 -235
  37. package/lib/browser/debug-session-connection.js.map +1 -1
  38. package/lib/browser/debug-session-contribution.js +91 -120
  39. package/lib/browser/debug-session-contribution.js.map +1 -1
  40. package/lib/browser/debug-session-manager.js +368 -652
  41. package/lib/browser/debug-session-manager.js.map +1 -1
  42. package/lib/browser/debug-session.js +556 -1279
  43. package/lib/browser/debug-session.js.map +1 -1
  44. package/lib/browser/debug-tab-bar-decorator.js +32 -38
  45. package/lib/browser/debug-tab-bar-decorator.js.map +1 -1
  46. package/lib/browser/debug-watch-manager.js +41 -138
  47. package/lib/browser/debug-watch-manager.js.map +1 -1
  48. package/lib/browser/editor/debug-breakpoint-widget.js +142 -255
  49. package/lib/browser/editor/debug-breakpoint-widget.js.map +1 -1
  50. package/lib/browser/editor/debug-editor-model.js +299 -474
  51. package/lib/browser/editor/debug-editor-model.js.map +1 -1
  52. package/lib/browser/editor/debug-editor-service.js +128 -206
  53. package/lib/browser/editor/debug-editor-service.js.map +1 -1
  54. package/lib/browser/editor/debug-exception-widget.js +56 -119
  55. package/lib/browser/editor/debug-exception-widget.js.map +1 -1
  56. package/lib/browser/editor/debug-expression-provider.js +21 -24
  57. package/lib/browser/editor/debug-expression-provider.js.map +1 -1
  58. package/lib/browser/editor/debug-hover-source.js +83 -249
  59. package/lib/browser/editor/debug-hover-source.js.map +1 -1
  60. package/lib/browser/editor/debug-hover-widget.js +151 -224
  61. package/lib/browser/editor/debug-hover-widget.js.map +1 -1
  62. package/lib/browser/editor/debug-inline-value-decorator.js +96 -193
  63. package/lib/browser/editor/debug-inline-value-decorator.js.map +1 -1
  64. package/lib/browser/model/debug-breakpoint.js +52 -102
  65. package/lib/browser/model/debug-breakpoint.js.map +1 -1
  66. package/lib/browser/model/debug-function-breakpoint.js +54 -124
  67. package/lib/browser/model/debug-function-breakpoint.js.map +1 -1
  68. package/lib/browser/model/debug-source-breakpoint.js +111 -265
  69. package/lib/browser/model/debug-source-breakpoint.js.map +1 -1
  70. package/lib/browser/model/debug-source.js +45 -126
  71. package/lib/browser/model/debug-source.js.map +1 -1
  72. package/lib/browser/model/debug-stack-frame.js +85 -199
  73. package/lib/browser/model/debug-stack-frame.js.map +1 -1
  74. package/lib/browser/model/debug-thread.js +132 -304
  75. package/lib/browser/model/debug-thread.js.map +1 -1
  76. package/lib/browser/preferences/launch-preferences.js +3 -3
  77. package/lib/browser/preferences/launch-preferences.js.map +1 -1
  78. package/lib/browser/view/debug-action.js +13 -29
  79. package/lib/browser/view/debug-action.js.map +1 -1
  80. package/lib/browser/view/debug-breakpoints-source.js +42 -169
  81. package/lib/browser/view/debug-breakpoints-source.js.map +1 -1
  82. package/lib/browser/view/debug-breakpoints-widget.js +43 -82
  83. package/lib/browser/view/debug-breakpoints-widget.js.map +1 -1
  84. package/lib/browser/view/debug-configuration-widget.js +89 -136
  85. package/lib/browser/view/debug-configuration-widget.js.map +1 -1
  86. package/lib/browser/view/debug-exception-breakpoint.js +7 -9
  87. package/lib/browser/view/debug-exception-breakpoint.js.map +1 -1
  88. package/lib/browser/view/debug-session-widget.js +80 -114
  89. package/lib/browser/view/debug-session-widget.js.map +1 -1
  90. package/lib/browser/view/debug-stack-frames-source.js +58 -169
  91. package/lib/browser/view/debug-stack-frames-source.js.map +1 -1
  92. package/lib/browser/view/debug-stack-frames-widget.js +89 -155
  93. package/lib/browser/view/debug-stack-frames-widget.js.map +1 -1
  94. package/lib/browser/view/debug-threads-source.js +37 -124
  95. package/lib/browser/view/debug-threads-source.js.map +1 -1
  96. package/lib/browser/view/debug-threads-widget.js +61 -99
  97. package/lib/browser/view/debug-threads-widget.js.map +1 -1
  98. package/lib/browser/view/debug-toolbar-widget.js +58 -76
  99. package/lib/browser/view/debug-toolbar-widget.js.map +1 -1
  100. package/lib/browser/view/debug-variables-source.js +32 -102
  101. package/lib/browser/view/debug-variables-source.js.map +1 -1
  102. package/lib/browser/view/debug-variables-widget.js +35 -74
  103. package/lib/browser/view/debug-variables-widget.js.map +1 -1
  104. package/lib/browser/view/debug-view-model.js +172 -381
  105. package/lib/browser/view/debug-view-model.js.map +1 -1
  106. package/lib/browser/view/debug-watch-expression.js +34 -112
  107. package/lib/browser/view/debug-watch-expression.js.map +1 -1
  108. package/lib/browser/view/debug-watch-source.js +30 -87
  109. package/lib/browser/view/debug-watch-source.js.map +1 -1
  110. package/lib/browser/view/debug-watch-widget.js +35 -74
  111. package/lib/browser/view/debug-watch-widget.js.map +1 -1
  112. package/lib/browser/view/debug-widget.js +63 -105
  113. package/lib/browser/view/debug-widget.js.map +1 -1
  114. package/lib/common/debug-service.js +5 -5
  115. package/lib/common/debug-service.js.map +1 -1
  116. package/lib/node/debug-adapter-contribution-registry.js +133 -489
  117. package/lib/node/debug-adapter-contribution-registry.js.map +1 -1
  118. package/lib/node/debug-adapter-factory.js +38 -57
  119. package/lib/node/debug-adapter-factory.js.map +1 -1
  120. package/lib/node/debug-adapter-session-manager.js +50 -98
  121. package/lib/node/debug-adapter-session-manager.js.map +1 -1
  122. package/lib/node/debug-adapter-session.js +44 -93
  123. package/lib/node/debug-adapter-session.js.map +1 -1
  124. package/lib/node/debug-backend-module.js +13 -17
  125. package/lib/node/debug-backend-module.js.map +1 -1
  126. package/lib/node/debug-service-impl.js +71 -213
  127. package/lib/node/debug-service-impl.js.map +1 -1
  128. package/lib/node/vscode/vscode-debug-adapter-contribution.js +153 -294
  129. package/lib/node/vscode/vscode-debug-adapter-contribution.js.map +1 -1
  130. package/package.json +16 -16
  131. package/src/browser/console/debug-console-contribution.tsx +3 -3
  132. package/src/browser/debug-frontend-application-contribution.ts +69 -18
  133. package/src/browser/debug-prefix-configuration.ts +1 -1
  134. package/src/browser/style/index.css +28 -10
  135. package/src/browser/view/debug-action.tsx +2 -2
  136. package/src/browser/view/debug-configuration-widget.tsx +3 -3
  137. package/src/browser/view/debug-session-widget.ts +2 -2
  138. package/src/browser/view/debug-toolbar-widget.tsx +8 -8
  139. package/src/browser/view/debug-widget.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"debug-adapter-session.js","sourceRoot":"","sources":["../../src/node/debug-adapter-session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAelF,gEAAqF;AAErF;;GAEG;AACH;IAUI,iCACa,EAAU,EACA,qBAA4C;QAFnE,iBAWC;QAVY,OAAE,GAAF,EAAE,CAAQ;QACA,0BAAqB,GAArB,qBAAqB,CAAuB;QAPlD,cAAS,GAAG,IAAI,iCAAoB,EAAE,CAAC;QASpD,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YACnB,IAAI,CAAC,qBAAqB;YAC1B,uBAAU,CAAC,MAAM,CAAC,cAAM,OAAA,KAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,EAA/E,CAA+E,CAAC;YACxG,uBAAU,CAAC,MAAM,CAAC,cAAM,OAAA,KAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,EAA9E,CAA8E,CAAC;SAC1G,CAAC,CAAC;IACP,CAAC;IAEK,uCAAK,GAAX,UAAY,OAAmB;;;;gBAC3B,IAAI,IAAI,CAAC,OAAO,EAAE;oBACd,MAAM,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qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IAC9H,CAAC;IAED,KAAK,CAAC,IAAI;QACN,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;;AAlHL,0DAmHC;AAjHkB,gCAAQ,GAAG,UAAU,CAAC;AACtB,sCAAc,GAAG,gBAAgB,CAAC"}
@@ -15,32 +15,28 @@
15
15
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
16
  ********************************************************************************/
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- var common_1 = require("@theia/core/lib/common");
19
- var inversify_1 = require("@theia/core/shared/inversify");
20
- var debug_service_1 = require("../common/debug-service");
21
- var debug_adapter_factory_1 = require("./debug-adapter-factory");
22
- var messaging_service_1 = require("@theia/core/lib/node/messaging/messaging-service");
23
- var connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
24
- var debug_model_1 = require("../common/debug-model");
25
- var debug_service_impl_1 = require("./debug-service-impl");
26
- var debug_adapter_contribution_registry_1 = require("./debug-adapter-contribution-registry");
27
- var debug_adapter_session_manager_1 = require("./debug-adapter-session-manager");
28
- var debugConnectionModule = connection_container_module_1.ConnectionContainerModule.create(function (_a) {
29
- var bind = _a.bind, bindBackendService = _a.bindBackendService;
18
+ const common_1 = require("@theia/core/lib/common");
19
+ const inversify_1 = require("@theia/core/shared/inversify");
20
+ const debug_service_1 = require("../common/debug-service");
21
+ const debug_adapter_factory_1 = require("./debug-adapter-factory");
22
+ const messaging_service_1 = require("@theia/core/lib/node/messaging/messaging-service");
23
+ const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
24
+ const debug_model_1 = require("../common/debug-model");
25
+ const debug_service_impl_1 = require("./debug-service-impl");
26
+ const debug_adapter_contribution_registry_1 = require("./debug-adapter-contribution-registry");
27
+ const debug_adapter_session_manager_1 = require("./debug-adapter-session-manager");
28
+ const debugConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService }) => {
30
29
  common_1.bindContributionProvider(bind, debug_model_1.DebugAdapterContribution);
31
30
  bind(debug_adapter_contribution_registry_1.DebugAdapterContributionRegistry).toSelf().inSingletonScope();
32
31
  bind(debug_service_1.DebugService).to(debug_service_impl_1.DebugServiceImpl).inSingletonScope();
33
32
  bindBackendService(debug_service_1.DebugPath, debug_service_1.DebugService);
34
33
  });
35
- exports.default = new inversify_1.ContainerModule(function (bind) {
34
+ exports.default = new inversify_1.ContainerModule(bind => {
36
35
  bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(debugConnectionModule);
37
36
  bind(debug_model_1.DebugAdapterSessionFactory).to(debug_adapter_factory_1.DebugAdapterSessionFactoryImpl).inSingletonScope();
38
37
  bind(debug_model_1.DebugAdapterFactory).to(debug_adapter_factory_1.LaunchBasedDebugAdapterFactory).inSingletonScope();
39
38
  bind(debug_adapter_session_manager_1.DebugAdapterSessionManager).toSelf().inSingletonScope();
40
39
  bind(messaging_service_1.MessagingService.Contribution).toService(debug_adapter_session_manager_1.DebugAdapterSessionManager);
41
- bind(common_1.ILogger).toDynamicValue(function (_a) {
42
- var container = _a.container;
43
- return container.get(common_1.ILogger).child('debug');
44
- }).inSingletonScope().whenTargetNamed('debug');
40
+ bind(common_1.ILogger).toDynamicValue(({ container }) => container.get(common_1.ILogger).child('debug')).inSingletonScope().whenTargetNamed('debug');
45
41
  });
46
42
  //# sourceMappingURL=debug-backend-module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"debug-backend-module.js","sourceRoot":"","sources":["../../src/node/debug-backend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,iDAA2E;AAC3E,0DAA+D;AAC/D,yDAGiC;AACjC,iEAGiC;AACjC,sFAAoF;AACpF,0GAAuG;AACvG,qDAI+B;AAC/B,2D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CAAC,gBAAgB,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC"}
@@ -23,229 +23,87 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
23
23
  var __metadata = (this && this.__metadata) || function (k, v) {
24
24
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
25
  };
26
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
- return new (P || (P = Promise))(function (resolve, reject) {
29
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33
- });
34
- };
35
- var __generator = (this && this.__generator) || function (thisArg, body) {
36
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
- function verb(n) { return function (v) { return step([n, v]); }; }
39
- function step(op) {
40
- if (f) throw new TypeError("Generator is already executing.");
41
- while (_) try {
42
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
43
- if (y = 0, t) op = [op[0] & 2, t.value];
44
- switch (op[0]) {
45
- case 0: case 1: t = op; break;
46
- case 4: _.label++; return { value: op[1], done: false };
47
- case 5: _.label++; y = op[1]; op = [0]; continue;
48
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
49
- default:
50
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
51
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
52
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
53
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54
- if (t[2]) _.ops.pop();
55
- _.trys.pop(); continue;
56
- }
57
- op = body.call(thisArg, _);
58
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
59
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
60
- }
61
- };
62
- var __read = (this && this.__read) || function (o, n) {
63
- var m = typeof Symbol === "function" && o[Symbol.iterator];
64
- if (!m) return o;
65
- var i = m.call(o), r, ar = [], e;
66
- try {
67
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
68
- }
69
- catch (error) { e = { error: error }; }
70
- finally {
71
- try {
72
- if (r && !r.done && (m = i["return"])) m.call(i);
73
- }
74
- finally { if (e) throw e.error; }
75
- }
76
- return ar;
77
- };
78
- var __spread = (this && this.__spread) || function () {
79
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
80
- return ar;
81
- };
82
- var __values = (this && this.__values) || function(o) {
83
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
84
- if (m) return m.call(o);
85
- if (o && typeof o.length === "number") return {
86
- next: function () {
87
- if (o && i >= o.length) o = void 0;
88
- return { value: o && o[i++], done: !o };
89
- }
90
- };
91
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
92
- };
93
26
  Object.defineProperty(exports, "__esModule", { value: true });
94
27
  exports.DebugServiceImpl = void 0;
95
- var inversify_1 = require("@theia/core/shared/inversify");
96
- var debug_adapter_session_manager_1 = require("./debug-adapter-session-manager");
97
- var debug_adapter_contribution_registry_1 = require("./debug-adapter-contribution-registry");
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const debug_adapter_session_manager_1 = require("./debug-adapter-session-manager");
30
+ const debug_adapter_contribution_registry_1 = require("./debug-adapter-contribution-registry");
98
31
  /**
99
32
  * DebugService implementation.
100
33
  */
101
- var DebugServiceImpl = /** @class */ (function () {
102
- function DebugServiceImpl() {
34
+ let DebugServiceImpl = class DebugServiceImpl {
35
+ constructor() {
103
36
  this.sessions = new Set();
104
37
  }
105
- DebugServiceImpl.prototype.dispose = function () {
38
+ dispose() {
106
39
  this.terminateDebugSession();
107
- };
108
- DebugServiceImpl.prototype.debugTypes = function () {
109
- return __awaiter(this, void 0, void 0, function () {
110
- return __generator(this, function (_a) {
111
- return [2 /*return*/, this.registry.debugTypes()];
112
- });
113
- });
114
- };
115
- DebugServiceImpl.prototype.getDebuggersForLanguage = function (language) {
40
+ }
41
+ async debugTypes() {
42
+ return this.registry.debugTypes();
43
+ }
44
+ getDebuggersForLanguage(language) {
116
45
  return this.registry.getDebuggersForLanguage(language);
117
- };
118
- DebugServiceImpl.prototype.getSchemaAttributes = function (debugType) {
46
+ }
47
+ getSchemaAttributes(debugType) {
119
48
  return this.registry.getSchemaAttributes(debugType);
120
- };
121
- DebugServiceImpl.prototype.getConfigurationSnippets = function () {
49
+ }
50
+ getConfigurationSnippets() {
122
51
  return this.registry.getConfigurationSnippets();
123
- };
124
- DebugServiceImpl.prototype.provideDebugConfigurations = function (debugType, workspaceFolderUri) {
125
- return __awaiter(this, void 0, void 0, function () {
126
- return __generator(this, function (_a) {
127
- return [2 /*return*/, this.registry.provideDebugConfigurations(debugType, workspaceFolderUri)];
128
- });
129
- });
130
- };
131
- DebugServiceImpl.prototype.resolveDebugConfiguration = function (config, workspaceFolderUri) {
132
- return __awaiter(this, void 0, void 0, function () {
133
- return __generator(this, function (_a) {
134
- return [2 /*return*/, this.registry.resolveDebugConfiguration(config, workspaceFolderUri)];
135
- });
136
- });
137
- };
138
- DebugServiceImpl.prototype.resolveDebugConfigurationWithSubstitutedVariables = function (config, workspaceFolderUri) {
139
- return __awaiter(this, void 0, void 0, function () {
140
- return __generator(this, function (_a) {
141
- return [2 /*return*/, this.registry.resolveDebugConfigurationWithSubstitutedVariables(config, workspaceFolderUri)];
142
- });
143
- });
144
- };
145
- DebugServiceImpl.prototype.createDebugSession = function (config) {
146
- return __awaiter(this, void 0, void 0, function () {
147
- var session;
148
- return __generator(this, function (_a) {
149
- switch (_a.label) {
150
- case 0: return [4 /*yield*/, this.sessionManager.create(config, this.registry)];
151
- case 1:
152
- session = _a.sent();
153
- this.sessions.add(session.id);
154
- return [2 /*return*/, session.id];
155
- }
156
- });
157
- });
158
- };
159
- DebugServiceImpl.prototype.terminateDebugSession = function (sessionId) {
160
- return __awaiter(this, void 0, void 0, function () {
161
- var promises, sessions, _loop_1, sessions_1, sessions_1_1, session;
162
- var e_1, _a;
163
- var _this = this;
164
- return __generator(this, function (_b) {
165
- switch (_b.label) {
166
- case 0:
167
- if (!sessionId) return [3 /*break*/, 2];
168
- return [4 /*yield*/, this.doStop(sessionId)];
169
- case 1:
170
- _b.sent();
171
- return [3 /*break*/, 4];
172
- case 2:
173
- promises = [];
174
- sessions = __spread(this.sessions);
175
- this.sessions.clear();
176
- _loop_1 = function (session) {
177
- promises.push((function () { return __awaiter(_this, void 0, void 0, function () {
178
- var e_2;
179
- return __generator(this, function (_a) {
180
- switch (_a.label) {
181
- case 0:
182
- _a.trys.push([0, 2, , 3]);
183
- return [4 /*yield*/, this.doStop(session)];
184
- case 1:
185
- _a.sent();
186
- return [3 /*break*/, 3];
187
- case 2:
188
- e_2 = _a.sent();
189
- console.error('terminateDebugSession failed:', e_2);
190
- return [3 /*break*/, 3];
191
- case 3: return [2 /*return*/];
192
- }
193
- });
194
- }); })());
195
- };
196
- try {
197
- for (sessions_1 = __values(sessions), sessions_1_1 = sessions_1.next(); !sessions_1_1.done; sessions_1_1 = sessions_1.next()) {
198
- session = sessions_1_1.value;
199
- _loop_1(session);
200
- }
201
- }
202
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
203
- finally {
204
- try {
205
- if (sessions_1_1 && !sessions_1_1.done && (_a = sessions_1.return)) _a.call(sessions_1);
206
- }
207
- finally { if (e_1) throw e_1.error; }
208
- }
209
- return [4 /*yield*/, Promise.all(promises)];
210
- case 3:
211
- _b.sent();
212
- _b.label = 4;
213
- case 4: return [2 /*return*/];
214
- }
215
- });
216
- });
217
- };
218
- DebugServiceImpl.prototype.doStop = function (sessionId) {
219
- return __awaiter(this, void 0, void 0, function () {
220
- var debugSession;
221
- return __generator(this, function (_a) {
222
- switch (_a.label) {
223
- case 0:
224
- debugSession = this.sessionManager.find(sessionId);
225
- if (!debugSession) return [3 /*break*/, 2];
226
- this.sessionManager.remove(sessionId);
227
- this.sessions.delete(sessionId);
228
- return [4 /*yield*/, debugSession.stop()];
229
- case 1:
230
- _a.sent();
231
- _a.label = 2;
232
- case 2: return [2 /*return*/];
233
- }
234
- });
235
- });
236
- };
237
- __decorate([
238
- inversify_1.inject(debug_adapter_session_manager_1.DebugAdapterSessionManager),
239
- __metadata("design:type", debug_adapter_session_manager_1.DebugAdapterSessionManager)
240
- ], DebugServiceImpl.prototype, "sessionManager", void 0);
241
- __decorate([
242
- inversify_1.inject(debug_adapter_contribution_registry_1.DebugAdapterContributionRegistry),
243
- __metadata("design:type", debug_adapter_contribution_registry_1.DebugAdapterContributionRegistry)
244
- ], DebugServiceImpl.prototype, "registry", void 0);
245
- DebugServiceImpl = __decorate([
246
- inversify_1.injectable()
247
- ], DebugServiceImpl);
248
- return DebugServiceImpl;
249
- }());
52
+ }
53
+ async provideDebugConfigurations(debugType, workspaceFolderUri) {
54
+ return this.registry.provideDebugConfigurations(debugType, workspaceFolderUri);
55
+ }
56
+ async resolveDebugConfiguration(config, workspaceFolderUri) {
57
+ return this.registry.resolveDebugConfiguration(config, workspaceFolderUri);
58
+ }
59
+ async resolveDebugConfigurationWithSubstitutedVariables(config, workspaceFolderUri) {
60
+ return this.registry.resolveDebugConfigurationWithSubstitutedVariables(config, workspaceFolderUri);
61
+ }
62
+ async createDebugSession(config) {
63
+ const session = await this.sessionManager.create(config, this.registry);
64
+ this.sessions.add(session.id);
65
+ return session.id;
66
+ }
67
+ async terminateDebugSession(sessionId) {
68
+ if (sessionId) {
69
+ await this.doStop(sessionId);
70
+ }
71
+ else {
72
+ const promises = [];
73
+ const sessions = [...this.sessions];
74
+ this.sessions.clear();
75
+ for (const session of sessions) {
76
+ promises.push((async () => {
77
+ try {
78
+ await this.doStop(session);
79
+ }
80
+ catch (e) {
81
+ console.error('terminateDebugSession failed:', e);
82
+ }
83
+ })());
84
+ }
85
+ await Promise.all(promises);
86
+ }
87
+ }
88
+ async doStop(sessionId) {
89
+ const debugSession = this.sessionManager.find(sessionId);
90
+ if (debugSession) {
91
+ this.sessionManager.remove(sessionId);
92
+ this.sessions.delete(sessionId);
93
+ await debugSession.stop();
94
+ }
95
+ }
96
+ };
97
+ __decorate([
98
+ inversify_1.inject(debug_adapter_session_manager_1.DebugAdapterSessionManager),
99
+ __metadata("design:type", debug_adapter_session_manager_1.DebugAdapterSessionManager)
100
+ ], DebugServiceImpl.prototype, "sessionManager", void 0);
101
+ __decorate([
102
+ inversify_1.inject(debug_adapter_contribution_registry_1.DebugAdapterContributionRegistry),
103
+ __metadata("design:type", debug_adapter_contribution_registry_1.DebugAdapterContributionRegistry)
104
+ ], DebugServiceImpl.prototype, "registry", void 0);
105
+ DebugServiceImpl = __decorate([
106
+ inversify_1.injectable()
107
+ ], DebugServiceImpl);
250
108
  exports.DebugServiceImpl = DebugServiceImpl;
251
109
  //# sourceMappingURL=debug-service-impl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"debug-service-impl.js","sourceRoot":"","sources":["../../src/node/debug-service-impl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElF,0DAAkE;AAKlE,iFAA6E;AAC7E,6FAAyF;AAEzF;;GAEG;AAEH;IAAA;QAsCuB,aAAQ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SAAS,CAAC,CAAC;YAChC,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;SAC7B;IACL,CAAC;CAEJ,CAAA;AAtEG;IADC,kBAAM,CAAC,0DAA0B,CAAC;8BACA,0DAA0B;wDAAC;AAG9D;IADC,kBAAM,CAAC,sEAAgC,CAAC;8BACZ,sEAAgC;kDAAC;AANrD,gBAAgB;IAD5B,sBAAU,EAAE;GACA,gBAAgB,CAyE5B;AAzEY,4CAAgB"}
@@ -26,80 +26,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
26
26
  var __param = (this && this.__param) || function (paramIndex, decorator) {
27
27
  return function (target, key) { decorator(target, key, paramIndex); }
28
28
  };
29
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
30
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
31
- return new (P || (P = Promise))(function (resolve, reject) {
32
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
33
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
34
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
35
- step((generator = generator.apply(thisArg, _arguments || [])).next());
36
- });
37
- };
38
- var __generator = (this && this.__generator) || function (thisArg, body) {
39
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
40
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
41
- function verb(n) { return function (v) { return step([n, v]); }; }
42
- function step(op) {
43
- if (f) throw new TypeError("Generator is already executing.");
44
- while (_) try {
45
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
46
- if (y = 0, t) op = [op[0] & 2, t.value];
47
- switch (op[0]) {
48
- case 0: case 1: t = op; break;
49
- case 4: _.label++; return { value: op[1], done: false };
50
- case 5: _.label++; y = op[1]; op = [0]; continue;
51
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
52
- default:
53
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
54
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
55
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
56
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
57
- if (t[2]) _.ops.pop();
58
- _.trys.pop(); continue;
59
- }
60
- op = body.call(thisArg, _);
61
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
62
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
63
- }
64
- };
65
- var __values = (this && this.__values) || function(o) {
66
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
67
- if (m) return m.call(o);
68
- if (o && typeof o.length === "number") return {
69
- next: function () {
70
- if (o && i >= o.length) o = void 0;
71
- return { value: o && o[i++], done: !o };
72
- }
73
- };
74
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
75
- };
76
- var __read = (this && this.__read) || function (o, n) {
77
- var m = typeof Symbol === "function" && o[Symbol.iterator];
78
- if (!m) return o;
79
- var i = m.call(o), r, ar = [], e;
80
- try {
81
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
82
- }
83
- catch (error) { e = { error: error }; }
84
- finally {
85
- try {
86
- if (r && !r.done && (m = i["return"])) m.call(i);
87
- }
88
- finally { if (e) throw e.error; }
89
- }
90
- return ar;
91
- };
92
- var __spread = (this && this.__spread) || function () {
93
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
94
- return ar;
95
- };
96
29
  Object.defineProperty(exports, "__esModule", { value: true });
97
30
  exports.AbstractVSCodeDebugAdapterContribution = exports.VSCodeDebuggerContribution = void 0;
98
- var fs = require("@theia/core/shared/fs-extra");
99
- var path = require("path");
100
- var os_1 = require("@theia/core/lib/common/os");
101
- var objects_1 = require("@theia/core/lib/common/objects");
102
- var inversify_1 = require("@theia/core/shared/inversify");
31
+ const fs = require("@theia/core/shared/fs-extra");
32
+ const path = require("path");
33
+ const os_1 = require("@theia/core/lib/common/os");
34
+ const objects_1 = require("@theia/core/lib/common/objects");
35
+ const inversify_1 = require("@theia/core/shared/inversify");
103
36
  var nls;
104
37
  (function (nls) {
105
38
  function localize(key, _default) {
@@ -107,7 +40,7 @@ var nls;
107
40
  }
108
41
  nls.localize = localize;
109
42
  })(nls || (nls = {}));
110
- var INTERNAL_CONSOLE_OPTIONS_SCHEMA = {
43
+ const INTERNAL_CONSOLE_OPTIONS_SCHEMA = {
111
44
  enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'],
112
45
  default: 'openOnFirstSessionStart',
113
46
  description: nls.localize('internalConsoleOptions', 'Controls when the internal debug console should open.')
@@ -128,235 +61,161 @@ var VSCodeDebuggerContribution;
128
61
  }
129
62
  VSCodeDebuggerContribution.toPlatformInfo = toPlatformInfo;
130
63
  })(VSCodeDebuggerContribution = exports.VSCodeDebuggerContribution || (exports.VSCodeDebuggerContribution = {}));
131
- var AbstractVSCodeDebugAdapterContribution = /** @class */ (function () {
132
- function AbstractVSCodeDebugAdapterContribution(type, extensionPath) {
64
+ let AbstractVSCodeDebugAdapterContribution = class AbstractVSCodeDebugAdapterContribution {
65
+ constructor(type, extensionPath) {
133
66
  this.type = type;
134
67
  this.extensionPath = extensionPath;
135
68
  this.pckPath = path.join(this.extensionPath, 'package.json');
136
69
  this.pck = this.parse();
137
70
  this.debuggerContribution = this.resolveDebuggerContribution();
138
- this.label = this.debuggerContribution.then(function (_a) {
139
- var label = _a.label;
140
- return label;
141
- });
142
- this.languages = this.debuggerContribution.then(function (_a) {
143
- var languages = _a.languages;
144
- return languages;
145
- });
71
+ this.label = this.debuggerContribution.then(({ label }) => label);
72
+ this.languages = this.debuggerContribution.then(({ languages }) => languages);
146
73
  this.schemaAttributes = this.resolveSchemaAttributes();
147
74
  }
148
- AbstractVSCodeDebugAdapterContribution.prototype.parse = function () {
149
- return __awaiter(this, void 0, void 0, function () {
150
- var text, nlsPath, nlsMap, _a, _b, key, value;
151
- var e_1, _c;
152
- return __generator(this, function (_d) {
153
- switch (_d.label) {
154
- case 0: return [4 /*yield*/, fs.readFile(this.pckPath, 'utf8')];
155
- case 1:
156
- text = _d.sent();
157
- nlsPath = path.join(this.extensionPath, 'package.nls.json');
158
- return [4 /*yield*/, fs.pathExists(nlsPath)];
159
- case 2:
160
- if (!_d.sent()) return [3 /*break*/, 4];
161
- return [4 /*yield*/, fs.readJSON(nlsPath)];
162
- case 3:
163
- nlsMap = _d.sent();
164
- try {
165
- for (_a = __values(Object.keys(nlsMap)), _b = _a.next(); !_b.done; _b = _a.next()) {
166
- key = _b.value;
167
- value = nlsMap[key].replace(/\"/g, '\\"');
168
- text = text.split('%' + key + '%').join(value);
169
- }
170
- }
171
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
172
- finally {
173
- try {
174
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
175
- }
176
- finally { if (e_1) throw e_1.error; }
177
- }
178
- _d.label = 4;
179
- case 4: return [2 /*return*/, JSON.parse(text)];
180
- }
181
- });
182
- });
183
- };
184
- AbstractVSCodeDebugAdapterContribution.prototype.resolveDebuggerContribution = function () {
185
- return __awaiter(this, void 0, void 0, function () {
186
- var pck, debuggerContribution;
187
- var _this = this;
188
- return __generator(this, function (_a) {
189
- switch (_a.label) {
190
- case 0: return [4 /*yield*/, this.pck];
191
- case 1:
192
- pck = _a.sent();
193
- debuggerContribution = pck.contributes.debuggers.find(function (d) { return d.type === _this.type; });
194
- if (!debuggerContribution) {
195
- throw new Error("Debugger contribution for '" + this.type + "' type is not found in " + this.pckPath);
196
- }
197
- return [2 /*return*/, debuggerContribution];
198
- }
199
- });
200
- });
201
- };
202
- AbstractVSCodeDebugAdapterContribution.prototype.getSchemaAttributes = function () {
203
- return __awaiter(this, void 0, void 0, function () {
204
- return __generator(this, function (_a) {
205
- return [2 /*return*/, this.schemaAttributes || (this.schemaAttributes = this.resolveSchemaAttributes())];
206
- });
207
- });
208
- };
209
- AbstractVSCodeDebugAdapterContribution.prototype.resolveSchemaAttributes = function () {
210
- return __awaiter(this, void 0, void 0, function () {
211
- var debuggerContribution, taskSchema, configurationAttributes;
212
- var _this = this;
213
- return __generator(this, function (_a) {
214
- switch (_a.label) {
215
- case 0: return [4 /*yield*/, this.debuggerContribution];
216
- case 1:
217
- debuggerContribution = _a.sent();
218
- if (!debuggerContribution.configurationAttributes) {
219
- return [2 /*return*/, []];
220
- }
221
- taskSchema = {};
222
- configurationAttributes = debuggerContribution.configurationAttributes;
223
- return [2 /*return*/, Object.keys(configurationAttributes).map(function (request) {
224
- var attributes = objects_1.deepClone(configurationAttributes[request]);
225
- var defaultRequired = ['name', 'type', 'request'];
226
- attributes.required = attributes.required && attributes.required.length ? defaultRequired.concat(attributes.required) : defaultRequired;
227
- attributes.additionalProperties = false;
228
- attributes.type = 'object';
229
- if (!attributes.properties) {
230
- attributes.properties = {};
231
- }
232
- var properties = attributes.properties;
233
- properties['type'] = {
234
- enum: [_this.type],
235
- description: nls.localize('debugType', 'Type of configuration.'),
236
- pattern: '^(?!node2)',
237
- errorMessage: nls.localize('debugTypeNotRecognised', 'The debug type is not recognized. Make sure that you have a corresponding debug extension installed and that it is enabled.'),
238
- patternErrorMessage: nls.localize('node2NotSupported', '"node2" is no longer supported, use "node" instead and set the "protocol" attribute to "inspector".')
239
- };
240
- properties['name'] = {
241
- type: 'string',
242
- description: nls.localize('debugName', 'Name of configuration; appears in the launch configuration drop down menu.'),
243
- default: 'Launch'
244
- };
245
- properties['request'] = {
246
- enum: [request],
247
- description: nls.localize('debugRequest', 'Request type of configuration. Can be "launch" or "attach".'),
248
- };
249
- properties['debugServer'] = {
250
- type: 'number',
251
- description: nls.localize('debugServer', 'For debug extension development only: if a port is specified VS Code tries to connect to a debug adapter running in server mode'),
252
- default: 4711
253
- };
254
- properties['preLaunchTask'] = {
255
- anyOf: [taskSchema, {
256
- type: ['string'],
257
- }],
258
- default: '',
259
- defaultSnippets: [{ body: { task: '', type: '' } }],
260
- description: nls.localize('debugPrelaunchTask', 'Task to run before debug session starts.')
261
- };
262
- properties['postDebugTask'] = {
263
- anyOf: [taskSchema, {
264
- type: ['string'],
265
- }],
266
- default: '',
267
- defaultSnippets: [{ body: { task: '', type: '' } }],
268
- description: nls.localize('debugPostDebugTask', 'Task to run after debug session ends.')
269
- };
270
- properties['internalConsoleOptions'] = INTERNAL_CONSOLE_OPTIONS_SCHEMA;
271
- var osProperties = Object.assign({}, properties);
272
- properties['windows'] = {
273
- type: 'object',
274
- description: nls.localize('debugWindowsConfiguration', 'Windows specific launch configuration attributes.'),
275
- properties: osProperties
276
- };
277
- properties['osx'] = {
278
- type: 'object',
279
- description: nls.localize('debugOSXConfiguration', 'OS X specific launch configuration attributes.'),
280
- properties: osProperties
281
- };
282
- properties['linux'] = {
283
- type: 'object',
284
- description: nls.localize('debugLinuxConfiguration', 'Linux specific launch configuration attributes.'),
285
- properties: osProperties
286
- };
287
- Object.keys(attributes.properties).forEach(function (name) {
288
- // Use schema allOf property to get independent error reporting #21113
289
- attributes.properties[name].pattern = attributes.properties[name].pattern || '^(?!.*\\$\\{(env|config|command)\\.)';
290
- attributes.properties[name].patternErrorMessage = attributes.properties[name].patternErrorMessage ||
291
- nls.localize('deprecatedVariables', "'env.', 'config.' and 'command.' are deprecated, use 'env:', 'config:' and 'command:' instead.");
292
- });
293
- return attributes;
294
- })];
295
- }
296
- });
297
- });
298
- };
299
- AbstractVSCodeDebugAdapterContribution.prototype.getConfigurationSnippets = function () {
300
- return __awaiter(this, void 0, void 0, function () {
301
- var debuggerContribution;
302
- return __generator(this, function (_a) {
303
- switch (_a.label) {
304
- case 0: return [4 /*yield*/, this.debuggerContribution];
305
- case 1:
306
- debuggerContribution = _a.sent();
307
- return [2 /*return*/, debuggerContribution.configurationSnippets || []];
308
- }
309
- });
310
- });
311
- };
312
- AbstractVSCodeDebugAdapterContribution.prototype.provideDebugAdapterExecutable = function () {
313
- return __awaiter(this, void 0, void 0, function () {
314
- var contribution, info, program, programArgs, runtime, runtimeArgs, modulePath, command, args;
315
- return __generator(this, function (_a) {
316
- switch (_a.label) {
317
- case 0: return [4 /*yield*/, this.debuggerContribution];
318
- case 1:
319
- contribution = _a.sent();
320
- info = VSCodeDebuggerContribution.toPlatformInfo(contribution);
321
- program = (info && info.program || contribution.program);
322
- if (!program) {
323
- return [2 /*return*/, undefined];
324
- }
325
- program = path.join(this.extensionPath, program);
326
- programArgs = info && info.args || contribution.args || [];
327
- runtime = info && info.runtime || contribution.runtime;
328
- if (runtime && runtime.indexOf('./') === 0) {
329
- runtime = path.join(this.extensionPath, runtime);
330
- }
331
- runtimeArgs = info && info.runtimeArgs || contribution.runtimeArgs || [];
332
- if (runtime === 'node') {
333
- modulePath = program;
334
- return [2 /*return*/, {
335
- modulePath: modulePath,
336
- execArgv: runtimeArgs,
337
- args: programArgs
338
- }];
339
- }
340
- else {
341
- command = runtime ? runtime : program;
342
- args = runtime ? __spread(runtimeArgs, [program], programArgs) : programArgs;
343
- return [2 /*return*/, {
344
- command: command,
345
- args: args
346
- }];
347
- }
348
- return [2 /*return*/];
349
- }
75
+ async parse() {
76
+ let text = await fs.readFile(this.pckPath, 'utf8');
77
+ const nlsPath = path.join(this.extensionPath, 'package.nls.json');
78
+ if (await fs.pathExists(nlsPath)) {
79
+ const nlsMap = await fs.readJSON(nlsPath);
80
+ for (const key of Object.keys(nlsMap)) {
81
+ const value = nlsMap[key].replace(/\"/g, '\\"');
82
+ text = text.split('%' + key + '%').join(value);
83
+ }
84
+ }
85
+ return JSON.parse(text);
86
+ }
87
+ async resolveDebuggerContribution() {
88
+ const pck = await this.pck;
89
+ const debuggerContribution = pck.contributes.debuggers.find(d => d.type === this.type);
90
+ if (!debuggerContribution) {
91
+ throw new Error(`Debugger contribution for '${this.type}' type is not found in ${this.pckPath}`);
92
+ }
93
+ return debuggerContribution;
94
+ }
95
+ async getSchemaAttributes() {
96
+ return this.schemaAttributes || (this.schemaAttributes = this.resolveSchemaAttributes());
97
+ }
98
+ async resolveSchemaAttributes() {
99
+ const debuggerContribution = await this.debuggerContribution;
100
+ if (!debuggerContribution.configurationAttributes) {
101
+ return [];
102
+ }
103
+ const taskSchema = {}; // TODO
104
+ const { configurationAttributes } = debuggerContribution;
105
+ return Object.keys(configurationAttributes).map(request => {
106
+ const attributes = objects_1.deepClone(configurationAttributes[request]);
107
+ const defaultRequired = ['name', 'type', 'request'];
108
+ attributes.required = attributes.required && attributes.required.length ? defaultRequired.concat(attributes.required) : defaultRequired;
109
+ attributes.additionalProperties = false;
110
+ attributes.type = 'object';
111
+ if (!attributes.properties) {
112
+ attributes.properties = {};
113
+ }
114
+ const properties = attributes.properties;
115
+ properties['type'] = {
116
+ enum: [this.type],
117
+ description: nls.localize('debugType', 'Type of configuration.'),
118
+ pattern: '^(?!node2)',
119
+ errorMessage: nls.localize('debugTypeNotRecognised', 'The debug type is not recognized. Make sure that you have a corresponding debug extension installed and that it is enabled.'),
120
+ patternErrorMessage: nls.localize('node2NotSupported', '"node2" is no longer supported, use "node" instead and set the "protocol" attribute to "inspector".')
121
+ };
122
+ properties['name'] = {
123
+ type: 'string',
124
+ description: nls.localize('debugName', 'Name of configuration; appears in the launch configuration drop down menu.'),
125
+ default: 'Launch'
126
+ };
127
+ properties['request'] = {
128
+ enum: [request],
129
+ description: nls.localize('debugRequest', 'Request type of configuration. Can be "launch" or "attach".'),
130
+ };
131
+ properties['debugServer'] = {
132
+ type: 'number',
133
+ description: nls.localize('debugServer', 'For debug extension development only: if a port is specified VS Code tries to connect to a debug adapter running in server mode'),
134
+ default: 4711
135
+ };
136
+ properties['preLaunchTask'] = {
137
+ anyOf: [taskSchema, {
138
+ type: ['string'],
139
+ }],
140
+ default: '',
141
+ defaultSnippets: [{ body: { task: '', type: '' } }],
142
+ description: nls.localize('debugPrelaunchTask', 'Task to run before debug session starts.')
143
+ };
144
+ properties['postDebugTask'] = {
145
+ anyOf: [taskSchema, {
146
+ type: ['string'],
147
+ }],
148
+ default: '',
149
+ defaultSnippets: [{ body: { task: '', type: '' } }],
150
+ description: nls.localize('debugPostDebugTask', 'Task to run after debug session ends.')
151
+ };
152
+ properties['internalConsoleOptions'] = INTERNAL_CONSOLE_OPTIONS_SCHEMA;
153
+ const osProperties = Object.assign({}, properties);
154
+ properties['windows'] = {
155
+ type: 'object',
156
+ description: nls.localize('debugWindowsConfiguration', 'Windows specific launch configuration attributes.'),
157
+ properties: osProperties
158
+ };
159
+ properties['osx'] = {
160
+ type: 'object',
161
+ description: nls.localize('debugOSXConfiguration', 'OS X specific launch configuration attributes.'),
162
+ properties: osProperties
163
+ };
164
+ properties['linux'] = {
165
+ type: 'object',
166
+ description: nls.localize('debugLinuxConfiguration', 'Linux specific launch configuration attributes.'),
167
+ properties: osProperties
168
+ };
169
+ Object.keys(attributes.properties).forEach(name => {
170
+ // Use schema allOf property to get independent error reporting #21113
171
+ attributes.properties[name].pattern = attributes.properties[name].pattern || '^(?!.*\\$\\{(env|config|command)\\.)';
172
+ attributes.properties[name].patternErrorMessage = attributes.properties[name].patternErrorMessage ||
173
+ nls.localize('deprecatedVariables', "'env.', 'config.' and 'command.' are deprecated, use 'env:', 'config:' and 'command:' instead.");
350
174
  });
175
+ return attributes;
351
176
  });
352
- };
353
- AbstractVSCodeDebugAdapterContribution = __decorate([
354
- inversify_1.injectable(),
355
- __param(0, inversify_1.unmanaged()),
356
- __param(1, inversify_1.unmanaged()),
357
- __metadata("design:paramtypes", [String, String])
358
- ], AbstractVSCodeDebugAdapterContribution);
359
- return AbstractVSCodeDebugAdapterContribution;
360
- }());
177
+ }
178
+ async getConfigurationSnippets() {
179
+ const debuggerContribution = await this.debuggerContribution;
180
+ return debuggerContribution.configurationSnippets || [];
181
+ }
182
+ async provideDebugAdapterExecutable() {
183
+ const contribution = await this.debuggerContribution;
184
+ const info = VSCodeDebuggerContribution.toPlatformInfo(contribution);
185
+ let program = (info && info.program || contribution.program);
186
+ if (!program) {
187
+ return undefined;
188
+ }
189
+ program = path.join(this.extensionPath, program);
190
+ const programArgs = info && info.args || contribution.args || [];
191
+ let runtime = info && info.runtime || contribution.runtime;
192
+ if (runtime && runtime.indexOf('./') === 0) {
193
+ runtime = path.join(this.extensionPath, runtime);
194
+ }
195
+ const runtimeArgs = info && info.runtimeArgs || contribution.runtimeArgs || [];
196
+ if (runtime === 'node') {
197
+ const modulePath = program;
198
+ return {
199
+ modulePath: modulePath,
200
+ execArgv: runtimeArgs,
201
+ args: programArgs
202
+ };
203
+ }
204
+ else {
205
+ const command = runtime ? runtime : program;
206
+ const args = runtime ? [...runtimeArgs, program, ...programArgs] : programArgs;
207
+ return {
208
+ command,
209
+ args
210
+ };
211
+ }
212
+ }
213
+ };
214
+ AbstractVSCodeDebugAdapterContribution = __decorate([
215
+ inversify_1.injectable(),
216
+ __param(0, inversify_1.unmanaged()),
217
+ __param(1, inversify_1.unmanaged()),
218
+ __metadata("design:paramtypes", [String, String])
219
+ ], AbstractVSCodeDebugAdapterContribution);
361
220
  exports.AbstractVSCodeDebugAdapterContribution = AbstractVSCodeDebugAdapterContribution;
362
221
  //# sourceMappingURL=vscode-debug-adapter-contribution.js.map