@theia/debug 1.18.0 → 1.21.0-next.12
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-contribution.d.ts +1 -0
- package/lib/browser/console/debug-console-contribution.d.ts.map +1 -1
- package/lib/browser/console/debug-console-contribution.js +8 -6
- package/lib/browser/console/debug-console-contribution.js.map +1 -1
- package/lib/browser/console/debug-console-session.d.ts +1 -1
- 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-configuration-manager.d.ts.map +1 -1
- package/lib/browser/debug-configuration-manager.js +8 -7
- package/lib/browser/debug-configuration-manager.js.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.d.ts +5 -12
- package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.js +139 -112
- 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 +22 -6
- package/lib/browser/debug-preferences.js.map +1 -1
- package/lib/browser/debug-prefix-configuration.d.ts.map +1 -1
- package/lib/browser/debug-prefix-configuration.js +3 -3
- package/lib/browser/debug-prefix-configuration.js.map +1 -1
- package/lib/browser/debug-session-connection.d.ts +23 -18
- 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 +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/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/model/debug-function-breakpoint.d.ts.map +1 -1
- package/lib/browser/model/debug-function-breakpoint.js +4 -3
- package/lib/browser/model/debug-function-breakpoint.js.map +1 -1
- package/lib/browser/preferences/launch-preferences.d.ts.map +1 -1
- package/lib/browser/preferences/launch-preferences.js +2 -1
- package/lib/browser/preferences/launch-preferences.js.map +1 -1
- package/lib/browser/view/debug-breakpoints-source.d.ts +0 -1
- package/lib/browser/view/debug-breakpoints-source.d.ts.map +1 -1
- package/lib/browser/view/debug-breakpoints-source.js +1 -7
- package/lib/browser/view/debug-breakpoints-source.js.map +1 -1
- package/lib/browser/view/debug-breakpoints-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-breakpoints-widget.js +2 -1
- package/lib/browser/view/debug-breakpoints-widget.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 +8 -8
- 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/browser/view/debug-stack-frames-source.d.ts +0 -1
- package/lib/browser/view/debug-stack-frames-source.d.ts.map +1 -1
- package/lib/browser/view/debug-stack-frames-source.js +2 -5
- package/lib/browser/view/debug-stack-frames-source.js.map +1 -1
- package/lib/browser/view/debug-stack-frames-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-stack-frames-widget.js +2 -1
- package/lib/browser/view/debug-stack-frames-widget.js.map +1 -1
- package/lib/browser/view/debug-threads-source.d.ts +0 -1
- package/lib/browser/view/debug-threads-source.d.ts.map +1 -1
- package/lib/browser/view/debug-threads-source.js +1 -7
- package/lib/browser/view/debug-threads-source.js.map +1 -1
- package/lib/browser/view/debug-threads-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-threads-widget.js +2 -1
- package/lib/browser/view/debug-threads-widget.js.map +1 -1
- package/lib/browser/view/debug-toolbar-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-toolbar-widget.js +9 -8
- package/lib/browser/view/debug-toolbar-widget.js.map +1 -1
- package/lib/browser/view/debug-variables-source.d.ts +0 -1
- package/lib/browser/view/debug-variables-source.d.ts.map +1 -1
- package/lib/browser/view/debug-variables-source.js +2 -5
- package/lib/browser/view/debug-variables-source.js.map +1 -1
- package/lib/browser/view/debug-variables-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-variables-widget.js +2 -1
- package/lib/browser/view/debug-variables-widget.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/browser/view/debug-watch-source.d.ts +0 -1
- package/lib/browser/view/debug-watch-source.d.ts.map +1 -1
- package/lib/browser/view/debug-watch-source.js +2 -5
- package/lib/browser/view/debug-watch-source.js.map +1 -1
- package/lib/browser/view/debug-watch-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-watch-widget.js +2 -1
- package/lib/browser/view/debug-watch-widget.js.map +1 -1
- package/lib/browser/view/debug-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-widget.js +2 -1
- package/lib/browser/view/debug-widget.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-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 +4 -4
- package/lib/node/debug-adapter-factory.d.ts.map +1 -1
- package/lib/node/debug-adapter-factory.js +10 -12
- 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 -2
- package/lib/node/debug-adapter-session-manager.js.map +1 -1
- package/lib/node/debug-adapter-session.d.ts +7 -13
- package/lib/node/debug-adapter-session.d.ts.map +1 -1
- package/lib/node/debug-adapter-session.js +25 -68
- 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 +37 -19
- 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-debug-adapter.d.ts +34 -0
- package/lib/node/inline-debug-adapter.d.ts.map +1 -0
- package/lib/node/inline-debug-adapter.js +45 -0
- package/lib/node/inline-debug-adapter.js.map +1 -0
- package/lib/node/stream-debug-adapter.d.ts +52 -0
- package/lib/node/stream-debug-adapter.d.ts.map +1 -0
- package/lib/node/stream-debug-adapter.js +113 -0
- package/lib/node/stream-debug-adapter.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 +17 -17
- package/src/browser/console/debug-console-contribution.tsx +9 -6
- package/src/browser/console/debug-console-session.ts +2 -2
- package/src/browser/debug-configuration-manager.ts +10 -8
- package/src/browser/debug-frontend-application-contribution.ts +160 -125
- package/src/browser/debug-preferences.ts +23 -6
- package/src/browser/debug-prefix-configuration.ts +4 -4
- package/src/browser/debug-session-connection.ts +102 -76
- package/src/browser/debug-session-contribution.ts +3 -4
- package/src/browser/debug-session-manager.ts +45 -47
- package/src/browser/debug-session.tsx +54 -57
- package/src/browser/model/debug-function-breakpoint.tsx +4 -3
- package/src/browser/preferences/launch-preferences.ts +2 -1
- package/src/browser/view/debug-breakpoints-source.tsx +0 -6
- package/src/browser/view/debug-breakpoints-widget.ts +2 -1
- package/src/browser/view/debug-configuration-widget.tsx +8 -7
- package/src/browser/view/debug-session-widget.ts +12 -6
- package/src/browser/view/debug-stack-frames-source.tsx +0 -6
- package/src/browser/view/debug-stack-frames-widget.ts +2 -1
- package/src/browser/view/debug-threads-source.tsx +0 -6
- package/src/browser/view/debug-threads-widget.ts +2 -1
- package/src/browser/view/debug-toolbar-widget.tsx +13 -8
- package/src/browser/view/debug-variables-source.ts +0 -6
- package/src/browser/view/debug-variables-widget.ts +2 -1
- package/src/browser/view/debug-view-model.ts +3 -3
- package/src/browser/view/debug-watch-source.ts +0 -6
- package/src/browser/view/debug-watch-widget.ts +2 -1
- package/src/browser/view/debug-widget.ts +2 -1
- package/src/common/debug-service.ts +13 -0
- package/src/node/debug-adapter-contribution-registry.ts +1 -1
- package/src/node/debug-adapter-factory.ts +17 -17
- package/src/node/debug-adapter-session-manager.ts +1 -2
- package/src/node/debug-adapter-session.ts +32 -80
- package/src/node/debug-backend-module.ts +1 -1
- package/src/{common → node}/debug-model.ts +38 -18
- package/src/node/inline-debug-adapter.ts +47 -0
- package/src/node/stream-debug-adapter.ts +126 -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
|
@@ -13,24 +13,24 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
|
|
17
|
-
import * as stream from 'stream';
|
|
18
|
-
import { WebSocketChannel } from '@theia/core/lib/common/messaging/web-socket-channel';
|
|
19
|
-
import { DebugConfiguration } from './debug-configuration';
|
|
16
|
+
import { DebugConfiguration } from '../common/debug-configuration';
|
|
20
17
|
import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-schema';
|
|
21
|
-
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
22
18
|
import { MaybePromise } from '@theia/core/lib/common/types';
|
|
19
|
+
import { Event } from '@theia/core/lib/common/event';
|
|
20
|
+
import { Channel } from '../common/debug-service';
|
|
23
21
|
/**
|
|
24
22
|
* DebugAdapterSession symbol for DI.
|
|
25
23
|
*/
|
|
26
24
|
export declare const DebugAdapterSession: unique symbol;
|
|
27
25
|
/**
|
|
28
|
-
* The debug adapter session.
|
|
26
|
+
* The debug adapter session. The debug adapter session manages the lifecycle of a
|
|
27
|
+
* debug session: the debug session should be discarded if and only if the debug adapter
|
|
28
|
+
* session is stopped.
|
|
29
29
|
*/
|
|
30
30
|
export interface DebugAdapterSession {
|
|
31
31
|
id: string;
|
|
32
32
|
parentSession?: DebugAdapterSession;
|
|
33
|
-
start(channel:
|
|
33
|
+
start(channel: Channel): Promise<void>;
|
|
34
34
|
stop(): Promise<void>;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -41,7 +41,7 @@ export declare const DebugAdapterSessionFactory: unique symbol;
|
|
|
41
41
|
* The [debug session](#DebugSession) factory.
|
|
42
42
|
*/
|
|
43
43
|
export interface DebugAdapterSessionFactory {
|
|
44
|
-
get(sessionId: string,
|
|
44
|
+
get(sessionId: string, debugAdapter: DebugAdapter): DebugAdapterSession;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Debug adapter executable for spawning.
|
|
@@ -70,16 +70,34 @@ export interface DebugAdapterForkExecutable {
|
|
|
70
70
|
*/
|
|
71
71
|
export declare type DebugAdapterExecutable = DebugAdapterSpawnExecutable | DebugAdapterForkExecutable;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* procedure, however it is also not disallowed.
|
|
77
|
-
*
|
|
78
|
-
* TODO: the better name is DebugStreamConnection + handling on error and close
|
|
73
|
+
* Implementers stand for the various types of debug adapters the system can talk to.
|
|
74
|
+
* Creation of debug adapters is not covered in this interface, but handling communication
|
|
75
|
+
* and the end of life is.
|
|
79
76
|
*/
|
|
80
|
-
export interface
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
export interface DebugAdapter {
|
|
78
|
+
/**
|
|
79
|
+
* A DAP protocol message has been received from the debug adapter
|
|
80
|
+
*/
|
|
81
|
+
onMessageReceived: Event<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Send a DAP message to the debug adapter
|
|
84
|
+
* @param message the JSON-encoded DAP message
|
|
85
|
+
*/
|
|
86
|
+
send(message: string): void;
|
|
87
|
+
/**
|
|
88
|
+
* An error has occured communicating with the debug adapter. This does not meant the debug adapter
|
|
89
|
+
* has terminated.
|
|
90
|
+
*/
|
|
91
|
+
onError: Event<Error>;
|
|
92
|
+
/**
|
|
93
|
+
* The connection to the debug adapter has been lost. This signals the end of life for this
|
|
94
|
+
* debug adapter instance.
|
|
95
|
+
*/
|
|
96
|
+
onClose: Event<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Terminate the connection to the debug adapter.
|
|
99
|
+
*/
|
|
100
|
+
stop(): Promise<void>;
|
|
83
101
|
}
|
|
84
102
|
/**
|
|
85
103
|
* DebugAdapterFactory symbol for DI.
|
|
@@ -89,8 +107,8 @@ export declare const DebugAdapterFactory: unique symbol;
|
|
|
89
107
|
* Factory to start debug adapter.
|
|
90
108
|
*/
|
|
91
109
|
export interface DebugAdapterFactory {
|
|
92
|
-
start(executable: DebugAdapterExecutable):
|
|
93
|
-
connect(debugServerPort: number):
|
|
110
|
+
start(executable: DebugAdapterExecutable): DebugAdapter;
|
|
111
|
+
connect(debugServerPort: number): DebugAdapter;
|
|
94
112
|
}
|
|
95
113
|
/**
|
|
96
114
|
* DebugAdapterContribution 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,kBAAkB,EAAE,MAAM,+BAA+B,C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B,GAAG,SAAS,CAAC,CAAC;IAElI;;;;;OAKG;IACH,iDAAiD,CAAC,CAAC,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;CAC7J"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-model.js","sourceRoot":"","sources":["../../src/node/debug-model.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAgBlF,kHAAkH;AAElH;;GAEG;AACU,QAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAcjE;;GAEG;AACU,QAAA,0BAA0B,GAAG,MAAM,CAAC,4BAA4B,CAAC,CAAC;AAsE/E;;GAEG;AACU,QAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAUjE;;GAEG;AACU,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { DebugAdapter } from './debug-model';
|
|
18
|
+
import * as theia from '@theia/plugin';
|
|
19
|
+
/**
|
|
20
|
+
* A debug adapter for using the inline implementation from a plugin.
|
|
21
|
+
*/
|
|
22
|
+
export declare class InlineDebugAdapter implements DebugAdapter {
|
|
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
|
+
start(): Promise<void>;
|
|
31
|
+
send(message: string): void;
|
|
32
|
+
stop(): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=inline-debug-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-debug-adapter.d.ts","sourceRoot":"","sources":["../../src/node/inline-debug-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAW,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IAOvC,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;IAM9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAG5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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.InlineDebugAdapter = void 0;
|
|
19
|
+
const event_1 = require("@theia/core/lib/common/event");
|
|
20
|
+
/**
|
|
21
|
+
* A debug adapter for using the inline implementation from a plugin.
|
|
22
|
+
*/
|
|
23
|
+
class InlineDebugAdapter {
|
|
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
|
+
async start() {
|
|
36
|
+
}
|
|
37
|
+
send(message) {
|
|
38
|
+
this.debugAdapter.handleMessage(JSON.parse(message));
|
|
39
|
+
}
|
|
40
|
+
async stop() {
|
|
41
|
+
this.debugAdapter.dispose();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.InlineDebugAdapter = InlineDebugAdapter;
|
|
45
|
+
//# sourceMappingURL=inline-debug-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-debug-adapter.js","sourceRoot":"","sources":["../../src/node/inline-debug-adapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,wDAA8D;AAI9D;;GAEG;AACH,MAAa,kBAAkB;IAO3B,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,KAAK,CAAC,KAAK;IACX,CAAC;IAED,IAAI,CAAC,OAAe;QAChB,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAI;QACN,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACJ;AAvBD,gDAuBC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { ChildProcess } from 'child_process';
|
|
20
|
+
import * as stream from 'stream';
|
|
21
|
+
import * as net from 'net';
|
|
22
|
+
import { DebugAdapter } from './debug-model';
|
|
23
|
+
declare abstract class StreamDebugAdapter extends DisposableCollection {
|
|
24
|
+
private fromAdapter;
|
|
25
|
+
private toAdapter;
|
|
26
|
+
private messageReceivedEmitter;
|
|
27
|
+
onMessageReceived: Event<string>;
|
|
28
|
+
private errorEmitter;
|
|
29
|
+
onError: Event<Error>;
|
|
30
|
+
private closeEmitter;
|
|
31
|
+
onClose: Event<void>;
|
|
32
|
+
private static TWO_CRLF;
|
|
33
|
+
private static CONTENT_LENGTH;
|
|
34
|
+
private contentLength;
|
|
35
|
+
private buffer;
|
|
36
|
+
constructor(fromAdapter: stream.Readable, toAdapter: stream.Writable);
|
|
37
|
+
handleClosed(): void;
|
|
38
|
+
send(message: string): void;
|
|
39
|
+
protected handleData(data: Buffer): void;
|
|
40
|
+
}
|
|
41
|
+
export declare class ProcessDebugAdapter extends StreamDebugAdapter implements DebugAdapter {
|
|
42
|
+
protected readonly process: ChildProcess;
|
|
43
|
+
constructor(process: ChildProcess);
|
|
44
|
+
stop(): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
export declare class SocketDebugAdapter extends StreamDebugAdapter implements DebugAdapter {
|
|
47
|
+
private readonly socket;
|
|
48
|
+
constructor(socket: net.Socket);
|
|
49
|
+
stop(): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=stream-debug-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-debug-adapter.d.ts","sourceRoot":"","sources":["../../src/node/stream-debug-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAW,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,uBAAe,kBAAmB,SAAQ,oBAAoB;IAc9C,OAAO,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,YAAY,IAAI,IAAI;IAIpB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM3B,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CA0C3C;AAED,qBAAa,mBAAoB,SAAQ,kBAAmB,YAAW,YAAY;IAC/E,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;gBAC7B,OAAO,EAAE,YAAY;IAK3B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAI9B;AAED,qBAAa,kBAAmB,SAAQ,kBAAmB,YAAW,YAAY;IAC9E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;gBACxB,MAAM,EAAE,GAAG,CAAC,MAAM;IAK9B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAKxB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
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.SocketDebugAdapter = exports.ProcessDebugAdapter = void 0;
|
|
19
|
+
const disposable_1 = require("@theia/core/lib/common/disposable");
|
|
20
|
+
const event_1 = require("@theia/core/lib/common/event");
|
|
21
|
+
class StreamDebugAdapter 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.handleClosed()); // 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
|
+
handleClosed() {
|
|
40
|
+
this.closeEmitter.fire();
|
|
41
|
+
}
|
|
42
|
+
send(message) {
|
|
43
|
+
const msg = `${StreamDebugAdapter.CONTENT_LENGTH}: ${Buffer.byteLength(message, 'utf8')}${StreamDebugAdapter.TWO_CRLF}${message}`;
|
|
44
|
+
this.toAdapter.write(msg, 'utf8');
|
|
45
|
+
}
|
|
46
|
+
handleData(data) {
|
|
47
|
+
this.buffer = Buffer.concat([this.buffer, data]);
|
|
48
|
+
while (true) {
|
|
49
|
+
if (this.contentLength >= 0) {
|
|
50
|
+
if (this.buffer.length >= this.contentLength) {
|
|
51
|
+
const message = this.buffer.toString('utf8', 0, this.contentLength);
|
|
52
|
+
this.buffer = this.buffer.slice(this.contentLength);
|
|
53
|
+
this.contentLength = -1;
|
|
54
|
+
if (message.length > 0) {
|
|
55
|
+
this.messageReceivedEmitter.fire(message);
|
|
56
|
+
}
|
|
57
|
+
continue; // there may be more complete messages to process
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
let idx = this.buffer.indexOf(StreamDebugAdapter.CONTENT_LENGTH);
|
|
62
|
+
if (idx > 0) {
|
|
63
|
+
// log unrecognized output
|
|
64
|
+
const output = this.buffer.slice(0, idx);
|
|
65
|
+
console.log(output.toString('utf-8'));
|
|
66
|
+
this.buffer = this.buffer.slice(idx);
|
|
67
|
+
}
|
|
68
|
+
idx = this.buffer.indexOf(StreamDebugAdapter.TWO_CRLF);
|
|
69
|
+
if (idx !== -1) {
|
|
70
|
+
const header = this.buffer.toString('utf8', 0, idx);
|
|
71
|
+
const lines = header.split('\r\n');
|
|
72
|
+
for (let i = 0; i < lines.length; i++) {
|
|
73
|
+
const pair = lines[i].split(/: +/);
|
|
74
|
+
if (pair[0] === StreamDebugAdapter.CONTENT_LENGTH) {
|
|
75
|
+
this.contentLength = +pair[1];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
this.buffer = this.buffer.slice(idx + StreamDebugAdapter.TWO_CRLF.length);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// these constants are for the message header, see: https://microsoft.github.io/debug-adapter-protocol/overview#header-part
|
|
87
|
+
StreamDebugAdapter.TWO_CRLF = '\r\n\r\n';
|
|
88
|
+
StreamDebugAdapter.CONTENT_LENGTH = 'Content-Length';
|
|
89
|
+
class ProcessDebugAdapter extends StreamDebugAdapter {
|
|
90
|
+
constructor(process) {
|
|
91
|
+
super(process.stdout, process.stdin);
|
|
92
|
+
this.process = process;
|
|
93
|
+
}
|
|
94
|
+
async stop() {
|
|
95
|
+
var _a;
|
|
96
|
+
this.process.kill();
|
|
97
|
+
(_a = this.process.stdin) === null || _a === void 0 ? void 0 : _a.end();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.ProcessDebugAdapter = ProcessDebugAdapter;
|
|
101
|
+
class SocketDebugAdapter extends StreamDebugAdapter {
|
|
102
|
+
constructor(socket) {
|
|
103
|
+
super(socket, socket);
|
|
104
|
+
this.socket = socket;
|
|
105
|
+
}
|
|
106
|
+
stop() {
|
|
107
|
+
return new Promise(resolve => {
|
|
108
|
+
this.socket.end(() => resolve());
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.SocketDebugAdapter = SocketDebugAdapter;
|
|
113
|
+
//# sourceMappingURL=stream-debug-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-debug-adapter.js","sourceRoot":"","sources":["../../src/node/stream-debug-adapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,kEAAyE;AACzE,wDAA8D;AAM9D,MAAe,kBAAmB,SAAQ,iCAAoB;IAc1D,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,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QACxC,iBAAY,GAAG,IAAI,eAAO,EAAQ,CAAC;QAC3C,YAAO,GAAgB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QAKvC,kBAAa,GAAW,CAAC,CAAC,CAAC;QAC3B,WAAM,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAKrC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,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kB,CAAC,cAAc,EAAE;4BAC/C,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,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;oBAC1E,SAAS;iBACZ;aACJ;YACD,MAAM;SACT;IACL,CAAC;;AAlED,2HAA2H;AAC5G,2BAAQ,GAAG,UAAU,CAAC;AACtB,iCAAc,GAAG,gBAAgB,CAAC;AAmErD,MAAa,mBAAoB,SAAQ,kBAAkB;IAEvD,YAAY,OAAqB;QAC7B,KAAK,CAAC,OAAO,CAAC,MAAO,EAAE,OAAO,CAAC,KAAM,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,IAAI;;QACN,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACpB,MAAA,IAAI,CAAC,OAAO,CAAC,KAAK,0CAAE,GAAG,GAAG;IAC9B,CAAC;CACJ;AAXD,kDAWC;AAED,MAAa,kBAAmB,SAAQ,kBAAkB;IAEtD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,IAAI;QACA,OAAO,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;YAC/B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAZD,gDAYC"}
|
|
@@ -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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sB,GAAG,SAAS,CAAC;CA+BrF"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/debug",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0-next.12+c8248f736ed",
|
|
4
4
|
"description": "Theia - Debug Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/console": "1.
|
|
7
|
-
"@theia/core": "1.
|
|
8
|
-
"@theia/editor": "1.
|
|
9
|
-
"@theia/filesystem": "1.
|
|
10
|
-
"@theia/markers": "1.
|
|
11
|
-
"@theia/monaco": "1.
|
|
12
|
-
"@theia/output": "1.
|
|
13
|
-
"@theia/preferences": "1.
|
|
14
|
-
"@theia/process": "1.
|
|
15
|
-
"@theia/task": "1.
|
|
16
|
-
"@theia/terminal": "1.
|
|
17
|
-
"@theia/userstorage": "1.
|
|
18
|
-
"@theia/variable-resolver": "1.
|
|
19
|
-
"@theia/workspace": "1.
|
|
6
|
+
"@theia/console": "1.21.0-next.12+c8248f736ed",
|
|
7
|
+
"@theia/core": "1.21.0-next.12+c8248f736ed",
|
|
8
|
+
"@theia/editor": "1.21.0-next.12+c8248f736ed",
|
|
9
|
+
"@theia/filesystem": "1.21.0-next.12+c8248f736ed",
|
|
10
|
+
"@theia/markers": "1.21.0-next.12+c8248f736ed",
|
|
11
|
+
"@theia/monaco": "1.21.0-next.12+c8248f736ed",
|
|
12
|
+
"@theia/output": "1.21.0-next.12+c8248f736ed",
|
|
13
|
+
"@theia/preferences": "1.21.0-next.12+c8248f736ed",
|
|
14
|
+
"@theia/process": "1.21.0-next.12+c8248f736ed",
|
|
15
|
+
"@theia/task": "1.21.0-next.12+c8248f736ed",
|
|
16
|
+
"@theia/terminal": "1.21.0-next.12+c8248f736ed",
|
|
17
|
+
"@theia/userstorage": "1.21.0-next.12+c8248f736ed",
|
|
18
|
+
"@theia/variable-resolver": "1.21.0-next.12+c8248f736ed",
|
|
19
|
+
"@theia/workspace": "1.21.0-next.12+c8248f736ed",
|
|
20
20
|
"jsonc-parser": "^2.2.0",
|
|
21
21
|
"mkdirp": "^0.5.0",
|
|
22
22
|
"p-debounce": "^2.1.0",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"watch": "theiaext watch"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@theia/ext-scripts": "1.
|
|
67
|
+
"@theia/ext-scripts": "1.20.0"
|
|
68
68
|
},
|
|
69
69
|
"nyc": {
|
|
70
70
|
"extends": "../../configs/nyc.json"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "c8248f736edb4939155711987333ed39d9394b11"
|
|
73
73
|
}
|
|
@@ -18,6 +18,7 @@ import { ConsoleSessionManager } from '@theia/console/lib/browser/console-sessio
|
|
|
18
18
|
import { ConsoleOptions, ConsoleWidget } from '@theia/console/lib/browser/console-widget';
|
|
19
19
|
import { AbstractViewContribution, bindViewContribution, codicon, Widget, WidgetFactory } from '@theia/core/lib/browser';
|
|
20
20
|
import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
21
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
21
22
|
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
22
23
|
import { Command, CommandRegistry } from '@theia/core/lib/common/command';
|
|
23
24
|
import { Severity } from '@theia/core/lib/common/severity';
|
|
@@ -32,13 +33,15 @@ export type InDebugReplContextKey = ContextKey<boolean>;
|
|
|
32
33
|
export const InDebugReplContextKey = Symbol('inDebugReplContextKey');
|
|
33
34
|
|
|
34
35
|
export namespace DebugConsoleCommands {
|
|
35
|
-
|
|
36
|
-
export const
|
|
36
|
+
|
|
37
|
+
export const DEBUG_CATEGORY = 'Debug';
|
|
38
|
+
|
|
39
|
+
export const CLEAR = Command.toDefaultLocalizedCommand({
|
|
37
40
|
id: 'debug.console.clear',
|
|
38
|
-
category:
|
|
41
|
+
category: DEBUG_CATEGORY,
|
|
39
42
|
label: 'Clear Console',
|
|
40
43
|
iconClass: codicon('clear-all')
|
|
41
|
-
};
|
|
44
|
+
});
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
@injectable()
|
|
@@ -124,7 +127,7 @@ export class DebugConsoleContribution extends AbstractViewContribution<ConsoleWi
|
|
|
124
127
|
toolbarRegistry.registerItem({
|
|
125
128
|
id: DebugConsoleCommands.CLEAR.id,
|
|
126
129
|
command: DebugConsoleCommands.CLEAR.id,
|
|
127
|
-
tooltip:
|
|
130
|
+
tooltip: DebugConsoleCommands.CLEAR.label,
|
|
128
131
|
priority: 0,
|
|
129
132
|
});
|
|
130
133
|
}
|
|
@@ -132,7 +135,7 @@ export class DebugConsoleContribution extends AbstractViewContribution<ConsoleWi
|
|
|
132
135
|
static options: ConsoleOptions = {
|
|
133
136
|
id: 'debug-console',
|
|
134
137
|
title: {
|
|
135
|
-
label: 'Debug Console',
|
|
138
|
+
label: nls.localizeByDefault('Debug Console'),
|
|
136
139
|
iconClass: codicon('debug-console')
|
|
137
140
|
},
|
|
138
141
|
input: {
|
|
@@ -72,13 +72,13 @@ export class DebugConsoleSession extends ConsoleSession {
|
|
|
72
72
|
this.completionKinds.set('file', monaco.languages.CompletionItemKind.File);
|
|
73
73
|
this.completionKinds.set('reference', monaco.languages.CompletionItemKind.Reference);
|
|
74
74
|
this.completionKinds.set('customcolor', monaco.languages.CompletionItemKind.Color);
|
|
75
|
-
monaco.languages.registerCompletionItemProvider({
|
|
75
|
+
this.toDispose.push(monaco.languages.registerCompletionItemProvider({
|
|
76
76
|
scheme: DebugConsoleSession.uri.scheme,
|
|
77
77
|
hasAccessToAllModels: true
|
|
78
78
|
}, {
|
|
79
79
|
triggerCharacters: ['.'],
|
|
80
80
|
provideCompletionItems: (model, position) => this.completions(model, position),
|
|
81
|
-
});
|
|
81
|
+
}));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
getElements(): IterableIterator<ConsoleItem> {
|
|
@@ -82,15 +82,17 @@ export class DebugConfigurationManager {
|
|
|
82
82
|
protected debugConfigurationTypeKey: ContextKey<string>;
|
|
83
83
|
|
|
84
84
|
protected initialized: Promise<void>;
|
|
85
|
+
|
|
85
86
|
@postConstruct()
|
|
86
87
|
protected async init(): Promise<void> {
|
|
87
88
|
this.debugConfigurationTypeKey = this.contextKeyService.createKey<string>('debugConfigurationType', undefined);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
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();
|
|
94
96
|
});
|
|
95
97
|
}
|
|
96
98
|
|
|
@@ -194,6 +196,7 @@ export class DebugConfigurationManager {
|
|
|
194
196
|
await this.doOpen(model);
|
|
195
197
|
}
|
|
196
198
|
}
|
|
199
|
+
|
|
197
200
|
async addConfiguration(): Promise<void> {
|
|
198
201
|
const { model } = this;
|
|
199
202
|
if (!model) {
|
|
@@ -285,7 +288,7 @@ export class DebugConfigurationManager {
|
|
|
285
288
|
*/
|
|
286
289
|
protected async ensureContent(uri: URI, model: DebugConfigurationModel): Promise<void> {
|
|
287
290
|
const textModel = await this.textModelService.createModelReference(uri);
|
|
288
|
-
const currentContent = textModel.object.getText();
|
|
291
|
+
const currentContent = textModel.object.valid ? textModel.object.getText() : '';
|
|
289
292
|
try { // Look for the minimal well-formed launch.json content: {configurations: []}
|
|
290
293
|
const parsedContent = parse(currentContent);
|
|
291
294
|
if (Array.isArray(parsedContent.configurations)) {
|
|
@@ -294,7 +297,6 @@ export class DebugConfigurationManager {
|
|
|
294
297
|
} catch {
|
|
295
298
|
// Just keep going
|
|
296
299
|
}
|
|
297
|
-
|
|
298
300
|
const debugType = await this.selectDebugType();
|
|
299
301
|
const configurations = debugType ? await this.provideDebugConfigurations(debugType, model.workspaceFolderUri) : [];
|
|
300
302
|
const content = this.getInitialConfigurationContent(configurations);
|