@theia/debug 1.20.0 → 1.21.0-next.11
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/lib/browser/console/debug-console-session.js +2 -2
- package/lib/browser/console/debug-console-session.js.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.js +4 -4
- package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
- package/lib/browser/debug-session-connection.d.ts +22 -17
- package/lib/browser/debug-session-connection.d.ts.map +1 -1
- package/lib/browser/debug-session-connection.js +86 -65
- package/lib/browser/debug-session-connection.js.map +1 -1
- package/lib/browser/debug-session-contribution.d.ts.map +1 -1
- package/lib/browser/debug-session-contribution.js.map +1 -1
- package/lib/browser/debug-session-manager.d.ts +6 -14
- package/lib/browser/debug-session-manager.d.ts.map +1 -1
- package/lib/browser/debug-session-manager.js +41 -44
- package/lib/browser/debug-session-manager.js.map +1 -1
- package/lib/browser/debug-session.d.ts +9 -8
- package/lib/browser/debug-session.d.ts.map +1 -1
- package/lib/browser/debug-session.js +55 -58
- package/lib/browser/debug-session.js.map +1 -1
- package/lib/browser/view/debug-view-model.js +3 -3
- package/lib/browser/view/debug-view-model.js.map +1 -1
- package/lib/common/debug-service.d.ts +10 -0
- package/lib/common/debug-service.d.ts.map +1 -1
- package/lib/node/debug-adapter-factory.d.ts +4 -4
- package/lib/node/debug-adapter-factory.d.ts.map +1 -1
- package/lib/node/debug-adapter-factory.js +8 -8
- package/lib/node/debug-adapter-factory.js.map +1 -1
- package/lib/node/debug-adapter-session-manager.d.ts.map +1 -1
- package/lib/node/debug-adapter-session-manager.js +0 -1
- package/lib/node/debug-adapter-session-manager.js.map +1 -1
- package/lib/node/debug-adapter-session.d.ts +7 -7
- package/lib/node/debug-adapter-session.d.ts.map +1 -1
- package/lib/node/debug-adapter-session.js +25 -24
- package/lib/node/debug-adapter-session.js.map +1 -1
- package/lib/node/debug-model.d.ts +32 -15
- package/lib/node/debug-model.d.ts.map +1 -1
- package/lib/node/debug-model.js.map +1 -1
- package/lib/node/{inline-communication-provider.d.ts → inline-debug-adapter.d.ts} +6 -5
- package/lib/node/inline-debug-adapter.d.ts.map +1 -0
- package/lib/node/{inline-communication-provider.js → inline-debug-adapter.js} +8 -6
- package/lib/node/inline-debug-adapter.js.map +1 -0
- package/lib/node/{stream-communication-provider.d.ts → stream-debug-adapter.d.ts} +17 -3
- package/lib/node/stream-debug-adapter.d.ts.map +1 -0
- package/lib/node/{stream-communication-provider.js → stream-debug-adapter.js} +38 -13
- package/lib/node/stream-debug-adapter.js.map +1 -0
- package/package.json +16 -16
- package/src/browser/console/debug-console-session.ts +2 -2
- package/src/browser/debug-frontend-application-contribution.ts +4 -4
- package/src/browser/debug-session-connection.ts +101 -75
- package/src/browser/debug-session-contribution.ts +2 -3
- package/src/browser/debug-session-manager.ts +45 -47
- package/src/browser/debug-session.tsx +54 -57
- package/src/browser/view/debug-view-model.ts +3 -3
- package/src/common/debug-service.ts +13 -0
- package/src/node/debug-adapter-factory.ts +13 -12
- package/src/node/debug-adapter-session-manager.ts +0 -1
- package/src/node/debug-adapter-session.ts +29 -28
- package/src/node/debug-model.ts +33 -15
- package/src/node/{inline-communication-provider.ts → inline-debug-adapter.ts} +7 -4
- package/src/node/{stream-communication-provider.ts → stream-debug-adapter.ts} +42 -9
- package/lib/node/inline-communication-provider.d.ts.map +0 -1
- package/lib/node/inline-communication-provider.js.map +0 -1
- package/lib/node/stream-communication-provider.d.ts.map +0 -1
- package/lib/node/stream-communication-provider.js.map +0 -1
|
@@ -116,3 +116,16 @@ export namespace DebugError {
|
|
|
116
116
|
data: { type }
|
|
117
117
|
}));
|
|
118
118
|
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* A closeable channel to send messages over with error/close handling
|
|
122
|
+
*/
|
|
123
|
+
export interface Channel {
|
|
124
|
+
send(content: string): void;
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
|
+
onMessage(cb: (data: any) => void): void;
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
128
|
+
onError(cb: (reason: any) => void): void;
|
|
129
|
+
onClose(cb: (code: number, reason: string) => void): void;
|
|
130
|
+
close(): void;
|
|
131
|
+
}
|
|
@@ -32,16 +32,15 @@ import {
|
|
|
32
32
|
} from '@theia/process/lib/node';
|
|
33
33
|
import {
|
|
34
34
|
DebugAdapterExecutable,
|
|
35
|
-
CommunicationProvider,
|
|
36
35
|
DebugAdapterSession,
|
|
37
36
|
DebugAdapterSessionFactory,
|
|
38
37
|
DebugAdapterFactory,
|
|
39
|
-
DebugAdapterForkExecutable
|
|
38
|
+
DebugAdapterForkExecutable,
|
|
39
|
+
DebugAdapter
|
|
40
40
|
} from './debug-model';
|
|
41
41
|
import { DebugAdapterSessionImpl } from './debug-adapter-session';
|
|
42
42
|
import { environment } from '@theia/core/shared/@theia/application-package';
|
|
43
|
-
import {
|
|
44
|
-
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
43
|
+
import { ProcessDebugAdapter, SocketDebugAdapter } from './stream-debug-adapter';
|
|
45
44
|
|
|
46
45
|
/**
|
|
47
46
|
* [DebugAdapterFactory](#DebugAdapterFactory) implementation based on
|
|
@@ -54,12 +53,15 @@ export class LaunchBasedDebugAdapterFactory implements DebugAdapterFactory {
|
|
|
54
53
|
@inject(ProcessManager)
|
|
55
54
|
protected readonly processManager: ProcessManager;
|
|
56
55
|
|
|
57
|
-
start(executable: DebugAdapterExecutable):
|
|
56
|
+
start(executable: DebugAdapterExecutable): DebugAdapter {
|
|
58
57
|
const process = this.childProcess(executable);
|
|
59
58
|
|
|
59
|
+
if (!process.process) {
|
|
60
|
+
throw new Error(`Could not start debug adapter process: ${JSON.stringify(executable)}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
60
63
|
// FIXME: propagate onError + onExit
|
|
61
|
-
const provider = new
|
|
62
|
-
provider.push(Disposable.create(() => process.kill()));
|
|
64
|
+
const provider = new ProcessDebugAdapter(process.process);
|
|
63
65
|
return provider;
|
|
64
66
|
}
|
|
65
67
|
|
|
@@ -81,12 +83,11 @@ export class LaunchBasedDebugAdapterFactory implements DebugAdapterFactory {
|
|
|
81
83
|
return this.processFactory(processOptions);
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
connect(debugServerPort: number):
|
|
86
|
+
connect(debugServerPort: number): DebugAdapter {
|
|
85
87
|
const socket = net.createConnection(debugServerPort);
|
|
86
88
|
// FIXME: propagate socket.on('error', ...) + socket.on('close', ...)
|
|
87
89
|
|
|
88
|
-
const provider = new
|
|
89
|
-
provider.push(Disposable.create(() => socket.end()));
|
|
90
|
+
const provider = new SocketDebugAdapter(socket);
|
|
90
91
|
return provider;
|
|
91
92
|
}
|
|
92
93
|
}
|
|
@@ -97,10 +98,10 @@ export class LaunchBasedDebugAdapterFactory implements DebugAdapterFactory {
|
|
|
97
98
|
@injectable()
|
|
98
99
|
export class DebugAdapterSessionFactoryImpl implements DebugAdapterSessionFactory {
|
|
99
100
|
|
|
100
|
-
get(sessionId: string,
|
|
101
|
+
get(sessionId: string, debugAdapter: DebugAdapter): DebugAdapterSession {
|
|
101
102
|
return new DebugAdapterSessionImpl(
|
|
102
103
|
sessionId,
|
|
103
|
-
|
|
104
|
+
debugAdapter
|
|
104
105
|
);
|
|
105
106
|
}
|
|
106
107
|
}
|
|
@@ -22,38 +22,33 @@
|
|
|
22
22
|
// Some entities copied and modified from https://github.com/Microsoft/vscode-debugadapter-node/blob/master/adapter/src/protocol.ts
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
|
-
|
|
25
|
+
DebugAdapter,
|
|
26
26
|
DebugAdapterSession
|
|
27
27
|
} from './debug-model';
|
|
28
28
|
import { DebugProtocol } from 'vscode-debugprotocol';
|
|
29
|
-
import {
|
|
30
|
-
import { DisposableCollection, Disposable } from '@theia/core/lib/common/disposable';
|
|
29
|
+
import { Channel } from '../common/debug-service';
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* [DebugAdapterSession](#DebugAdapterSession) implementation.
|
|
34
33
|
*/
|
|
35
34
|
export class DebugAdapterSessionImpl implements DebugAdapterSession {
|
|
36
35
|
|
|
37
|
-
private
|
|
38
|
-
private
|
|
36
|
+
private channel: Channel | undefined;
|
|
37
|
+
private isClosed: boolean = false;
|
|
39
38
|
|
|
40
39
|
constructor(
|
|
41
40
|
readonly id: string,
|
|
42
|
-
protected readonly
|
|
41
|
+
protected readonly debugAdapter: DebugAdapter
|
|
43
42
|
) {
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Disposable.create(() => this.write(JSON.stringify({ seq: -1, type: 'request', command: 'terminate' })))
|
|
48
|
-
]);
|
|
49
|
-
|
|
50
|
-
this.communicationProvider.onMessageReceived((message: string) => this.send(message));
|
|
51
|
-
this.communicationProvider.onClose(() => this.onDebugAdapterExit(1, undefined)); // FIXME pass a proper exit code
|
|
52
|
-
this.communicationProvider.onError(error => this.onDebugAdapterError(error));
|
|
43
|
+
this.debugAdapter.onMessageReceived((message: string) => this.send(message));
|
|
44
|
+
this.debugAdapter.onClose(() => this.onDebugAdapterExit());
|
|
45
|
+
this.debugAdapter.onError(error => this.onDebugAdapterError(error));
|
|
53
46
|
|
|
54
47
|
}
|
|
55
48
|
|
|
56
|
-
async start(channel:
|
|
49
|
+
async start(channel: Channel): Promise<void> {
|
|
50
|
+
|
|
51
|
+
console.debug(`starting debug adapter session '${this.id}'`);
|
|
57
52
|
if (this.channel) {
|
|
58
53
|
throw new Error('The session has already been started, id: ' + this.id);
|
|
59
54
|
}
|
|
@@ -63,19 +58,17 @@ export class DebugAdapterSessionImpl implements DebugAdapterSession {
|
|
|
63
58
|
|
|
64
59
|
}
|
|
65
60
|
|
|
66
|
-
protected onDebugAdapterExit(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
this.send(JSON.stringify(event));
|
|
61
|
+
protected onDebugAdapterExit(): void {
|
|
62
|
+
this.isClosed = true;
|
|
63
|
+
console.debug(`onDebugAdapterExit session: '${this.id}'`);
|
|
64
|
+
if (this.channel) {
|
|
65
|
+
this.channel.close();
|
|
66
|
+
this.channel = undefined;
|
|
67
|
+
}
|
|
76
68
|
}
|
|
77
69
|
|
|
78
70
|
protected onDebugAdapterError(error: Error): void {
|
|
71
|
+
console.debug(`error in debug adapter session: '${this.id}': ${JSON.stringify(error)}`);
|
|
79
72
|
const event: DebugProtocol.Event = {
|
|
80
73
|
type: 'event',
|
|
81
74
|
event: 'error',
|
|
@@ -92,10 +85,18 @@ export class DebugAdapterSessionImpl implements DebugAdapterSession {
|
|
|
92
85
|
}
|
|
93
86
|
|
|
94
87
|
protected write(message: string): void {
|
|
95
|
-
this.
|
|
88
|
+
if (!this.isClosed) {
|
|
89
|
+
this.debugAdapter.send(message);
|
|
90
|
+
}
|
|
96
91
|
}
|
|
97
92
|
|
|
98
93
|
async stop(): Promise<void> {
|
|
99
|
-
this.
|
|
94
|
+
console.debug(`stopping debug adapter session: '${this.id}'`);
|
|
95
|
+
|
|
96
|
+
if (!this.isClosed) {
|
|
97
|
+
await this.debugAdapter.stop();
|
|
98
|
+
}
|
|
99
|
+
this.channel?.close();
|
|
100
|
+
this.channel = undefined;
|
|
100
101
|
}
|
|
101
102
|
}
|
package/src/node/debug-model.ts
CHANGED
|
@@ -22,12 +22,11 @@
|
|
|
22
22
|
// Some entities copied and modified from https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.d.ts
|
|
23
23
|
// Some entities copied and modified from https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/common/debug.ts
|
|
24
24
|
|
|
25
|
-
import { WebSocketChannel } from '@theia/core/lib/common/messaging/web-socket-channel';
|
|
26
25
|
import { DebugConfiguration } from '../common/debug-configuration';
|
|
27
26
|
import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-schema';
|
|
28
|
-
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
29
27
|
import { MaybePromise } from '@theia/core/lib/common/types';
|
|
30
28
|
import { Event } from '@theia/core/lib/common/event';
|
|
29
|
+
import { Channel } from '../common/debug-service';
|
|
31
30
|
|
|
32
31
|
// FIXME: break down this file to debug adapter and debug adapter contribution (see Theia file naming conventions)
|
|
33
32
|
|
|
@@ -37,12 +36,14 @@ import { Event } from '@theia/core/lib/common/event';
|
|
|
37
36
|
export const DebugAdapterSession = Symbol('DebugAdapterSession');
|
|
38
37
|
|
|
39
38
|
/**
|
|
40
|
-
* The debug adapter session.
|
|
39
|
+
* The debug adapter session. The debug adapter session manages the lifecycle of a
|
|
40
|
+
* debug session: the debug session should be discarded if and only if the debug adapter
|
|
41
|
+
* session is stopped.
|
|
41
42
|
*/
|
|
42
43
|
export interface DebugAdapterSession {
|
|
43
44
|
id: string;
|
|
44
45
|
parentSession?: DebugAdapterSession;
|
|
45
|
-
start(channel:
|
|
46
|
+
start(channel: Channel): Promise<void>
|
|
46
47
|
stop(): Promise<void>
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -55,7 +56,7 @@ export const DebugAdapterSessionFactory = Symbol('DebugAdapterSessionFactory');
|
|
|
55
56
|
* The [debug session](#DebugSession) factory.
|
|
56
57
|
*/
|
|
57
58
|
export interface DebugAdapterSessionFactory {
|
|
58
|
-
get(sessionId: string,
|
|
59
|
+
get(sessionId: string, debugAdapter: DebugAdapter): DebugAdapterSession;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
/**
|
|
@@ -88,18 +89,35 @@ export interface DebugAdapterForkExecutable {
|
|
|
88
89
|
export type DebugAdapterExecutable = DebugAdapterSpawnExecutable | DebugAdapterForkExecutable;
|
|
89
90
|
|
|
90
91
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* procedure, however it is also not disallowed.
|
|
95
|
-
*
|
|
96
|
-
* TODO: the better name is DebugStreamConnection + handling on error and close
|
|
92
|
+
* Implementers stand for the various types of debug adapters the system can talk to.
|
|
93
|
+
* Creation of debug adapters is not covered in this interface, but handling communication
|
|
94
|
+
* and the end of life is.
|
|
97
95
|
*/
|
|
98
|
-
|
|
96
|
+
|
|
97
|
+
export interface DebugAdapter {
|
|
98
|
+
/**
|
|
99
|
+
* A DAP protocol message has been received from the debug adapter
|
|
100
|
+
*/
|
|
99
101
|
onMessageReceived: Event<string>;
|
|
102
|
+
/**
|
|
103
|
+
* Send a DAP message to the debug adapter
|
|
104
|
+
* @param message the JSON-encoded DAP message
|
|
105
|
+
*/
|
|
106
|
+
send(message: string): void;
|
|
107
|
+
/**
|
|
108
|
+
* An error has occured communicating with the debug adapter. This does not meant the debug adapter
|
|
109
|
+
* has terminated.
|
|
110
|
+
*/
|
|
100
111
|
onError: Event<Error>;
|
|
112
|
+
/**
|
|
113
|
+
* The connection to the debug adapter has been lost. This signals the end of life for this
|
|
114
|
+
* debug adapter instance.
|
|
115
|
+
*/
|
|
101
116
|
onClose: Event<void>;
|
|
102
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Terminate the connection to the debug adapter.
|
|
119
|
+
*/
|
|
120
|
+
stop(): Promise<void>;
|
|
103
121
|
}
|
|
104
122
|
|
|
105
123
|
/**
|
|
@@ -111,8 +129,8 @@ export const DebugAdapterFactory = Symbol('DebugAdapterFactory');
|
|
|
111
129
|
* Factory to start debug adapter.
|
|
112
130
|
*/
|
|
113
131
|
export interface DebugAdapterFactory {
|
|
114
|
-
start(executable: DebugAdapterExecutable):
|
|
115
|
-
connect(debugServerPort: number):
|
|
132
|
+
start(executable: DebugAdapterExecutable): DebugAdapter;
|
|
133
|
+
connect(debugServerPort: number): DebugAdapter;
|
|
116
134
|
}
|
|
117
135
|
|
|
118
136
|
/**
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
17
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
18
|
-
import {
|
|
18
|
+
import { DebugAdapter } from './debug-model';
|
|
19
19
|
import * as theia from '@theia/plugin';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* A
|
|
22
|
+
* A debug adapter for using the inline implementation from a plugin.
|
|
23
23
|
*/
|
|
24
|
-
export class
|
|
24
|
+
export class InlineDebugAdapter implements DebugAdapter {
|
|
25
25
|
private messageReceivedEmitter = new Emitter<string>();
|
|
26
26
|
onMessageReceived: Event<string> = this.messageReceivedEmitter.event;
|
|
27
27
|
onError: Event<Error> = Event.None;
|
|
@@ -34,11 +34,14 @@ export class InlineCommunicationProvider implements CommunicationProvider {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
async start(): Promise<void> {
|
|
38
|
+
}
|
|
39
|
+
|
|
37
40
|
send(message: string): void {
|
|
38
41
|
this.debugAdapter.handleMessage(JSON.parse(message));
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
async stop(): Promise<void> {
|
|
42
45
|
this.debugAdapter.dispose();
|
|
43
46
|
}
|
|
44
47
|
}
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
18
18
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
19
|
+
import { ChildProcess } from 'child_process';
|
|
19
20
|
import * as stream from 'stream';
|
|
20
|
-
import
|
|
21
|
+
import * as net from 'net';
|
|
22
|
+
import { DebugAdapter } from './debug-model';
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
abstract class StreamDebugAdapter extends DisposableCollection {
|
|
23
25
|
private messageReceivedEmitter = new Emitter<string>();
|
|
24
26
|
onMessageReceived: Event<string> = this.messageReceivedEmitter.event;
|
|
25
27
|
private errorEmitter = new Emitter<Error>();
|
|
@@ -37,13 +39,17 @@ export class StreamCommunicationProvider extends DisposableCollection implements
|
|
|
37
39
|
super();
|
|
38
40
|
|
|
39
41
|
this.fromAdapter.on('data', (data: Buffer) => this.handleData(data));
|
|
40
|
-
this.fromAdapter.on('close', () => this.
|
|
42
|
+
this.fromAdapter.on('close', () => this.handleClosed()); // FIXME pass a proper exit code
|
|
41
43
|
this.fromAdapter.on('error', error => this.errorEmitter.fire(error));
|
|
42
44
|
this.toAdapter.on('error', error => this.errorEmitter.fire(error));
|
|
43
|
-
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
handleClosed(): void {
|
|
48
|
+
this.closeEmitter.fire();
|
|
49
|
+
}
|
|
44
50
|
|
|
45
51
|
send(message: string): void {
|
|
46
|
-
const msg = `${
|
|
52
|
+
const msg = `${StreamDebugAdapter.CONTENT_LENGTH}: ${Buffer.byteLength(message, 'utf8')}${StreamDebugAdapter.TWO_CRLF}${message}`;
|
|
47
53
|
|
|
48
54
|
this.toAdapter.write(msg, 'utf8');
|
|
49
55
|
}
|
|
@@ -64,7 +70,7 @@ export class StreamCommunicationProvider extends DisposableCollection implements
|
|
|
64
70
|
continue; // there may be more complete messages to process
|
|
65
71
|
}
|
|
66
72
|
} else {
|
|
67
|
-
let idx = this.buffer.indexOf(
|
|
73
|
+
let idx = this.buffer.indexOf(StreamDebugAdapter.CONTENT_LENGTH);
|
|
68
74
|
if (idx > 0) {
|
|
69
75
|
// log unrecognized output
|
|
70
76
|
const output = this.buffer.slice(0, idx);
|
|
@@ -73,17 +79,17 @@ export class StreamCommunicationProvider extends DisposableCollection implements
|
|
|
73
79
|
this.buffer = this.buffer.slice(idx);
|
|
74
80
|
}
|
|
75
81
|
|
|
76
|
-
idx = this.buffer.indexOf(
|
|
82
|
+
idx = this.buffer.indexOf(StreamDebugAdapter.TWO_CRLF);
|
|
77
83
|
if (idx !== -1) {
|
|
78
84
|
const header = this.buffer.toString('utf8', 0, idx);
|
|
79
85
|
const lines = header.split('\r\n');
|
|
80
86
|
for (let i = 0; i < lines.length; i++) {
|
|
81
87
|
const pair = lines[i].split(/: +/);
|
|
82
|
-
if (pair[0] ===
|
|
88
|
+
if (pair[0] === StreamDebugAdapter.CONTENT_LENGTH) {
|
|
83
89
|
this.contentLength = +pair[1];
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
|
-
this.buffer = this.buffer.slice(idx +
|
|
92
|
+
this.buffer = this.buffer.slice(idx + StreamDebugAdapter.TWO_CRLF.length);
|
|
87
93
|
continue;
|
|
88
94
|
}
|
|
89
95
|
}
|
|
@@ -91,3 +97,30 @@ export class StreamCommunicationProvider extends DisposableCollection implements
|
|
|
91
97
|
}
|
|
92
98
|
}
|
|
93
99
|
}
|
|
100
|
+
|
|
101
|
+
export class ProcessDebugAdapter extends StreamDebugAdapter implements DebugAdapter {
|
|
102
|
+
protected readonly process: ChildProcess;
|
|
103
|
+
constructor(process: ChildProcess) {
|
|
104
|
+
super(process.stdout!, process.stdin!);
|
|
105
|
+
this.process = process;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async stop(): Promise<void> {
|
|
109
|
+
this.process.kill();
|
|
110
|
+
this.process.stdin?.end();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export class SocketDebugAdapter extends StreamDebugAdapter implements DebugAdapter {
|
|
115
|
+
private readonly socket: net.Socket;
|
|
116
|
+
constructor(socket: net.Socket) {
|
|
117
|
+
super(socket, socket);
|
|
118
|
+
this.socket = socket;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
stop(): Promise<void> {
|
|
122
|
+
return new Promise<void>(resolve => {
|
|
123
|
+
this.socket.end(() => resolve());
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream-communication-provider.js","sourceRoot":"","sources":["../../src/node/stream-communication-provider.ts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