@theia/debug 1.73.0-next.20 → 1.73.0-next.26
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.d.ts +2 -0
- package/lib/browser/console/debug-console-session.d.ts.map +1 -1
- package/lib/browser/console/debug-console-session.js +7 -1
- package/lib/browser/console/debug-console-session.js.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.d.ts +2 -0
- package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.js +7 -1
- package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
- package/lib/browser/debug-frontend-module.js +1 -1
- package/lib/browser/debug-frontend-module.js.map +1 -1
- package/lib/browser/debug-session-contribution.d.ts +6 -28
- package/lib/browser/debug-session-contribution.d.ts.map +1 -1
- package/lib/browser/debug-session-contribution.js +19 -72
- package/lib/browser/debug-session-contribution.js.map +1 -1
- package/lib/browser/debug-session-manager.d.ts +2 -1
- package/lib/browser/debug-session-manager.d.ts.map +1 -1
- package/lib/browser/debug-session-manager.js +8 -3
- package/lib/browser/debug-session-manager.js.map +1 -1
- package/lib/browser/debug-session.d.ts +17 -9
- package/lib/browser/debug-session.d.ts.map +1 -1
- package/lib/browser/debug-session.js +123 -40
- package/lib/browser/debug-session.js.map +1 -1
- package/lib/browser/view/debug-toolbar-widget.d.ts +2 -1
- package/lib/browser/view/debug-toolbar-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-toolbar-widget.js +6 -1
- package/lib/browser/view/debug-toolbar-widget.js.map +1 -1
- package/lib/common/debug-adapter-contribution-registry.d.ts +2 -1
- package/lib/common/debug-adapter-contribution-registry.d.ts.map +1 -1
- package/lib/common/debug-adapter-contribution-registry.js +10 -5
- package/lib/common/debug-adapter-contribution-registry.js.map +1 -1
- package/lib/node/debug-service-impl.d.ts +2 -1
- package/lib/node/debug-service-impl.d.ts.map +1 -1
- package/lib/node/debug-service-impl.js +6 -1
- package/lib/node/debug-service-impl.js.map +1 -1
- package/package.json +15 -15
- package/src/browser/console/debug-console-session.ts +6 -3
- package/src/browser/debug-frontend-application-contribution.ts +6 -2
- package/src/browser/debug-frontend-module.ts +1 -1
- package/src/browser/debug-session-contribution.ts +20 -61
- package/src/browser/debug-session-manager.ts +8 -5
- package/src/browser/debug-session.tsx +91 -32
- package/src/browser/view/debug-toolbar-widget.tsx +5 -3
- package/src/common/debug-adapter-contribution-registry.ts +9 -6
- package/src/node/debug-service-impl.ts +6 -3
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/debug",
|
|
3
|
-
"version": "1.73.0-next.
|
|
3
|
+
"version": "1.73.0-next.26+d6f45631a",
|
|
4
4
|
"description": "Theia - Debug Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/console": "1.73.0-next.
|
|
7
|
-
"@theia/core": "1.73.0-next.
|
|
8
|
-
"@theia/editor": "1.73.0-next.
|
|
9
|
-
"@theia/filesystem": "1.73.0-next.
|
|
10
|
-
"@theia/markers": "1.73.0-next.
|
|
11
|
-
"@theia/monaco": "1.73.0-next.
|
|
6
|
+
"@theia/console": "1.73.0-next.26+d6f45631a",
|
|
7
|
+
"@theia/core": "1.73.0-next.26+d6f45631a",
|
|
8
|
+
"@theia/editor": "1.73.0-next.26+d6f45631a",
|
|
9
|
+
"@theia/filesystem": "1.73.0-next.26+d6f45631a",
|
|
10
|
+
"@theia/markers": "1.73.0-next.26+d6f45631a",
|
|
11
|
+
"@theia/monaco": "1.73.0-next.26+d6f45631a",
|
|
12
12
|
"@theia/monaco-editor-core": "1.108.201",
|
|
13
|
-
"@theia/output": "1.73.0-next.
|
|
14
|
-
"@theia/process": "1.73.0-next.
|
|
15
|
-
"@theia/task": "1.73.0-next.
|
|
16
|
-
"@theia/terminal": "1.73.0-next.
|
|
17
|
-
"@theia/test": "1.73.0-next.
|
|
18
|
-
"@theia/variable-resolver": "1.73.0-next.
|
|
19
|
-
"@theia/workspace": "1.73.0-next.
|
|
13
|
+
"@theia/output": "1.73.0-next.26+d6f45631a",
|
|
14
|
+
"@theia/process": "1.73.0-next.26+d6f45631a",
|
|
15
|
+
"@theia/task": "1.73.0-next.26+d6f45631a",
|
|
16
|
+
"@theia/terminal": "1.73.0-next.26+d6f45631a",
|
|
17
|
+
"@theia/test": "1.73.0-next.26+d6f45631a",
|
|
18
|
+
"@theia/variable-resolver": "1.73.0-next.26+d6f45631a",
|
|
19
|
+
"@theia/workspace": "1.73.0-next.26+d6f45631a",
|
|
20
20
|
"@vscode/debugprotocol": "^1.68.0",
|
|
21
21
|
"fast-deep-equal": "^3.1.3",
|
|
22
22
|
"jsonc-parser": "^3.3.1",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"nyc": {
|
|
65
65
|
"extends": "../../configs/nyc.json"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "d6f45631a893ad1944a87db5aaf4bc94c64b1c60"
|
|
68
68
|
}
|
|
@@ -22,11 +22,11 @@ import { DebugSession } from '../debug-session';
|
|
|
22
22
|
import URI from '@theia/core/lib/common/uri';
|
|
23
23
|
import { ExpressionContainer, ExpressionItem } from './debug-console-items';
|
|
24
24
|
import { Severity } from '@theia/core/lib/common/severity';
|
|
25
|
-
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
25
|
+
import { inject, injectable, postConstruct, named } from '@theia/core/shared/inversify';
|
|
26
26
|
import { DebugSessionManager } from '../debug-session-manager';
|
|
27
27
|
import * as monaco from '@theia/monaco-editor-core';
|
|
28
28
|
import { LanguageSelector } from '@theia/monaco-editor-core/esm/vs/editor/common/languageSelector';
|
|
29
|
-
import { Disposable } from '@theia/core';
|
|
29
|
+
import { Disposable, ILogger } from '@theia/core';
|
|
30
30
|
|
|
31
31
|
export const DebugConsoleSessionFactory = Symbol('DebugConsoleSessionFactory');
|
|
32
32
|
|
|
@@ -39,6 +39,9 @@ export class DebugConsoleSession extends ConsoleSession {
|
|
|
39
39
|
|
|
40
40
|
@inject(DebugSessionManager) protected readonly sessionManager: DebugSessionManager;
|
|
41
41
|
|
|
42
|
+
@inject(ILogger) @named('debug:DebugConsoleSession')
|
|
43
|
+
protected readonly logger: ILogger;
|
|
44
|
+
|
|
42
45
|
protected items: ConsoleItem[] = [];
|
|
43
46
|
|
|
44
47
|
protected _terminated = false;
|
|
@@ -248,7 +251,7 @@ export class DebugConsoleSession extends ConsoleSession {
|
|
|
248
251
|
const body = event.body;
|
|
249
252
|
const { category, variablesReference } = body;
|
|
250
253
|
if (category === 'telemetry') {
|
|
251
|
-
|
|
254
|
+
this.logger.debug(`telemetry/${event.body.output}`, event.body.data);
|
|
252
255
|
return;
|
|
253
256
|
}
|
|
254
257
|
const severity = category === 'stderr' ? Severity.Error : event.body.category === 'console' ? Severity.Warning : Severity.Info;
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
AbstractViewContribution, KeybindingRegistry, Widget, CompositeTreeNode, LabelProvider, codicon, OnWillStopAction, FrontendApplicationContribution, ConfirmDialog, Dialog
|
|
19
19
|
} from '@theia/core/lib/browser';
|
|
20
20
|
import { TreeElementNode } from '@theia/core/lib/browser/source-tree';
|
|
21
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
21
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
22
22
|
import * as monaco from '@theia/monaco-editor-core';
|
|
23
23
|
import { MenuModelRegistry, CommandRegistry, Command, URI, Event, MessageService, CancellationError } from '@theia/core/lib/common';
|
|
24
24
|
import { waitForEvent } from '@theia/core/lib/common/promise-util';
|
|
@@ -68,6 +68,7 @@ import {
|
|
|
68
68
|
DebugMenus, DebugCommands, DebugThreadContextCommands, DebugSessionContextCommands,
|
|
69
69
|
DebugEditorContextCommands, DebugBreakpointWidgetCommands, nlsEnableBreakpoint, nlsDisableBreakpoint
|
|
70
70
|
} from './debug-commands';
|
|
71
|
+
import { ILogger } from '@theia/core';
|
|
71
72
|
|
|
72
73
|
@injectable()
|
|
73
74
|
export class DebugFrontendApplicationContribution extends AbstractViewContribution<DebugWidget>
|
|
@@ -115,6 +116,9 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
|
|
|
115
116
|
@inject(AddOrEditDataBreakpointAddress)
|
|
116
117
|
protected readonly AddOrEditDataBreakpointAddress: AddOrEditDataBreakpointAddress;
|
|
117
118
|
|
|
119
|
+
@inject(ILogger) @named('debug:DebugFrontendApplicationContribution')
|
|
120
|
+
protected readonly logger: ILogger;
|
|
121
|
+
|
|
118
122
|
constructor() {
|
|
119
123
|
super({
|
|
120
124
|
widgetId: DebugWidget.ID,
|
|
@@ -1046,7 +1050,7 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
|
|
|
1046
1050
|
if (thread.stopped && thread === this.manager.currentThread) {
|
|
1047
1051
|
return true;
|
|
1048
1052
|
}
|
|
1049
|
-
|
|
1053
|
+
this.logger.warn('Cannot run to the specified location. The current thread has changed or is not stopped.');
|
|
1050
1054
|
return false;
|
|
1051
1055
|
};
|
|
1052
1056
|
if (!checkThread()) {
|
|
@@ -77,7 +77,7 @@ export default new ContainerModule((bind: interfaces.Bind) => {
|
|
|
77
77
|
).inSingletonScope();
|
|
78
78
|
|
|
79
79
|
bindRootContributionProvider(bind, DebugSessionContribution);
|
|
80
|
-
bind(DebugSessionFactory).
|
|
80
|
+
bind(DebugSessionFactory).toDynamicValue(ctx => new DefaultDebugSessionFactory(ctx.container)).inSingletonScope();
|
|
81
81
|
bind(DebugSessionManager).toSelf().inSingletonScope();
|
|
82
82
|
|
|
83
83
|
bind(BreakpointManager).toSelf().inSingletonScope();
|
|
@@ -14,25 +14,15 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, inject, named, postConstruct } from '@theia/core/shared/inversify';
|
|
18
|
-
import {
|
|
19
|
-
import { LabelProvider } from '@theia/core/lib/browser';
|
|
20
|
-
import { EditorManager } from '@theia/editor/lib/browser';
|
|
21
|
-
import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
|
|
22
|
-
import { DebugSession } from './debug-session';
|
|
23
|
-
import { BreakpointManager } from './breakpoint/breakpoint-manager';
|
|
17
|
+
import { injectable, inject, named, postConstruct, interfaces } from '@theia/core/shared/inversify';
|
|
18
|
+
import { DebugSession, DebugSessionData } from './debug-session';
|
|
24
19
|
import { DebugConfigurationSessionOptions, DebugSessionOptions } from './debug-session-options';
|
|
25
20
|
import { OutputChannelManager, OutputChannel } from '@theia/output/lib/browser/output-channel';
|
|
26
21
|
import { DebugPreferences } from '../common/debug-preferences';
|
|
27
22
|
import { DebugSessionConnection } from './debug-session-connection';
|
|
28
23
|
import { DebugChannel, DebugAdapterPath, ForwardingDebugChannel } from '../common/debug-service';
|
|
29
24
|
import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
|
|
30
|
-
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
31
|
-
import { DebugContribution } from './debug-contribution';
|
|
32
|
-
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
33
25
|
import { RemoteConnectionProvider, ServiceConnectionProvider } from '@theia/core/lib/browser/messaging/service-connection-provider';
|
|
34
|
-
import { TestService } from '@theia/test/lib/browser/test-service';
|
|
35
|
-
import { DebugSessionManager } from './debug-session-manager';
|
|
36
26
|
|
|
37
27
|
/**
|
|
38
28
|
* DebugSessionContribution symbol for DI.
|
|
@@ -92,71 +82,40 @@ export const DebugSessionFactory = Symbol('DebugSessionFactory');
|
|
|
92
82
|
* The [debug session](#DebugSession) factory.
|
|
93
83
|
*/
|
|
94
84
|
export interface DebugSessionFactory {
|
|
95
|
-
|
|
85
|
+
createSession(sessionId: string, options: DebugSessionOptions, parentSession?: DebugSession): DebugSession;
|
|
96
86
|
}
|
|
97
87
|
|
|
98
|
-
@injectable()
|
|
99
88
|
export class DefaultDebugSessionFactory implements DebugSessionFactory {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
protected readonly editorManager: EditorManager;
|
|
106
|
-
@inject(BreakpointManager)
|
|
107
|
-
protected readonly breakpoints: BreakpointManager;
|
|
108
|
-
@inject(LabelProvider)
|
|
109
|
-
protected readonly labelProvider: LabelProvider;
|
|
110
|
-
@inject(MessageClient)
|
|
111
|
-
protected readonly messages: MessageClient;
|
|
112
|
-
@inject(OutputChannelManager)
|
|
113
|
-
protected readonly outputChannelManager: OutputChannelManager;
|
|
114
|
-
@inject(DebugPreferences)
|
|
115
|
-
protected readonly debugPreferences: DebugPreferences;
|
|
116
|
-
@inject(FileService)
|
|
117
|
-
protected readonly fileService: FileService;
|
|
118
|
-
@inject(ContributionProvider) @named(DebugContribution)
|
|
119
|
-
protected readonly debugContributionProvider: ContributionProvider<DebugContribution>;
|
|
120
|
-
@inject(TestService)
|
|
121
|
-
protected readonly testService: TestService;
|
|
122
|
-
@inject(WorkspaceService)
|
|
123
|
-
protected readonly workspaceService: WorkspaceService;
|
|
124
|
-
@inject(CommandService)
|
|
125
|
-
protected commandService: CommandService;
|
|
89
|
+
protected readonly container: interfaces.Container;
|
|
90
|
+
|
|
91
|
+
constructor(container: interfaces.Container) {
|
|
92
|
+
this.container = container;
|
|
93
|
+
}
|
|
126
94
|
|
|
127
|
-
|
|
95
|
+
createSession(sessionId: string, options: DebugConfigurationSessionOptions, parentSession?: DebugSession): DebugSession {
|
|
96
|
+
const connectionProvider: ServiceConnectionProvider = this.container.get(RemoteConnectionProvider);
|
|
128
97
|
const connection = new DebugSessionConnection(
|
|
129
98
|
sessionId,
|
|
130
99
|
() => new Promise<DebugChannel>(resolve =>
|
|
131
|
-
|
|
100
|
+
connectionProvider.listen(`${DebugAdapterPath}/${sessionId}`, (_, wsChannel) => {
|
|
132
101
|
resolve(new ForwardingDebugChannel(wsChannel));
|
|
133
102
|
}, false)
|
|
134
103
|
),
|
|
135
104
|
this.getTraceOutputChannel());
|
|
136
|
-
|
|
137
|
-
sessionId,
|
|
105
|
+
const data: DebugSessionData = {
|
|
106
|
+
id: sessionId,
|
|
138
107
|
options,
|
|
139
108
|
parentSession,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
connection,
|
|
144
|
-
this.terminalService,
|
|
145
|
-
this.editorManager,
|
|
146
|
-
this.breakpoints,
|
|
147
|
-
this.labelProvider,
|
|
148
|
-
this.messages,
|
|
149
|
-
this.fileService,
|
|
150
|
-
this.debugContributionProvider,
|
|
151
|
-
this.workspaceService,
|
|
152
|
-
this.debugPreferences,
|
|
153
|
-
this.commandService
|
|
154
|
-
);
|
|
109
|
+
};
|
|
110
|
+
const child = DebugSession.createContainer(this.container, data, connection);
|
|
111
|
+
return child.get(DebugSession);
|
|
155
112
|
}
|
|
156
113
|
|
|
157
114
|
protected getTraceOutputChannel(): OutputChannel | undefined {
|
|
158
|
-
|
|
159
|
-
|
|
115
|
+
const outputChannelManager: OutputChannelManager = this.container.get(OutputChannelManager);
|
|
116
|
+
const debugPreferences: DebugPreferences = this.container.get(DebugPreferences);
|
|
117
|
+
if (debugPreferences['debug.trace']) {
|
|
118
|
+
return outputChannelManager.getChannel('Debug adapters');
|
|
160
119
|
}
|
|
161
120
|
}
|
|
162
121
|
}
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { DisposableCollection, Emitter, Event, MessageService, nls, ProgressService, WaitUntilEvent } from '@theia/core';
|
|
17
|
+
import { DisposableCollection, Emitter, Event, MessageService, nls, ProgressService, WaitUntilEvent, ILogger } from '@theia/core';
|
|
18
18
|
import { ApplicationShell, ConfirmDialog } from '@theia/core/lib/browser';
|
|
19
19
|
import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
20
20
|
import { WindowService } from '@theia/core/lib/browser/window/window-service';
|
|
21
21
|
import URI from '@theia/core/lib/common/uri';
|
|
22
|
-
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
22
|
+
import { inject, injectable, postConstruct, named } from '@theia/core/shared/inversify';
|
|
23
23
|
import * as monaco from '@theia/monaco-editor-core';
|
|
24
24
|
import { QuickOpenTask } from '@theia/task/lib/browser/quick-open-task';
|
|
25
25
|
import { TaskEndedInfo, TaskEndedTypes, TaskService } from '@theia/task/lib/browser/task-service';
|
|
@@ -152,6 +152,9 @@ export class DebugSessionManager {
|
|
|
152
152
|
@inject(DebugSessionConfigurationLabelProvider)
|
|
153
153
|
protected readonly sessionConfigurationLabelProvider: DebugSessionConfigurationLabelProvider;
|
|
154
154
|
|
|
155
|
+
@inject(ILogger) @named('debug:DebugSessionManager')
|
|
156
|
+
protected readonly logger: ILogger;
|
|
157
|
+
|
|
155
158
|
@inject(WorkspaceTrustService)
|
|
156
159
|
protected readonly workspaceTrustService: WorkspaceTrustService;
|
|
157
160
|
|
|
@@ -188,7 +191,7 @@ export class DebugSessionManager {
|
|
|
188
191
|
await this.shell.saveAll();
|
|
189
192
|
return true;
|
|
190
193
|
} catch (error) {
|
|
191
|
-
|
|
194
|
+
this.logger.error('saveAll failed:', error);
|
|
192
195
|
return false;
|
|
193
196
|
}
|
|
194
197
|
}
|
|
@@ -265,7 +268,7 @@ export class DebugSessionManager {
|
|
|
265
268
|
}
|
|
266
269
|
|
|
267
270
|
this.messageService.error(nls.localize('theia/debug/errorStartingDebugSession', 'There was an error starting the debug session, check the logs for more details.'));
|
|
268
|
-
|
|
271
|
+
this.logger.error('Error starting the debug session', e);
|
|
269
272
|
throw e;
|
|
270
273
|
}
|
|
271
274
|
});
|
|
@@ -412,7 +415,7 @@ export class DebugSessionManager {
|
|
|
412
415
|
const parentSession = options.configuration.parentSessionId ? this._sessions.get(options.configuration.parentSessionId) : undefined;
|
|
413
416
|
const contrib = this.sessionContributionRegistry.get(options.configuration.type);
|
|
414
417
|
const sessionFactory = contrib ? contrib.debugSessionFactory() : this.debugSessionFactory;
|
|
415
|
-
const session = sessionFactory.
|
|
418
|
+
const session = sessionFactory.createSession(sessionId, options, parentSession);
|
|
416
419
|
this._sessions.set(sessionId, session);
|
|
417
420
|
|
|
418
421
|
this.debugTypeKey.set(session.configuration.type);
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
CommandService,
|
|
32
32
|
CancellationError
|
|
33
33
|
} from '@theia/core/lib/common';
|
|
34
|
+
import { inject, injectable, named, postConstruct, interfaces, LazyServiceIdentifier } from '@theia/core/shared/inversify';
|
|
34
35
|
import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
|
|
35
36
|
import { EditorManager } from '@theia/editor/lib/browser';
|
|
36
37
|
import { CompositeTreeElement } from '@theia/core/lib/browser/source-tree';
|
|
@@ -43,7 +44,7 @@ import { DebugBreakpoint } from './model/debug-breakpoint';
|
|
|
43
44
|
import debounce = require('p-debounce');
|
|
44
45
|
import URI from '@theia/core/lib/common/uri';
|
|
45
46
|
import { BreakpointManager } from './breakpoint/breakpoint-manager';
|
|
46
|
-
import { DebugConfigurationSessionOptions, InternalDebugSessionOptions
|
|
47
|
+
import { DebugConfigurationSessionOptions, InternalDebugSessionOptions } from './debug-session-options';
|
|
47
48
|
import { DebugConfiguration, DebugConsoleMode } from '../common/debug-common';
|
|
48
49
|
import { SourceBreakpoint } from './breakpoint/breakpoint-marker';
|
|
49
50
|
import { TerminalWidgetOptions, TerminalWidget } from '@theia/terminal/lib/browser/base/terminal-widget';
|
|
@@ -57,6 +58,14 @@ import { DebugSessionManager } from './debug-session-manager';
|
|
|
57
58
|
|
|
58
59
|
import { DebugPreferences } from '../common/debug-preferences';
|
|
59
60
|
|
|
61
|
+
export const DebugSessionData = Symbol('DebugSessionData');
|
|
62
|
+
export const DebugSessionStopTimeout = Symbol('DebugSessionStopTimeout');
|
|
63
|
+
export interface DebugSessionData {
|
|
64
|
+
id: string;
|
|
65
|
+
options: DebugConfigurationSessionOptions;
|
|
66
|
+
parentSession: DebugSession | undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
60
69
|
export enum DebugState {
|
|
61
70
|
Inactive,
|
|
62
71
|
Initializing,
|
|
@@ -87,8 +96,79 @@ export function formatMessage(format: string, variables?: { [key: string]: strin
|
|
|
87
96
|
return variables ? format.replace(formatMessageRegexp, (match, group) => variables.hasOwnProperty(group) ? variables[group] : match) : format;
|
|
88
97
|
}
|
|
89
98
|
|
|
90
|
-
|
|
99
|
+
@injectable()
|
|
91
100
|
export class DebugSession implements CompositeTreeElement {
|
|
101
|
+
|
|
102
|
+
static createContainer(parent: interfaces.Container, data: DebugSessionData, connection: DebugSessionConnection): interfaces.Container {
|
|
103
|
+
const child = parent.createChild();
|
|
104
|
+
child.bind(DebugSessionData).toConstantValue(data);
|
|
105
|
+
child.bind(DebugSessionStopTimeout).toConstantValue(5_000);
|
|
106
|
+
child.bind(DebugSessionConnection).toConstantValue(connection);
|
|
107
|
+
child.bind(DebugSession).toSelf().inSingletonScope();
|
|
108
|
+
return child;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@inject(DebugSessionData)
|
|
112
|
+
protected readonly data: DebugSessionData;
|
|
113
|
+
|
|
114
|
+
@inject(DebugSessionConnection)
|
|
115
|
+
protected readonly connection: DebugSessionConnection;
|
|
116
|
+
|
|
117
|
+
@inject(TestService)
|
|
118
|
+
protected readonly testService: TestService;
|
|
119
|
+
|
|
120
|
+
@inject(new LazyServiceIdentifier(() => DebugSessionManager))
|
|
121
|
+
protected readonly sessionManager: DebugSessionManager;
|
|
122
|
+
|
|
123
|
+
@inject(TerminalService)
|
|
124
|
+
protected readonly terminalServer: TerminalService;
|
|
125
|
+
|
|
126
|
+
@inject(EditorManager)
|
|
127
|
+
protected readonly editorManager: EditorManager;
|
|
128
|
+
|
|
129
|
+
@inject(BreakpointManager)
|
|
130
|
+
protected readonly breakpoints: BreakpointManager;
|
|
131
|
+
|
|
132
|
+
@inject(LabelProvider)
|
|
133
|
+
protected readonly labelProvider: LabelProvider;
|
|
134
|
+
|
|
135
|
+
@inject(MessageClient)
|
|
136
|
+
protected readonly messages: MessageClient;
|
|
137
|
+
|
|
138
|
+
@inject(FileService)
|
|
139
|
+
protected readonly fileService: FileService;
|
|
140
|
+
|
|
141
|
+
@inject(ContributionProvider)
|
|
142
|
+
@named(DebugContribution)
|
|
143
|
+
protected readonly debugContributionProvider: ContributionProvider<DebugContribution>;
|
|
144
|
+
|
|
145
|
+
@inject(WorkspaceService)
|
|
146
|
+
protected readonly workspaceService: WorkspaceService;
|
|
147
|
+
|
|
148
|
+
@inject(DebugPreferences)
|
|
149
|
+
protected readonly debugPreferences: DebugPreferences;
|
|
150
|
+
|
|
151
|
+
@inject(CommandService)
|
|
152
|
+
protected readonly commandService: CommandService;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Number of millis after a `stop` request times out. It's 5 seconds by default.
|
|
156
|
+
*/
|
|
157
|
+
@inject(DebugSessionStopTimeout)
|
|
158
|
+
protected readonly stopTimeout: number;
|
|
159
|
+
|
|
160
|
+
get id(): string {
|
|
161
|
+
return this.data.id;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
get options(): DebugConfigurationSessionOptions {
|
|
165
|
+
return this.data.options;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
get parentSession(): DebugSession | undefined {
|
|
169
|
+
return this.data.parentSession;
|
|
170
|
+
}
|
|
171
|
+
|
|
92
172
|
protected readonly deferredOnDidConfigureCapabilities = new Deferred<void>();
|
|
93
173
|
|
|
94
174
|
protected readonly onDidChangeEmitter = new Emitter<void>();
|
|
@@ -117,47 +197,26 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
117
197
|
/** Maximum time to wait for the shell integration prompt before proceeding. */
|
|
118
198
|
protected readonly PROMPT_READY_TIMEOUT_MS = 3000;
|
|
119
199
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
readonly options: DebugConfigurationSessionOptions,
|
|
123
|
-
readonly parentSession: DebugSession | undefined,
|
|
124
|
-
testService: TestService,
|
|
125
|
-
testRun: TestRunReference | undefined,
|
|
126
|
-
sessionManager: DebugSessionManager,
|
|
127
|
-
protected readonly connection: DebugSessionConnection,
|
|
128
|
-
protected readonly terminalServer: TerminalService,
|
|
129
|
-
protected readonly editorManager: EditorManager,
|
|
130
|
-
protected readonly breakpoints: BreakpointManager,
|
|
131
|
-
protected readonly labelProvider: LabelProvider,
|
|
132
|
-
protected readonly messages: MessageClient,
|
|
133
|
-
protected readonly fileService: FileService,
|
|
134
|
-
protected readonly debugContributionProvider: ContributionProvider<DebugContribution>,
|
|
135
|
-
protected readonly workspaceService: WorkspaceService,
|
|
136
|
-
protected readonly debugPreferences: DebugPreferences,
|
|
137
|
-
protected readonly commandService: CommandService,
|
|
138
|
-
/**
|
|
139
|
-
* Number of millis after a `stop` request times out. It's 5 seconds by default.
|
|
140
|
-
*/
|
|
141
|
-
protected readonly stopTimeout = 5_000,
|
|
142
|
-
) {
|
|
200
|
+
@postConstruct()
|
|
201
|
+
protected init(): void {
|
|
143
202
|
this.connection.onRequest('runInTerminal', (request: DebugProtocol.RunInTerminalRequest) => this.runInTerminal(request));
|
|
144
203
|
this.connection.onDidClose(() => {
|
|
145
204
|
this.toDispose.dispose();
|
|
146
205
|
});
|
|
147
|
-
this.registerDebugContributions(options.configuration.type, this.connection);
|
|
206
|
+
this.registerDebugContributions(this.options.configuration.type, this.connection);
|
|
148
207
|
|
|
149
|
-
if (parentSession) {
|
|
150
|
-
parentSession.childSessions.set(id, this);
|
|
208
|
+
if (this.parentSession) {
|
|
209
|
+
this.parentSession.childSessions.set(this.id, this);
|
|
151
210
|
this.toDispose.push(Disposable.create(() => {
|
|
152
|
-
this.parentSession?.childSessions?.delete(id);
|
|
211
|
+
this.parentSession?.childSessions?.delete(this.id);
|
|
153
212
|
}));
|
|
154
213
|
}
|
|
155
|
-
if (testRun) {
|
|
214
|
+
if (this.options.testRun) {
|
|
156
215
|
try {
|
|
157
|
-
const run = TestServices.withTestRun(testService, testRun.controllerId, testRun.runId);
|
|
216
|
+
const run = TestServices.withTestRun(this.testService, this.options.testRun.controllerId, this.options.testRun.runId);
|
|
158
217
|
run.onDidChangeProperty(evt => {
|
|
159
218
|
if (evt.isRunning === false) {
|
|
160
|
-
sessionManager.terminateSession(this);
|
|
219
|
+
this.sessionManager.terminateSession(this);
|
|
161
220
|
}
|
|
162
221
|
});
|
|
163
222
|
} catch (err) {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as React from '@theia/core/shared/react';
|
|
18
|
-
import { inject, postConstruct, injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import { CommandMenu, CompoundMenuNode, MenuModelRegistry, MenuPath } from '@theia/core';
|
|
18
|
+
import { inject, postConstruct, injectable, named } from '@theia/core/shared/inversify';
|
|
19
|
+
import { CommandMenu, CompoundMenuNode, MenuModelRegistry, MenuPath, ILogger } from '@theia/core';
|
|
20
20
|
import { KeybindingRegistry } from '@theia/core/lib/browser';
|
|
21
21
|
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
22
22
|
import { ReactWidget } from '@theia/core/lib/browser/widgets';
|
|
@@ -33,6 +33,8 @@ export class DebugToolBar extends ReactWidget {
|
|
|
33
33
|
@inject(KeybindingRegistry) protected readonly keybindingRegistry: KeybindingRegistry;
|
|
34
34
|
@inject(ContextKeyService) protected readonly contextKeyService: ContextKeyService;
|
|
35
35
|
@inject(DebugViewModel) protected readonly model: DebugViewModel;
|
|
36
|
+
@inject(ILogger) @named('debug:DebugToolBar')
|
|
37
|
+
protected readonly logger: ILogger;
|
|
36
38
|
|
|
37
39
|
@postConstruct()
|
|
38
40
|
protected init(): void {
|
|
@@ -69,7 +71,7 @@ export class DebugToolBar extends ReactWidget {
|
|
|
69
71
|
|
|
70
72
|
protected debugAction(commandMenuNode: CommandMenu): React.ReactNode {
|
|
71
73
|
const accelerator = this.acceleratorFor(commandMenuNode.id);
|
|
72
|
-
const run = (effectiveMenuPath: MenuPath) => commandMenuNode.run(effectiveMenuPath).catch(e =>
|
|
74
|
+
const run = (effectiveMenuPath: MenuPath) => commandMenuNode.run(effectiveMenuPath).catch(e => this.logger.error(e));
|
|
73
75
|
return <DebugAction
|
|
74
76
|
key={commandMenuNode.id}
|
|
75
77
|
enabled={commandMenuNode.isEnabled(DebugToolBar.MENU)}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
18
|
-
import { ContributionProvider } from '@theia/core';
|
|
18
|
+
import { ContributionProvider, ILogger } from '@theia/core';
|
|
19
19
|
import { DebugConfiguration } from './debug-configuration';
|
|
20
20
|
import { DebuggerDescription, DebugError } from './debug-service';
|
|
21
21
|
|
|
@@ -28,6 +28,9 @@ import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-sch
|
|
|
28
28
|
@injectable()
|
|
29
29
|
export class DebugAdapterContributionRegistry {
|
|
30
30
|
|
|
31
|
+
@inject(ILogger) @named('debug:DebugAdapterContributionRegistry')
|
|
32
|
+
protected readonly logger: ILogger;
|
|
33
|
+
|
|
31
34
|
@inject(ContributionProvider) @named(DebugAdapterContribution)
|
|
32
35
|
protected readonly contributions: ContributionProvider<DebugAdapterContribution>;
|
|
33
36
|
protected *getContributions(debugType: string): IterableIterator<DebugAdapterContribution> {
|
|
@@ -83,7 +86,7 @@ export class DebugAdapterContributionRegistry {
|
|
|
83
86
|
const result = await contribution.provideDebugConfigurations(workspaceFolderUri);
|
|
84
87
|
configurations.push(...result);
|
|
85
88
|
} catch (e) {
|
|
86
|
-
|
|
89
|
+
this.logger.error('provideDebugConfigurations failed:', e);
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
}
|
|
@@ -108,7 +111,7 @@ export class DebugAdapterContributionRegistry {
|
|
|
108
111
|
return current;
|
|
109
112
|
}
|
|
110
113
|
} catch (e) {
|
|
111
|
-
|
|
114
|
+
this.logger.error('resolveDebugConfiguration failed:', e);
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
}
|
|
@@ -133,7 +136,7 @@ export class DebugAdapterContributionRegistry {
|
|
|
133
136
|
return current;
|
|
134
137
|
}
|
|
135
138
|
} catch (e) {
|
|
136
|
-
|
|
139
|
+
this.logger.error('resolveDebugConfigurationWithSubstitutedVariables failed:', e);
|
|
137
140
|
}
|
|
138
141
|
}
|
|
139
142
|
}
|
|
@@ -152,7 +155,7 @@ export class DebugAdapterContributionRegistry {
|
|
|
152
155
|
try {
|
|
153
156
|
schemas.push(...await contribution.getSchemaAttributes());
|
|
154
157
|
} catch (e) {
|
|
155
|
-
|
|
158
|
+
this.logger.error('getSchemaAttributes failed:', e);
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
}
|
|
@@ -165,7 +168,7 @@ export class DebugAdapterContributionRegistry {
|
|
|
165
168
|
try {
|
|
166
169
|
schemas.push(...await contribution.getConfigurationSnippets());
|
|
167
170
|
} catch (e) {
|
|
168
|
-
|
|
171
|
+
this.logger.error('getConfigurationSnippets failed:', e);
|
|
169
172
|
}
|
|
170
173
|
}
|
|
171
174
|
}
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import { DebugConfiguration } from '../common/debug-configuration';
|
|
19
19
|
import { DebugService, DebuggerDescription, DynamicDebugConfigurationProvider } from '../common/debug-service';
|
|
20
20
|
import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-schema';
|
|
21
21
|
import { CommandIdVariables } from '@theia/variable-resolver/lib/common/variable-types';
|
|
22
22
|
import { DebugAdapterSessionManager } from './debug-adapter-session-manager';
|
|
23
23
|
import { DebugAdapterContributionRegistry } from '../common/debug-adapter-contribution-registry';
|
|
24
|
-
import { Event } from '@theia/core';
|
|
24
|
+
import { Event, ILogger } from '@theia/core';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* DebugService implementation.
|
|
@@ -35,6 +35,9 @@ export class DebugServiceImpl implements DebugService {
|
|
|
35
35
|
@inject(DebugAdapterContributionRegistry)
|
|
36
36
|
protected readonly registry: DebugAdapterContributionRegistry;
|
|
37
37
|
|
|
38
|
+
@inject(ILogger) @named('debug:DebugServiceImpl')
|
|
39
|
+
protected readonly logger: ILogger;
|
|
40
|
+
|
|
38
41
|
get onDidChangeDebugConfigurationProviders(): Event<void> {
|
|
39
42
|
return Event.None;
|
|
40
43
|
}
|
|
@@ -113,7 +116,7 @@ export class DebugServiceImpl implements DebugService {
|
|
|
113
116
|
try {
|
|
114
117
|
await this.doStop(session);
|
|
115
118
|
} catch (e) {
|
|
116
|
-
|
|
119
|
+
this.logger.error('terminateDebugSession failed:', e);
|
|
117
120
|
}
|
|
118
121
|
})());
|
|
119
122
|
}
|