@theia/debug 1.18.0-next.0f7dec1a → 1.18.0-next.104
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.
- package/LICENSE +642 -0
- package/lib/browser/console/debug-console-items.d.ts +2 -1
- package/lib/browser/console/debug-console-items.d.ts.map +1 -1
- package/lib/browser/console/debug-console-items.js +4 -1
- package/lib/browser/console/debug-console-items.js.map +1 -1
- package/lib/browser/console/debug-console-session.d.ts +1 -1
- package/lib/browser/debug-configuration-manager.d.ts +7 -0
- package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
- package/lib/browser/debug-configuration-manager.js +20 -8
- package/lib/browser/debug-configuration-manager.js.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.d.ts +1 -0
- package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.js +3 -0
- package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
- package/lib/browser/debug-preferences.d.ts +1 -0
- package/lib/browser/debug-preferences.d.ts.map +1 -1
- package/lib/browser/debug-preferences.js +10 -0
- package/lib/browser/debug-preferences.js.map +1 -1
- package/lib/browser/debug-prefix-configuration.d.ts +1 -1
- package/lib/browser/debug-prefix-configuration.d.ts.map +1 -1
- package/lib/browser/debug-prefix-configuration.js +20 -3
- package/lib/browser/debug-prefix-configuration.js.map +1 -1
- package/lib/browser/debug-session-connection.d.ts +1 -1
- package/lib/browser/debug-session-connection.d.ts.map +1 -1
- package/lib/browser/debug-session-contribution.d.ts +1 -1
- package/lib/browser/debug-session-contribution.d.ts.map +1 -1
- package/lib/browser/debug-session-contribution.js +1 -1
- package/lib/browser/debug-session-contribution.js.map +1 -1
- package/lib/browser/view/debug-configuration-widget.d.ts +1 -1
- package/lib/browser/view/debug-configuration-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-configuration-widget.js +2 -3
- package/lib/browser/view/debug-configuration-widget.js.map +1 -1
- package/lib/browser/view/debug-session-widget.d.ts +2 -1
- package/lib/browser/view/debug-session-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-session-widget.js +12 -6
- package/lib/browser/view/debug-session-widget.js.map +1 -1
- package/lib/common/debug-configuration.d.ts +2 -0
- package/lib/common/debug-configuration.d.ts.map +1 -1
- package/lib/common/debug-configuration.js.map +1 -1
- package/lib/common/debug-service.d.ts +8 -0
- package/lib/common/debug-service.d.ts.map +1 -1
- package/lib/common/debug-service.js.map +1 -1
- package/lib/node/debug-adapter-contribution-registry.d.ts +1 -1
- package/lib/node/debug-adapter-contribution-registry.d.ts.map +1 -1
- package/lib/node/debug-adapter-contribution-registry.js +1 -1
- package/lib/node/debug-adapter-contribution-registry.js.map +1 -1
- package/lib/node/debug-adapter-factory.d.ts +1 -1
- package/lib/node/debug-adapter-factory.d.ts.map +1 -1
- package/lib/node/debug-adapter-factory.js +8 -10
- package/lib/node/debug-adapter-factory.js.map +1 -1
- package/lib/node/debug-adapter-session-manager.d.ts +1 -1
- package/lib/node/debug-adapter-session-manager.d.ts.map +1 -1
- package/lib/node/debug-adapter-session-manager.js +1 -1
- package/lib/node/debug-adapter-session-manager.js.map +1 -1
- package/lib/node/debug-adapter-session.d.ts +1 -7
- package/lib/node/debug-adapter-session.d.ts.map +1 -1
- package/lib/node/debug-adapter-session.js +4 -48
- package/lib/node/debug-adapter-session.js.map +1 -1
- package/lib/node/debug-backend-module.js +1 -1
- package/lib/node/debug-backend-module.js.map +1 -1
- package/lib/{common → node}/debug-model.d.ts +6 -5
- package/lib/node/debug-model.d.ts.map +1 -0
- package/lib/{common → node}/debug-model.js +0 -0
- package/lib/node/debug-model.js.map +1 -0
- package/lib/node/inline-communication-provider.d.ts +33 -0
- package/lib/node/inline-communication-provider.d.ts.map +1 -0
- package/lib/node/inline-communication-provider.js +43 -0
- package/lib/node/inline-communication-provider.js.map +1 -0
- package/lib/node/stream-communication-provider.d.ts +38 -0
- package/lib/node/stream-communication-provider.d.ts.map +1 -0
- package/lib/node/stream-communication-provider.js +88 -0
- package/lib/node/stream-communication-provider.js.map +1 -0
- package/lib/node/vscode/vscode-debug-adapter-contribution.d.ts +1 -1
- package/lib/node/vscode/vscode-debug-adapter-contribution.d.ts.map +1 -1
- package/package.json +22 -20
- package/src/browser/console/debug-console-items.tsx +6 -2
- package/src/browser/debug-configuration-manager.ts +26 -9
- package/src/browser/debug-frontend-application-contribution.ts +6 -2
- package/src/browser/debug-preferences.ts +11 -0
- package/src/browser/debug-prefix-configuration.ts +24 -3
- package/src/browser/debug-session-connection.ts +1 -1
- package/src/browser/debug-session-contribution.ts +1 -1
- package/src/browser/view/debug-configuration-widget.tsx +1 -2
- package/src/browser/view/debug-session-widget.ts +12 -6
- package/src/common/debug-configuration.ts +3 -0
- package/src/common/debug-service.ts +6 -0
- package/src/node/debug-adapter-contribution-registry.ts +1 -1
- package/src/node/debug-adapter-factory.ts +10 -11
- package/src/node/debug-adapter-session-manager.ts +1 -1
- package/src/node/debug-adapter-session.ts +8 -57
- package/src/node/debug-backend-module.ts +1 -1
- package/src/{common → node}/debug-model.ts +6 -4
- package/src/node/inline-communication-provider.ts +44 -0
- package/src/node/stream-communication-provider.ts +93 -0
- package/src/node/vscode/vscode-debug-adapter-contribution.ts +1 -1
- package/lib/common/debug-model.d.ts.map +0 -1
- package/lib/common/debug-model.js.map +0 -1
|
@@ -25,13 +25,14 @@ class DebugAdapterSessionImpl {
|
|
|
25
25
|
this.id = id;
|
|
26
26
|
this.communicationProvider = communicationProvider;
|
|
27
27
|
this.toDispose = new disposable_1.DisposableCollection();
|
|
28
|
-
this.contentLength = -1;
|
|
29
|
-
this.buffer = Buffer.alloc(0);
|
|
30
28
|
this.toDispose.pushAll([
|
|
31
29
|
this.communicationProvider,
|
|
32
30
|
disposable_1.Disposable.create(() => this.write(JSON.stringify({ seq: -1, type: 'request', command: 'disconnect' }))),
|
|
33
31
|
disposable_1.Disposable.create(() => this.write(JSON.stringify({ seq: -1, type: 'request', command: 'terminate' })))
|
|
34
32
|
]);
|
|
33
|
+
this.communicationProvider.onMessageReceived((message) => this.send(message));
|
|
34
|
+
this.communicationProvider.onClose(() => this.onDebugAdapterExit(1, undefined)); // FIXME pass a proper exit code
|
|
35
|
+
this.communicationProvider.onError(error => this.onDebugAdapterError(error));
|
|
35
36
|
}
|
|
36
37
|
async start(channel) {
|
|
37
38
|
if (this.channel) {
|
|
@@ -40,10 +41,6 @@ class DebugAdapterSessionImpl {
|
|
|
40
41
|
this.channel = channel;
|
|
41
42
|
this.channel.onMessage((message) => this.write(message));
|
|
42
43
|
this.channel.onClose(() => this.channel = undefined);
|
|
43
|
-
this.communicationProvider.output.on('data', (data) => this.handleData(data));
|
|
44
|
-
this.communicationProvider.output.on('close', () => this.onDebugAdapterExit(1, undefined)); // FIXME pass a proper exit code
|
|
45
|
-
this.communicationProvider.output.on('error', error => this.onDebugAdapterError(error));
|
|
46
|
-
this.communicationProvider.input.on('error', error => this.onDebugAdapterError(error));
|
|
47
44
|
}
|
|
48
45
|
onDebugAdapterExit(exitCode, signal) {
|
|
49
46
|
const event = {
|
|
@@ -65,58 +62,17 @@ class DebugAdapterSessionImpl {
|
|
|
65
62
|
};
|
|
66
63
|
this.send(JSON.stringify(event));
|
|
67
64
|
}
|
|
68
|
-
handleData(data) {
|
|
69
|
-
this.buffer = Buffer.concat([this.buffer, data]);
|
|
70
|
-
while (true) {
|
|
71
|
-
if (this.contentLength >= 0) {
|
|
72
|
-
if (this.buffer.length >= this.contentLength) {
|
|
73
|
-
const message = this.buffer.toString('utf8', 0, this.contentLength);
|
|
74
|
-
this.buffer = this.buffer.slice(this.contentLength);
|
|
75
|
-
this.contentLength = -1;
|
|
76
|
-
if (message.length > 0) {
|
|
77
|
-
this.send(message);
|
|
78
|
-
}
|
|
79
|
-
continue; // there may be more complete messages to process
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
let idx = this.buffer.indexOf(DebugAdapterSessionImpl.CONTENT_LENGTH);
|
|
84
|
-
if (idx > 0) {
|
|
85
|
-
// log unrecognized output
|
|
86
|
-
const output = this.buffer.slice(0, idx);
|
|
87
|
-
console.log(output.toString('utf-8'));
|
|
88
|
-
this.buffer = this.buffer.slice(idx);
|
|
89
|
-
}
|
|
90
|
-
idx = this.buffer.indexOf(DebugAdapterSessionImpl.TWO_CRLF);
|
|
91
|
-
if (idx !== -1) {
|
|
92
|
-
const header = this.buffer.toString('utf8', 0, idx);
|
|
93
|
-
const lines = header.split('\r\n');
|
|
94
|
-
for (let i = 0; i < lines.length; i++) {
|
|
95
|
-
const pair = lines[i].split(/: +/);
|
|
96
|
-
if (pair[0] === DebugAdapterSessionImpl.CONTENT_LENGTH) {
|
|
97
|
-
this.contentLength = +pair[1];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
this.buffer = this.buffer.slice(idx + DebugAdapterSessionImpl.TWO_CRLF.length);
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
65
|
send(message) {
|
|
108
66
|
if (this.channel) {
|
|
109
67
|
this.channel.send(message);
|
|
110
68
|
}
|
|
111
69
|
}
|
|
112
70
|
write(message) {
|
|
113
|
-
this.communicationProvider.
|
|
71
|
+
this.communicationProvider.send(message);
|
|
114
72
|
}
|
|
115
73
|
async stop() {
|
|
116
74
|
this.toDispose.dispose();
|
|
117
75
|
}
|
|
118
76
|
}
|
|
119
77
|
exports.DebugAdapterSessionImpl = DebugAdapterSessionImpl;
|
|
120
|
-
DebugAdapterSessionImpl.TWO_CRLF = '\r\n\r\n';
|
|
121
|
-
DebugAdapterSessionImpl.CONTENT_LENGTH = 'Content-Length';
|
|
122
78
|
//# sourceMappingURL=debug-adapter-session.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-adapter-session.js","sourceRoot":"","sources":["../../src/node/debug-adapter-session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAelF,kE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,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ;AAlED,0DAkEC"}
|
|
@@ -21,7 +21,7 @@ const debug_service_1 = require("../common/debug-service");
|
|
|
21
21
|
const debug_adapter_factory_1 = require("./debug-adapter-factory");
|
|
22
22
|
const messaging_service_1 = require("@theia/core/lib/node/messaging/messaging-service");
|
|
23
23
|
const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
|
|
24
|
-
const debug_model_1 = require("
|
|
24
|
+
const debug_model_1 = require("./debug-model");
|
|
25
25
|
const debug_service_impl_1 = require("./debug-service-impl");
|
|
26
26
|
const debug_adapter_contribution_registry_1 = require("./debug-adapter-contribution-registry");
|
|
27
27
|
const debug_adapter_session_manager_1 = require("./debug-adapter-session-manager");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-backend-module.js","sourceRoot":"","sources":["../../src/node/debug-backend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,mDAA2E;AAC3E,4DAA+D;AAC/D,2DAGiC;AACjC,mEAGiC;AACjC,wFAAoF;AACpF,4GAAuG;AACvG
|
|
1
|
+
{"version":3,"file":"debug-backend-module.js","sourceRoot":"","sources":["../../src/node/debug-backend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,mDAA2E;AAC3E,4DAA+D;AAC/D,2DAGiC;AACjC,mEAGiC;AACjC,wFAAoF;AACpF,4GAAuG;AACvG,+CAIuB;AACvB,6DAAwD;AACxD,+FAAyF;AACzF,mFAA6E;AAE7E,MAAM,qBAAqB,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE;IAC5F,iCAAwB,CAAC,IAAI,EAAE,sCAAwB,CAAC,CAAC;IACzD,IAAI,CAAC,sEAAgC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAEnE,IAAI,CAAC,4BAAY,CAAC,CAAC,EAAE,CAAC,qCAAgB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC3D,kBAAkB,CAAC,yBAAS,EAAE,4BAAY,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAEvE,IAAI,CAAC,wCAA0B,CAAC,CAAC,EAAE,CAAC,sDAA8B,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACvF,IAAI,CAAC,iCAAmB,CAAC,CAAC,EAAE,CAAC,sDAA8B,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAChF,IAAI,CAAC,0DAA0B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC7D,IAAI,CAAC,oCAAgB,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,0DAA0B,CAAC,CAAC;IAE1E,IAAI,CAAC,gBAAO,CAAC,CAAC,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAC3C,SAAS,CAAC,GAAG,CAAU,gBAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACjD,CAAC,gBAAgB,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC"}
|
|
@@ -13,13 +13,12 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
/// <reference types="node" />
|
|
17
|
-
import * as stream from 'stream';
|
|
18
16
|
import { WebSocketChannel } from '@theia/core/lib/common/messaging/web-socket-channel';
|
|
19
|
-
import { DebugConfiguration } from '
|
|
17
|
+
import { DebugConfiguration } from '../common/debug-configuration';
|
|
20
18
|
import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-schema';
|
|
21
19
|
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
22
20
|
import { MaybePromise } from '@theia/core/lib/common/types';
|
|
21
|
+
import { Event } from '@theia/core/lib/common/event';
|
|
23
22
|
/**
|
|
24
23
|
* DebugAdapterSession symbol for DI.
|
|
25
24
|
*/
|
|
@@ -78,8 +77,10 @@ export declare type DebugAdapterExecutable = DebugAdapterSpawnExecutable | Debug
|
|
|
78
77
|
* TODO: the better name is DebugStreamConnection + handling on error and close
|
|
79
78
|
*/
|
|
80
79
|
export interface CommunicationProvider extends Disposable {
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
onMessageReceived: Event<string>;
|
|
81
|
+
onError: Event<Error>;
|
|
82
|
+
onClose: Event<void>;
|
|
83
|
+
send(message: string): void;
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
86
|
* DebugAdapterFactory symbol for DI.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-model.d.ts","sourceRoot":"","sources":["../../src/node/debug-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAUlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAIrD;;GAEG;AACH,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC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B,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAUjE;;GAEG;AACU,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 Red Hat, Inc. and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { Event } from '@theia/core/lib/common/event';
|
|
17
|
+
import { CommunicationProvider } from './debug-model';
|
|
18
|
+
import * as theia from '@theia/plugin';
|
|
19
|
+
/**
|
|
20
|
+
* A communication provider for using the inline implementation of a debug adapter.
|
|
21
|
+
*/
|
|
22
|
+
export declare class InlineCommunicationProvider implements CommunicationProvider {
|
|
23
|
+
private debugAdapter;
|
|
24
|
+
private messageReceivedEmitter;
|
|
25
|
+
onMessageReceived: Event<string>;
|
|
26
|
+
onError: Event<Error>;
|
|
27
|
+
private closeEmitter;
|
|
28
|
+
onClose: Event<void>;
|
|
29
|
+
constructor(debugAdapter: theia.DebugAdapter);
|
|
30
|
+
send(message: string): void;
|
|
31
|
+
dispose(): void;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=inline-communication-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-communication-provider.d.ts","sourceRoot":"","sources":["../../src/node/inline-communication-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAW,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,qBAAa,2BAA4B,YAAW,qBAAqB;IAOzD,OAAO,CAAC,YAAY;IANhC,OAAO,CAAC,sBAAsB,CAAyB;IACvD,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAqC;IACrE,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAc;IACnC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAA2B;gBAE3B,YAAY,EAAE,KAAK,CAAC,YAAY;IAMpD,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,OAAO,IAAI,IAAI;CAGlB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (C) 2021 Red Hat, Inc. 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.InlineCommunicationProvider = void 0;
|
|
19
|
+
const event_1 = require("@theia/core/lib/common/event");
|
|
20
|
+
/**
|
|
21
|
+
* A communication provider for using the inline implementation of a debug adapter.
|
|
22
|
+
*/
|
|
23
|
+
class InlineCommunicationProvider {
|
|
24
|
+
constructor(debugAdapter) {
|
|
25
|
+
this.debugAdapter = debugAdapter;
|
|
26
|
+
this.messageReceivedEmitter = new event_1.Emitter();
|
|
27
|
+
this.onMessageReceived = this.messageReceivedEmitter.event;
|
|
28
|
+
this.onError = event_1.Event.None;
|
|
29
|
+
this.closeEmitter = new event_1.Emitter();
|
|
30
|
+
this.onClose = this.closeEmitter.event;
|
|
31
|
+
this.debugAdapter.onDidSendMessage(msg => {
|
|
32
|
+
this.messageReceivedEmitter.fire(JSON.stringify(msg));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
send(message) {
|
|
36
|
+
this.debugAdapter.handleMessage(JSON.parse(message));
|
|
37
|
+
}
|
|
38
|
+
dispose() {
|
|
39
|
+
this.debugAdapter.dispose();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.InlineCommunicationProvider = InlineCommunicationProvider;
|
|
43
|
+
//# sourceMappingURL=inline-communication-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-communication-provider.js","sourceRoot":"","sources":["../../src/node/inline-communication-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,wDAA8D;AAI9D;;GAEG;AACH,MAAa,2BAA2B;IAOpC,YAAoB,YAAgC;QAAhC,iBAAY,GAAZ,YAAY,CAAoB;QAN5C,2BAAsB,GAAG,IAAI,eAAO,EAAU,CAAC;QACvD,sBAAiB,GAAkB,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;QACrE,YAAO,GAAiB,aAAK,CAAC,IAAI,CAAC;QAC3B,iBAAY,GAAG,IAAI,eAAO,EAAQ,CAAC;QAC3C,YAAO,GAAgB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QAG3C,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE;YACrC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI,CAAC,OAAe;QAChB,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,OAAO;QACH,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACJ;AApBD,kEAoBC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 Red Hat, Inc. and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
/// <reference types="node" />
|
|
17
|
+
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
18
|
+
import { Event } from '@theia/core/lib/common/event';
|
|
19
|
+
import * as stream from 'stream';
|
|
20
|
+
import { CommunicationProvider } from './debug-model';
|
|
21
|
+
export declare class StreamCommunicationProvider extends DisposableCollection implements CommunicationProvider {
|
|
22
|
+
private fromAdapter;
|
|
23
|
+
private toAdapter;
|
|
24
|
+
private messageReceivedEmitter;
|
|
25
|
+
onMessageReceived: Event<string>;
|
|
26
|
+
private errorEmitter;
|
|
27
|
+
onError: Event<Error>;
|
|
28
|
+
private closeEmitter;
|
|
29
|
+
onClose: Event<void>;
|
|
30
|
+
private static TWO_CRLF;
|
|
31
|
+
private static CONTENT_LENGTH;
|
|
32
|
+
private contentLength;
|
|
33
|
+
private buffer;
|
|
34
|
+
constructor(fromAdapter: stream.Readable, toAdapter: stream.Writable);
|
|
35
|
+
send(message: string): void;
|
|
36
|
+
protected handleData(data: Buffer): void;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=stream-communication-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-communication-provider.d.ts","sourceRoot":"","sources":["../../src/node/stream-communication-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAW,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,qBAAa,2BAA4B,SAAQ,oBAAqB,YAAW,qBAAqB;IActF,OAAO,CAAC,WAAW;IAAmB,OAAO,CAAC,SAAS;IAbnE,OAAO,CAAC,sBAAsB,CAAyB;IACvD,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAqC;IACrE,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAA2B;IAChD,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAA2B;IAG/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IACrC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAoB;IACjD,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,MAAM,CAA2B;gBAErB,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAU,SAAS,EAAE,MAAM,CAAC,QAAQ;IASpF,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM3B,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CA0C3C"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (C) 2021 Red Hat, Inc. 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.StreamCommunicationProvider = void 0;
|
|
19
|
+
const disposable_1 = require("@theia/core/lib/common/disposable");
|
|
20
|
+
const event_1 = require("@theia/core/lib/common/event");
|
|
21
|
+
class StreamCommunicationProvider extends disposable_1.DisposableCollection {
|
|
22
|
+
constructor(fromAdapter, toAdapter) {
|
|
23
|
+
super();
|
|
24
|
+
this.fromAdapter = fromAdapter;
|
|
25
|
+
this.toAdapter = toAdapter;
|
|
26
|
+
this.messageReceivedEmitter = new event_1.Emitter();
|
|
27
|
+
this.onMessageReceived = this.messageReceivedEmitter.event;
|
|
28
|
+
this.errorEmitter = new event_1.Emitter();
|
|
29
|
+
this.onError = this.errorEmitter.event;
|
|
30
|
+
this.closeEmitter = new event_1.Emitter();
|
|
31
|
+
this.onClose = this.closeEmitter.event;
|
|
32
|
+
this.contentLength = -1;
|
|
33
|
+
this.buffer = Buffer.alloc(0);
|
|
34
|
+
this.fromAdapter.on('data', (data) => this.handleData(data));
|
|
35
|
+
this.fromAdapter.on('close', () => this.closeEmitter.fire()); // FIXME pass a proper exit code
|
|
36
|
+
this.fromAdapter.on('error', error => this.errorEmitter.fire(error));
|
|
37
|
+
this.toAdapter.on('error', error => this.errorEmitter.fire(error));
|
|
38
|
+
}
|
|
39
|
+
;
|
|
40
|
+
send(message) {
|
|
41
|
+
const msg = `${StreamCommunicationProvider.CONTENT_LENGTH}: ${Buffer.byteLength(message, 'utf8')}${StreamCommunicationProvider.TWO_CRLF}${message}`;
|
|
42
|
+
this.toAdapter.write(msg, 'utf8');
|
|
43
|
+
}
|
|
44
|
+
handleData(data) {
|
|
45
|
+
this.buffer = Buffer.concat([this.buffer, data]);
|
|
46
|
+
while (true) {
|
|
47
|
+
if (this.contentLength >= 0) {
|
|
48
|
+
if (this.buffer.length >= this.contentLength) {
|
|
49
|
+
const message = this.buffer.toString('utf8', 0, this.contentLength);
|
|
50
|
+
this.buffer = this.buffer.slice(this.contentLength);
|
|
51
|
+
this.contentLength = -1;
|
|
52
|
+
if (message.length > 0) {
|
|
53
|
+
this.messageReceivedEmitter.fire(message);
|
|
54
|
+
}
|
|
55
|
+
continue; // there may be more complete messages to process
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
let idx = this.buffer.indexOf(StreamCommunicationProvider.CONTENT_LENGTH);
|
|
60
|
+
if (idx > 0) {
|
|
61
|
+
// log unrecognized output
|
|
62
|
+
const output = this.buffer.slice(0, idx);
|
|
63
|
+
console.log(output.toString('utf-8'));
|
|
64
|
+
this.buffer = this.buffer.slice(idx);
|
|
65
|
+
}
|
|
66
|
+
idx = this.buffer.indexOf(StreamCommunicationProvider.TWO_CRLF);
|
|
67
|
+
if (idx !== -1) {
|
|
68
|
+
const header = this.buffer.toString('utf8', 0, idx);
|
|
69
|
+
const lines = header.split('\r\n');
|
|
70
|
+
for (let i = 0; i < lines.length; i++) {
|
|
71
|
+
const pair = lines[i].split(/: +/);
|
|
72
|
+
if (pair[0] === StreamCommunicationProvider.CONTENT_LENGTH) {
|
|
73
|
+
this.contentLength = +pair[1];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
this.buffer = this.buffer.slice(idx + StreamCommunicationProvider.TWO_CRLF.length);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.StreamCommunicationProvider = StreamCommunicationProvider;
|
|
85
|
+
// these constants are for the message header, see: https://microsoft.github.io/debug-adapter-protocol/overview#header-part
|
|
86
|
+
StreamCommunicationProvider.TWO_CRLF = '\r\n\r\n';
|
|
87
|
+
StreamCommunicationProvider.CONTENT_LENGTH = 'Content-Length';
|
|
88
|
+
//# sourceMappingURL=stream-communication-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-communication-provider.js","sourceRoot":"","sources":["../../src/node/stream-communication-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,kEAAyE;AACzE,wDAA8D;AAI9D,MAAa,2BAA4B,SAAQ,iCAAoB;IAcjE,YAAoB,WAA4B,EAAU,SAA0B;QAChF,KAAK,EAAE,CAAC;QADQ,gBAAW,GAAX,WAAW,CAAiB;QAAU,cAAS,GAAT,SAAS,CAAiB;QAb5E,2BAAsB,GAAG,IAAI,eAAO,EAAU,CAAC;QACvD,sBAAiB,GAAkB,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;QAC7D,iBAAY,GAAG,IAAI,eAAO,EAAS,CAAC;QAC5C,YAAO,GAAiB,I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,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACnC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;wBACnC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,2BAA2B,CAAC,cAAc,EAAE;4BACxD,IAAI,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;yBACjC;qBACJ;oBACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,2BAA2B,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;oBACnF,SAAS;iBACZ;aACJ;YACD,MAAM;SACT;IACL,CAAC;;AAtEL,kEAuEC;AA/DG,2HAA2H;AAC5G,oCAAQ,GAAG,UAAU,CAAC;AACtB,0CAAc,GAAG,gBAAgB,CAAC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { DebugAdapterExecutable, DebugAdapterContribution } from '
|
|
16
|
+
import { DebugAdapterExecutable, DebugAdapterContribution } from '../debug-model';
|
|
17
17
|
import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-schema';
|
|
18
18
|
export interface VSCodeExtensionPackage {
|
|
19
19
|
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":"AAAA;;;;;;;;;;;;;;kFAckF;AAIlF,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"vscode-debug-adapter-contribution.d.ts","sourceRoot":"","sources":["../../../src/node/vscode/vscode-debug-adapter-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAIlF,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;CACrD;AAED,yBAAiB,0BAA0B,CAAC;IACxC,SAAgB,cAAc,CAAC,UAAU,EAAE,0BAA0B,GAAG,yCAAyC,GAAG,SAAS,CAW5H;CACJ;AAED,8BACsB,sCAAuC,YAAW,wBAAwB;IAU3E,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,aAAa,EAAE,MAAM;IAT/C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACnC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACxD,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,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,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/debug",
|
|
3
|
-
"version": "1.18.0-next.
|
|
3
|
+
"version": "1.18.0-next.104+8bf16975f53",
|
|
4
4
|
"description": "Theia - Debug Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/console": "1.18.0-next.
|
|
7
|
-
"@theia/core": "1.18.0-next.
|
|
8
|
-
"@theia/editor": "1.18.0-next.
|
|
9
|
-
"@theia/filesystem": "1.18.0-next.
|
|
10
|
-
"@theia/markers": "1.18.0-next.
|
|
11
|
-
"@theia/monaco": "1.18.0-next.
|
|
12
|
-
"@theia/output": "1.18.0-next.
|
|
13
|
-
"@theia/preferences": "1.18.0-next.
|
|
14
|
-
"@theia/process": "1.18.0-next.
|
|
15
|
-
"@theia/task": "1.18.0-next.
|
|
16
|
-
"@theia/terminal": "1.18.0-next.
|
|
17
|
-
"@theia/userstorage": "1.18.0-next.
|
|
18
|
-
"@theia/variable-resolver": "1.18.0-next.
|
|
19
|
-
"@theia/workspace": "1.18.0-next.
|
|
6
|
+
"@theia/console": "1.18.0-next.104+8bf16975f53",
|
|
7
|
+
"@theia/core": "1.18.0-next.104+8bf16975f53",
|
|
8
|
+
"@theia/editor": "1.18.0-next.104+8bf16975f53",
|
|
9
|
+
"@theia/filesystem": "1.18.0-next.104+8bf16975f53",
|
|
10
|
+
"@theia/markers": "1.18.0-next.104+8bf16975f53",
|
|
11
|
+
"@theia/monaco": "1.18.0-next.104+8bf16975f53",
|
|
12
|
+
"@theia/output": "1.18.0-next.104+8bf16975f53",
|
|
13
|
+
"@theia/preferences": "1.18.0-next.104+8bf16975f53",
|
|
14
|
+
"@theia/process": "1.18.0-next.104+8bf16975f53",
|
|
15
|
+
"@theia/task": "1.18.0-next.104+8bf16975f53",
|
|
16
|
+
"@theia/terminal": "1.18.0-next.104+8bf16975f53",
|
|
17
|
+
"@theia/userstorage": "1.18.0-next.104+8bf16975f53",
|
|
18
|
+
"@theia/variable-resolver": "1.18.0-next.104+8bf16975f53",
|
|
19
|
+
"@theia/workspace": "1.18.0-next.104+8bf16975f53",
|
|
20
20
|
"jsonc-parser": "^2.2.0",
|
|
21
21
|
"mkdirp": "^0.5.0",
|
|
22
22
|
"p-debounce": "^2.1.0",
|
|
@@ -56,16 +56,18 @@
|
|
|
56
56
|
"src"
|
|
57
57
|
],
|
|
58
58
|
"scripts": {
|
|
59
|
-
"lint": "theiaext lint",
|
|
60
59
|
"build": "theiaext build",
|
|
61
|
-
"watch": "theiaext watch",
|
|
62
60
|
"clean": "theiaext clean",
|
|
63
|
-
"
|
|
61
|
+
"compile": "theiaext compile",
|
|
62
|
+
"lint": "theiaext lint",
|
|
63
|
+
"test": "theiaext test",
|
|
64
|
+
"watch": "theiaext watch"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
|
-
"@theia/ext-scripts": "1.18.0
|
|
67
|
+
"@theia/ext-scripts": "1.18.0"
|
|
67
68
|
},
|
|
68
69
|
"nyc": {
|
|
69
70
|
"extends": "../../configs/nyc.json"
|
|
70
|
-
}
|
|
71
|
+
},
|
|
72
|
+
"gitHead": "8bf16975f53f5fa50137114c2dd38fdcfaf5eb6d"
|
|
71
73
|
}
|
|
@@ -137,7 +137,7 @@ export class DebugVariable extends ExpressionContainer {
|
|
|
137
137
|
constructor(
|
|
138
138
|
session: DebugSessionProvider,
|
|
139
139
|
protected readonly variable: DebugProtocol.Variable,
|
|
140
|
-
|
|
140
|
+
readonly parent: ExpressionContainer
|
|
141
141
|
) {
|
|
142
142
|
super({
|
|
143
143
|
session,
|
|
@@ -359,7 +359,7 @@ export class DebugScope extends ExpressionContainer {
|
|
|
359
359
|
}
|
|
360
360
|
|
|
361
361
|
render(): React.ReactNode {
|
|
362
|
-
return this.
|
|
362
|
+
return this.name;
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
get expensive(): boolean {
|
|
@@ -374,4 +374,8 @@ export class DebugScope extends ExpressionContainer {
|
|
|
374
374
|
return undefined;
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
+
get name(): string {
|
|
378
|
+
return this.raw.name;
|
|
379
|
+
}
|
|
380
|
+
|
|
377
381
|
}
|
|
@@ -74,17 +74,25 @@ export class DebugConfigurationManager {
|
|
|
74
74
|
protected readonly onWillProvideDebugConfigurationEmitter = new Emitter<WillProvideDebugConfiguration>();
|
|
75
75
|
readonly onWillProvideDebugConfiguration: Event<WillProvideDebugConfiguration> = this.onWillProvideDebugConfigurationEmitter.event;
|
|
76
76
|
|
|
77
|
+
protected readonly onWillProvideDynamicDebugConfigurationEmitter = new Emitter<WillProvideDebugConfiguration>();
|
|
78
|
+
get onWillProvideDynamicDebugConfiguration(): Event<WillProvideDebugConfiguration> {
|
|
79
|
+
return this.onWillProvideDynamicDebugConfigurationEmitter.event;
|
|
80
|
+
}
|
|
81
|
+
|
|
77
82
|
protected debugConfigurationTypeKey: ContextKey<string>;
|
|
78
83
|
|
|
79
84
|
protected initialized: Promise<void>;
|
|
85
|
+
|
|
80
86
|
@postConstruct()
|
|
81
87
|
protected async init(): Promise<void> {
|
|
82
88
|
this.debugConfigurationTypeKey = this.contextKeyService.createKey<string>('debugConfigurationType', undefined);
|
|
83
|
-
this.initialized = this.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
this.initialized = this.preferences.ready.then(() => {
|
|
90
|
+
this.preferences.onPreferenceChanged(e => {
|
|
91
|
+
if (e.preferenceName === 'launch') {
|
|
92
|
+
this.updateModels();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return this.updateModels();
|
|
88
96
|
});
|
|
89
97
|
}
|
|
90
98
|
|
|
@@ -149,8 +157,8 @@ export class DebugConfigurationManager {
|
|
|
149
157
|
this.updateCurrent(option);
|
|
150
158
|
}
|
|
151
159
|
protected updateCurrent(options: DebugSessionOptions | undefined = this._currentOptions): void {
|
|
152
|
-
this._currentOptions = options
|
|
153
|
-
|
|
160
|
+
this._currentOptions = options && !options.configuration.dynamic ? this.find(options.configuration.name, options.workspaceFolderUri) : options;
|
|
161
|
+
|
|
154
162
|
if (!this._currentOptions) {
|
|
155
163
|
const { model } = this;
|
|
156
164
|
if (model) {
|
|
@@ -188,6 +196,7 @@ export class DebugConfigurationManager {
|
|
|
188
196
|
await this.doOpen(model);
|
|
189
197
|
}
|
|
190
198
|
}
|
|
199
|
+
|
|
191
200
|
async addConfiguration(): Promise<void> {
|
|
192
201
|
const { model } = this;
|
|
193
202
|
if (!model) {
|
|
@@ -279,7 +288,7 @@ export class DebugConfigurationManager {
|
|
|
279
288
|
*/
|
|
280
289
|
protected async ensureContent(uri: URI, model: DebugConfigurationModel): Promise<void> {
|
|
281
290
|
const textModel = await this.textModelService.createModelReference(uri);
|
|
282
|
-
const currentContent = textModel.object.getText();
|
|
291
|
+
const currentContent = textModel.object.valid ? textModel.object.getText() : '';
|
|
283
292
|
try { // Look for the minimal well-formed launch.json content: {configurations: []}
|
|
284
293
|
const parsedContent = parse(currentContent);
|
|
285
294
|
if (Array.isArray(parsedContent.configurations)) {
|
|
@@ -288,7 +297,6 @@ export class DebugConfigurationManager {
|
|
|
288
297
|
} catch {
|
|
289
298
|
// Just keep going
|
|
290
299
|
}
|
|
291
|
-
|
|
292
300
|
const debugType = await this.selectDebugType();
|
|
293
301
|
const configurations = debugType ? await this.provideDebugConfigurations(debugType, model.workspaceFolderUri) : [];
|
|
294
302
|
const content = this.getInitialConfigurationContent(configurations);
|
|
@@ -304,6 +312,15 @@ export class DebugConfigurationManager {
|
|
|
304
312
|
await WaitUntilEvent.fire(this.onWillProvideDebugConfigurationEmitter, {});
|
|
305
313
|
}
|
|
306
314
|
|
|
315
|
+
async provideDynamicDebugConfigurations(): Promise<{ type: string, configurations: DebugConfiguration[] }[]> {
|
|
316
|
+
await this.fireWillProvideDynamicDebugConfiguration();
|
|
317
|
+
return this.debug.provideDynamicDebugConfigurations!();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
protected async fireWillProvideDynamicDebugConfiguration(): Promise<void> {
|
|
321
|
+
await WaitUntilEvent.fire(this.onWillProvideDynamicDebugConfigurationEmitter, {});
|
|
322
|
+
}
|
|
323
|
+
|
|
307
324
|
protected getInitialConfigurationContent(initialConfigurations: DebugConfiguration[]): string {
|
|
308
325
|
return `{
|
|
309
326
|
// Use IntelliSense to learn about possible attributes.
|
|
@@ -478,6 +478,10 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
|
|
|
478
478
|
this.watchManager.save();
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
+
onWillStop(): boolean {
|
|
482
|
+
return this.preference['debug.confirmOnExit'] === 'always' && !!this.manager.currentSession;
|
|
483
|
+
}
|
|
484
|
+
|
|
481
485
|
registerMenus(menus: MenuModelRegistry): void {
|
|
482
486
|
super.registerMenus(menus);
|
|
483
487
|
const registerMenuActions = (menuPath: string[], ...commands: Command[]) => {
|
|
@@ -1125,8 +1129,8 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
|
|
|
1125
1129
|
protected async openSession(
|
|
1126
1130
|
session: DebugSession,
|
|
1127
1131
|
options?: {
|
|
1128
|
-
debugViewLocation?: DebugViewLocation
|
|
1129
|
-
reveal?: boolean
|
|
1132
|
+
debugViewLocation?: DebugViewLocation;
|
|
1133
|
+
reveal?: boolean;
|
|
1130
1134
|
}
|
|
1131
1135
|
): Promise<DebugWidget | DebugSessionWidget> {
|
|
1132
1136
|
const { debugViewLocation, reveal } = {
|