@theia/debug 1.29.0-next.9 → 1.29.1
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/breakpoint/breakpoint-marker.d.ts +1 -1
- package/lib/browser/breakpoint/breakpoint-marker.d.ts.map +1 -1
- package/lib/browser/console/debug-console-items.d.ts +1 -1
- package/lib/browser/console/debug-console-items.d.ts.map +1 -1
- package/lib/browser/console/debug-console-session.d.ts +1 -1
- package/lib/browser/console/debug-console-session.d.ts.map +1 -1
- package/lib/browser/debug-configuration-manager.d.ts +15 -7
- package/lib/browser/debug-configuration-manager.d.ts.map +1 -1
- package/lib/browser/debug-configuration-manager.js +81 -31
- package/lib/browser/debug-configuration-manager.js.map +1 -1
- package/lib/browser/debug-configuration-model.d.ts +3 -0
- package/lib/browser/debug-configuration-model.d.ts.map +1 -1
- package/lib/browser/debug-configuration-model.js +17 -10
- package/lib/browser/debug-configuration-model.js.map +1 -1
- package/lib/browser/debug-contribution.d.ts +1 -1
- package/lib/browser/debug-contribution.d.ts.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.js +6 -3
- package/lib/browser/debug-frontend-application-contribution.js.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-schema-updater.d.ts.map +1 -1
- package/lib/browser/debug-schema-updater.js +55 -4
- package/lib/browser/debug-schema-updater.js.map +1 -1
- package/lib/browser/debug-session-connection.d.ts +1 -1
- package/lib/browser/debug-session-connection.d.ts.map +1 -1
- package/lib/browser/debug-session-contribution.d.ts +2 -2
- 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 +10 -4
- package/lib/browser/debug-session-manager.d.ts.map +1 -1
- package/lib/browser/debug-session-manager.js +64 -7
- package/lib/browser/debug-session-manager.js.map +1 -1
- package/lib/browser/debug-session-options.d.ts +36 -6
- package/lib/browser/debug-session-options.d.ts.map +1 -1
- package/lib/browser/debug-session-options.js +53 -10
- package/lib/browser/debug-session-options.js.map +1 -1
- package/lib/browser/debug-session.d.ts +4 -4
- package/lib/browser/debug-session.d.ts.map +1 -1
- package/lib/browser/debug-session.js +7 -0
- package/lib/browser/debug-session.js.map +1 -1
- package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.d.ts +1 -1
- package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.d.ts.map +1 -1
- package/lib/browser/disassembly-view/disassembly-view-utilities.d.ts +1 -1
- package/lib/browser/disassembly-view/disassembly-view-utilities.d.ts.map +1 -1
- package/lib/browser/editor/debug-breakpoint-widget.d.ts +3 -1
- package/lib/browser/editor/debug-breakpoint-widget.d.ts.map +1 -1
- package/lib/browser/editor/debug-breakpoint-widget.js +5 -4
- package/lib/browser/editor/debug-breakpoint-widget.js.map +1 -1
- package/lib/browser/editor/debug-editor-model.d.ts +1 -1
- package/lib/browser/editor/debug-editor-model.d.ts.map +1 -1
- package/lib/browser/editor/debug-exception-widget.d.ts +2 -0
- package/lib/browser/editor/debug-exception-widget.d.ts.map +1 -1
- package/lib/browser/editor/debug-exception-widget.js +6 -5
- package/lib/browser/editor/debug-exception-widget.js.map +1 -1
- package/lib/browser/editor/debug-hover-widget.d.ts.map +1 -1
- package/lib/browser/editor/debug-hover-widget.js +9 -8
- package/lib/browser/editor/debug-hover-widget.js.map +1 -1
- package/lib/browser/model/debug-breakpoint.d.ts +1 -1
- package/lib/browser/model/debug-breakpoint.d.ts.map +1 -1
- package/lib/browser/model/debug-source-breakpoint.d.ts +1 -1
- package/lib/browser/model/debug-source-breakpoint.d.ts.map +1 -1
- package/lib/browser/model/debug-source.d.ts +1 -1
- package/lib/browser/model/debug-source.d.ts.map +1 -1
- package/lib/browser/model/debug-stack-frame.d.ts +1 -1
- package/lib/browser/model/debug-stack-frame.d.ts.map +1 -1
- package/lib/browser/model/debug-thread.d.ts +1 -1
- package/lib/browser/model/debug-thread.d.ts.map +1 -1
- package/lib/browser/view/debug-configuration-select.d.ts +4 -1
- package/lib/browser/view/debug-configuration-select.d.ts.map +1 -1
- package/lib/browser/view/debug-configuration-select.js +36 -14
- package/lib/browser/view/debug-configuration-select.js.map +1 -1
- package/lib/browser/view/debug-configuration-widget.d.ts +3 -2
- package/lib/browser/view/debug-configuration-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-configuration-widget.js +5 -1
- package/lib/browser/view/debug-configuration-widget.js.map +1 -1
- package/lib/browser/view/debug-toolbar-widget.d.ts +8 -7
- package/lib/browser/view/debug-toolbar-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-toolbar-widget.js +5 -1
- package/lib/browser/view/debug-toolbar-widget.js.map +1 -1
- package/lib/browser/view/debug-watch-expression.d.ts +1 -1
- package/lib/browser/view/debug-watch-expression.d.ts.map +1 -1
- package/lib/common/debug-compound.d.ts +15 -0
- package/lib/common/debug-compound.d.ts.map +1 -0
- package/lib/common/debug-compound.js +27 -0
- package/lib/common/debug-compound.js.map +1 -0
- package/lib/common/debug-configuration.d.ts +2 -2
- package/lib/common/debug-configuration.d.ts.map +1 -1
- package/lib/common/debug-configuration.js.map +1 -1
- package/lib/node/debug-adapter-factory.d.ts.map +1 -1
- package/lib/node/debug-adapter-factory.js +1 -2
- package/lib/node/debug-adapter-factory.js.map +1 -1
- package/package.json +17 -17
- package/src/browser/breakpoint/breakpoint-marker.ts +1 -1
- package/src/browser/console/debug-console-items.tsx +1 -1
- package/src/browser/console/debug-console-session.ts +1 -1
- package/src/browser/debug-configuration-manager.ts +92 -40
- package/src/browser/debug-configuration-model.ts +19 -10
- package/src/browser/debug-contribution.ts +1 -1
- package/src/browser/debug-frontend-application-contribution.ts +10 -3
- package/src/browser/debug-prefix-configuration.ts +3 -3
- package/src/browser/debug-schema-updater.ts +56 -5
- package/src/browser/debug-session-connection.ts +1 -1
- package/src/browser/debug-session-contribution.ts +2 -2
- package/src/browser/debug-session-manager.ts +79 -8
- package/src/browser/debug-session-options.ts +72 -15
- package/src/browser/debug-session.tsx +9 -3
- package/src/browser/disassembly-view/disassembly-view-instruction-renderer.ts +1 -1
- package/src/browser/disassembly-view/disassembly-view-utilities.ts +1 -1
- package/src/browser/disassembly-view/disassembly-view-widget.ts +1 -1
- package/src/browser/editor/debug-breakpoint-widget.tsx +7 -5
- package/src/browser/editor/debug-editor-model.ts +1 -1
- package/src/browser/editor/debug-exception-widget.tsx +7 -5
- package/src/browser/editor/debug-hover-widget.ts +9 -8
- package/src/browser/model/debug-breakpoint.tsx +1 -1
- package/src/browser/model/debug-source-breakpoint.tsx +1 -1
- package/src/browser/model/debug-source.ts +1 -1
- package/src/browser/model/debug-stack-frame.tsx +1 -1
- package/src/browser/model/debug-thread.tsx +1 -1
- package/src/browser/view/debug-configuration-select.tsx +42 -20
- package/src/browser/view/debug-configuration-widget.tsx +7 -2
- package/src/browser/view/debug-toolbar-widget.tsx +7 -2
- package/src/browser/view/debug-watch-expression.tsx +1 -1
- package/src/common/debug-adapter-session.ts +1 -1
- package/src/common/debug-compound.ts +32 -0
- package/src/common/debug-configuration.ts +2 -2
- package/src/node/debug-adapter-factory.ts +2 -3
|
@@ -14,44 +14,101 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
+
import { Emitter } from '@theia/core';
|
|
17
18
|
import { DebugConfiguration } from '../common/debug-common';
|
|
19
|
+
import { DebugCompound } from '../common/debug-compound';
|
|
20
|
+
|
|
21
|
+
export class DebugCompoundRoot {
|
|
22
|
+
private stopped = false;
|
|
23
|
+
private stopEmitter = new Emitter<void>();
|
|
24
|
+
onDidSessionStop = this.stopEmitter.event;
|
|
25
|
+
|
|
26
|
+
stopSession(): void {
|
|
27
|
+
if (!this.stopped) { // avoid sending extraneous terminate events
|
|
28
|
+
this.stopped = true;
|
|
29
|
+
this.stopEmitter.fire();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
18
33
|
|
|
19
34
|
export interface DebugSessionOptionsBase {
|
|
20
35
|
workspaceFolderUri?: string,
|
|
21
|
-
providerType?: string // Applicable to dynamic configurations
|
|
22
36
|
}
|
|
23
37
|
|
|
24
|
-
export interface
|
|
25
|
-
|
|
38
|
+
export interface DebugConfigurationSessionOptions extends DebugSessionOptionsBase {
|
|
39
|
+
name: string; // derived from the configuration
|
|
40
|
+
configuration: DebugConfiguration;
|
|
41
|
+
compound?: never;
|
|
42
|
+
compoundRoot?: DebugCompoundRoot;
|
|
43
|
+
providerType?: string // Applicable to dynamic configurations
|
|
26
44
|
}
|
|
27
45
|
|
|
28
|
-
export
|
|
46
|
+
export type DynamicDebugConfigurationSessionOptions = DebugConfigurationSessionOptions & { providerType: string };
|
|
47
|
+
|
|
48
|
+
export interface DebugCompoundSessionOptions extends DebugSessionOptionsBase {
|
|
49
|
+
name: string; // derived from the compound
|
|
50
|
+
configuration?: never;
|
|
51
|
+
compound: DebugCompound;
|
|
52
|
+
noDebug?: boolean,
|
|
29
53
|
}
|
|
30
54
|
|
|
31
|
-
export
|
|
32
|
-
|
|
55
|
+
export type DebugSessionOptions = DebugConfigurationSessionOptions | DebugCompoundSessionOptions;
|
|
56
|
+
|
|
57
|
+
export namespace DebugSessionOptions {
|
|
58
|
+
export function isConfiguration(options?: DebugSessionOptions): options is DebugConfigurationSessionOptions {
|
|
59
|
+
return !!options && 'configuration' in options && !!options.configuration;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function isDynamic(options?: DebugSessionOptions): options is DynamicDebugConfigurationSessionOptions {
|
|
63
|
+
return isConfiguration(options) && 'providerType' in options && !!options.providerType;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function isCompound(options?: DebugSessionOptions): options is DebugCompoundSessionOptions {
|
|
67
|
+
return !!options && 'compound' in options && !!options.compound;
|
|
68
|
+
}
|
|
33
69
|
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Flat and partial version of a debug session options usable to find the options later in the manager.
|
|
73
|
+
* @deprecated Not needed anymore, the recommended way is to serialize/deserialize the options directly using `JSON.stringify` and `JSON.parse`.
|
|
74
|
+
*/
|
|
75
|
+
export type DebugSessionOptionsData = DebugSessionOptionsBase & (DebugConfiguration | DebugCompound);
|
|
76
|
+
|
|
77
|
+
export type InternalDebugSessionOptions = DebugSessionOptions & { id: number };
|
|
78
|
+
|
|
34
79
|
export namespace InternalDebugSessionOptions {
|
|
35
80
|
|
|
36
81
|
const SEPARATOR = '__CONF__';
|
|
82
|
+
const SEPARATOR_CONFIGS = '__COMP__';
|
|
37
83
|
|
|
38
84
|
export function is(options: DebugSessionOptions): options is InternalDebugSessionOptions {
|
|
39
85
|
return 'id' in options;
|
|
40
86
|
}
|
|
41
87
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
88
|
+
/** @deprecated Please use `JSON.stringify` to serialize the options. */
|
|
89
|
+
export function toValue(options: DebugSessionOptions): string {
|
|
90
|
+
if (DebugSessionOptions.isCompound(options)) {
|
|
91
|
+
return options.compound.name + SEPARATOR +
|
|
92
|
+
options.workspaceFolderUri + SEPARATOR +
|
|
93
|
+
options.compound?.configurations.join(SEPARATOR_CONFIGS);
|
|
94
|
+
}
|
|
95
|
+
return options.configuration.name + SEPARATOR +
|
|
96
|
+
options.configuration.type + SEPARATOR +
|
|
97
|
+
options.configuration.request + SEPARATOR +
|
|
98
|
+
options.workspaceFolderUri + SEPARATOR +
|
|
99
|
+
options.providerType;
|
|
48
100
|
}
|
|
49
101
|
|
|
102
|
+
/** @deprecated Please use `JSON.parse` to restore previously serialized debug session options. */
|
|
103
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
50
104
|
export function parseValue(value: string): DebugSessionOptionsData {
|
|
51
105
|
const split = value.split(SEPARATOR);
|
|
52
|
-
if (split.length
|
|
53
|
-
|
|
106
|
+
if (split.length === 5) {
|
|
107
|
+
return { name: split[0], type: split[1], request: split[2], workspaceFolderUri: split[3], providerType: split[4] };
|
|
108
|
+
}
|
|
109
|
+
if (split.length === 3) {
|
|
110
|
+
return { name: split[0], workspaceFolderUri: split[1], configurations: split[2].split(SEPARATOR_CONFIGS) };
|
|
54
111
|
}
|
|
55
|
-
|
|
112
|
+
throw new Error('Unexpected argument, the argument is expected to have been generated by the \'toValue\' function');
|
|
56
113
|
}
|
|
57
114
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import * as React from '@theia/core/shared/react';
|
|
20
20
|
import { LabelProvider } from '@theia/core/lib/browser';
|
|
21
|
-
import { DebugProtocol } from 'vscode
|
|
21
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
22
22
|
import { Emitter, Event, DisposableCollection, Disposable, MessageClient, MessageType, Mutable, ContributionProvider } from '@theia/core/lib/common';
|
|
23
23
|
import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
|
|
24
24
|
import { EditorManager } from '@theia/editor/lib/browser';
|
|
@@ -33,7 +33,7 @@ import { DebugSourceBreakpoint } from './model/debug-source-breakpoint';
|
|
|
33
33
|
import debounce = require('p-debounce');
|
|
34
34
|
import URI from '@theia/core/lib/common/uri';
|
|
35
35
|
import { BreakpointManager } from './breakpoint/breakpoint-manager';
|
|
36
|
-
import {
|
|
36
|
+
import { DebugConfigurationSessionOptions, InternalDebugSessionOptions } from './debug-session-options';
|
|
37
37
|
import { DebugConfiguration, DebugConsoleMode } from '../common/debug-common';
|
|
38
38
|
import { SourceBreakpoint, ExceptionBreakpoint } from './breakpoint/breakpoint-marker';
|
|
39
39
|
import { TerminalWidgetOptions, TerminalWidget } from '@theia/terminal/lib/browser/base/terminal-widget';
|
|
@@ -76,7 +76,7 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
76
76
|
|
|
77
77
|
constructor(
|
|
78
78
|
readonly id: string,
|
|
79
|
-
readonly options:
|
|
79
|
+
readonly options: DebugConfigurationSessionOptions,
|
|
80
80
|
readonly parentSession: DebugSession | undefined,
|
|
81
81
|
protected readonly connection: DebugSessionConnection,
|
|
82
82
|
protected readonly terminalServer: TerminalService,
|
|
@@ -117,6 +117,9 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
117
117
|
this.connection.on('capabilities', event => this.updateCapabilities(event.body.capabilities)),
|
|
118
118
|
this.breakpoints.onDidChangeMarkers(uri => this.updateBreakpoints({ uri, sourceModified: true }))
|
|
119
119
|
]);
|
|
120
|
+
if (this.options.compoundRoot) {
|
|
121
|
+
this.toDispose.push(this.options.compoundRoot.onDidSessionStop(() => this.stop(false, () => { })));
|
|
122
|
+
}
|
|
120
123
|
}
|
|
121
124
|
|
|
122
125
|
get onDispose(): Event<void> {
|
|
@@ -352,6 +355,9 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
352
355
|
console.error('Error on disconnect', e);
|
|
353
356
|
}
|
|
354
357
|
}
|
|
358
|
+
if (!isRestart) {
|
|
359
|
+
this.options.compoundRoot?.stopSession();
|
|
360
|
+
}
|
|
355
361
|
callback();
|
|
356
362
|
}
|
|
357
363
|
}
|
|
@@ -29,7 +29,7 @@ import { createStringBuilder } from '@theia/monaco-editor-core/esm/vs/editor/com
|
|
|
29
29
|
import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
|
|
30
30
|
import { ITextModelService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/resolverService';
|
|
31
31
|
import { IThemeService } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
|
|
32
|
-
import { DebugProtocol } from 'vscode
|
|
32
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
33
33
|
import { DebugSource } from '../model/debug-source';
|
|
34
34
|
import { DisassembledInstructionEntry, DisassemblyViewRendererReference, InstructionColumnTemplateData } from './disassembly-view-utilities';
|
|
35
35
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { IDisposable, IEvent } from '@theia/monaco-editor-core';
|
|
18
18
|
import { BareFontInfo } from '@theia/monaco-editor-core/esm/vs/editor/common/config/fontInfo';
|
|
19
|
-
import { DebugProtocol } from 'vscode
|
|
19
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
20
20
|
|
|
21
21
|
export interface DisassemblyViewRendererReference {
|
|
22
22
|
onDidChangeStackFrame: IEvent<void>;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
18
18
|
import { BaseWidget, LabelProvider, Message, OpenerService, Widget } from '@theia/core/lib/browser';
|
|
19
19
|
import { ArrayUtils } from '@theia/core/lib/common/types';
|
|
20
|
-
import { DebugProtocol } from 'vscode
|
|
20
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
21
21
|
import { InstructionBreakpoint } from '../breakpoint/breakpoint-marker';
|
|
22
22
|
import { BreakpointManager } from '../breakpoint/breakpoint-manager';
|
|
23
23
|
import { DebugSessionManager } from '../debug-session-manager';
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as React from '@theia/core/shared/react';
|
|
18
|
-
import
|
|
19
|
-
import { DebugProtocol } from 'vscode
|
|
18
|
+
import { createRoot, Root } from '@theia/core/shared/react-dom/client';
|
|
19
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
20
20
|
import { injectable, postConstruct, inject } from '@theia/core/shared/inversify';
|
|
21
21
|
import { Disposable, DisposableCollection, nls } from '@theia/core';
|
|
22
22
|
import URI from '@theia/core/lib/common/uri';
|
|
@@ -55,6 +55,7 @@ export class DebugBreakpointWidget implements Disposable {
|
|
|
55
55
|
protected readonly editorProvider: MonacoEditorProvider;
|
|
56
56
|
|
|
57
57
|
protected selectNode: HTMLDivElement;
|
|
58
|
+
protected selectNodeRoot: Root;
|
|
58
59
|
|
|
59
60
|
protected zone: MonacoEditorZoneWidget;
|
|
60
61
|
|
|
@@ -99,6 +100,8 @@ export class DebugBreakpointWidget implements Disposable {
|
|
|
99
100
|
const selectNode = this.selectNode = document.createElement('div');
|
|
100
101
|
selectNode.classList.add('theia-debug-breakpoint-select');
|
|
101
102
|
this.zone.containerNode.appendChild(selectNode);
|
|
103
|
+
this.selectNodeRoot = createRoot(this.selectNode);
|
|
104
|
+
this.toDispose.push(Disposable.create(() => this.selectNodeRoot.unmount()));
|
|
102
105
|
|
|
103
106
|
const inputNode = document.createElement('div');
|
|
104
107
|
inputNode.classList.add('theia-debug-breakpoint-input');
|
|
@@ -148,7 +151,6 @@ export class DebugBreakpointWidget implements Disposable {
|
|
|
148
151
|
this.zone.layout(heightInLines);
|
|
149
152
|
this.updatePlaceholder();
|
|
150
153
|
}));
|
|
151
|
-
this.toDispose.push(Disposable.create(() => ReactDOM.unmountComponentAtNode(selectNode)));
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
dispose(): void {
|
|
@@ -213,14 +215,14 @@ export class DebugBreakpointWidget implements Disposable {
|
|
|
213
215
|
if (this._input) {
|
|
214
216
|
this._input.getControl().setValue(this._values[this.context] || '');
|
|
215
217
|
}
|
|
216
|
-
|
|
218
|
+
this.selectNodeRoot.render(<SelectComponent
|
|
217
219
|
defaultValue={this.context} onChange={this.updateInput}
|
|
218
220
|
options={[
|
|
219
221
|
{ value: 'condition', label: nls.localizeByDefault('Expression') },
|
|
220
222
|
{ value: 'hitCondition', label: nls.localizeByDefault('Hit Count') },
|
|
221
223
|
{ value: 'logMessage', label: nls.localizeByDefault('Log Message') },
|
|
222
224
|
]}
|
|
223
|
-
|
|
225
|
+
/>);
|
|
224
226
|
}
|
|
225
227
|
|
|
226
228
|
protected readonly updateInput = (option: SelectOption) => {
|
|
@@ -32,7 +32,7 @@ import { DebugEditor } from './debug-editor';
|
|
|
32
32
|
import { DebugHoverWidget, createDebugHoverWidgetContainer } from './debug-hover-widget';
|
|
33
33
|
import { DebugBreakpointWidget } from './debug-breakpoint-widget';
|
|
34
34
|
import { DebugExceptionWidget } from './debug-exception-widget';
|
|
35
|
-
import { DebugProtocol } from 'vscode
|
|
35
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
36
36
|
import { DebugInlineValueDecorator, INLINE_VALUE_DECORATION_KEY } from './debug-inline-value-decorator';
|
|
37
37
|
|
|
38
38
|
export const DebugEditorModelFactory = Symbol('DebugEditorModelFactory');
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as React from '@theia/core/shared/react';
|
|
18
|
-
import
|
|
18
|
+
import { createRoot, Root } from '@theia/core/shared/react-dom/client';
|
|
19
19
|
import * as monaco from '@theia/monaco-editor-core';
|
|
20
20
|
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
21
21
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
@@ -54,6 +54,7 @@ export class DebugExceptionWidget implements Disposable {
|
|
|
54
54
|
readonly editor: DebugEditor;
|
|
55
55
|
|
|
56
56
|
protected zone: MonacoEditorZoneWidget;
|
|
57
|
+
protected containerNodeRoot: Root;
|
|
57
58
|
|
|
58
59
|
protected readonly toDispose = new DisposableCollection();
|
|
59
60
|
|
|
@@ -61,7 +62,8 @@ export class DebugExceptionWidget implements Disposable {
|
|
|
61
62
|
protected async init(): Promise<void> {
|
|
62
63
|
this.toDispose.push(this.zone = new DebugExceptionMonacoEditorZoneWidget(this.editor.getControl()));
|
|
63
64
|
this.zone.containerNode.classList.add('theia-debug-exception-widget');
|
|
64
|
-
this.
|
|
65
|
+
this.containerNodeRoot = createRoot(this.zone.containerNode);
|
|
66
|
+
this.toDispose.push(Disposable.create(() => this.containerNodeRoot.unmount()));
|
|
65
67
|
this.toDispose.push(this.editor.getControl().onDidLayoutChange(() => this.layout()));
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -94,14 +96,14 @@ export class DebugExceptionWidget implements Disposable {
|
|
|
94
96
|
const exceptionTitle = info.id ?
|
|
95
97
|
nls.localizeByDefault('Exception has occurred: {0}', info.id) :
|
|
96
98
|
nls.localizeByDefault('Exception has occurred.');
|
|
97
|
-
|
|
98
|
-
<div className='title'>
|
|
99
|
+
this.containerNodeRoot.render(<React.Fragment>
|
|
100
|
+
<div className='title' ref={cb}>
|
|
99
101
|
{exceptionTitle}
|
|
100
102
|
<span id="exception-close" className={codicon('close', true)} onClick={() => this.hide()} title={nls.localizeByDefault('Close')}></span>
|
|
101
103
|
</div>
|
|
102
104
|
{info.description && <div className='description'>{info.description}</div>}
|
|
103
105
|
{stackTrace && <div className='stack-trace'>{stackTrace}</div>}
|
|
104
|
-
</React.Fragment
|
|
106
|
+
</React.Fragment>);
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
protected layout(): void {
|
|
@@ -250,14 +250,15 @@ export class DebugHoverWidget extends SourceTreeWidget implements monaco.editor.
|
|
|
250
250
|
return undefined!;
|
|
251
251
|
}
|
|
252
252
|
const position = this.options && this.options.selection.getStartPosition();
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
253
|
+
return position
|
|
254
|
+
? {
|
|
255
|
+
position: new monaco.Position(position.lineNumber, position.column),
|
|
256
|
+
preference: [
|
|
257
|
+
monaco.editor.ContentWidgetPositionPreference.ABOVE,
|
|
258
|
+
monaco.editor.ContentWidgetPositionPreference.BELOW,
|
|
259
|
+
],
|
|
260
|
+
}
|
|
261
|
+
: undefined!;
|
|
261
262
|
}
|
|
262
263
|
|
|
263
264
|
protected override onUpdateRequest(msg: Message): void {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as React from '@theia/core/shared/react';
|
|
18
|
-
import { DebugProtocol } from 'vscode
|
|
18
|
+
import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol';
|
|
19
19
|
import URI from '@theia/core/lib/common/uri';
|
|
20
20
|
import { EditorManager } from '@theia/editor/lib/browser';
|
|
21
21
|
import { LabelProvider, DISABLED_CLASS } from '@theia/core/lib/browser';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as React from '@theia/core/shared/react';
|
|
18
|
-
import { DebugProtocol } from 'vscode
|
|
18
|
+
import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol';
|
|
19
19
|
import { RecursivePartial } from '@theia/core';
|
|
20
20
|
import URI from '@theia/core/lib/common/uri';
|
|
21
21
|
import { Range } from '@theia/editor/lib/browser';
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { LabelProvider } from '@theia/core/lib/browser';
|
|
18
18
|
import { EditorManager, EditorOpenerOptions, EditorWidget } from '@theia/editor/lib/browser';
|
|
19
19
|
import URI from '@theia/core/lib/common/uri';
|
|
20
|
-
import { DebugProtocol } from 'vscode
|
|
20
|
+
import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol';
|
|
21
21
|
import { DebugSession } from '../debug-session';
|
|
22
22
|
import { URI as Uri } from '@theia/core/shared/vscode-uri';
|
|
23
23
|
import { DEBUG_SCHEME, SCHEME_PATTERN } from '../../common/debug-uri-utils';
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
import * as React from '@theia/core/shared/react';
|
|
24
24
|
import { WidgetOpenerOptions, DISABLED_CLASS } from '@theia/core/lib/browser';
|
|
25
25
|
import { EditorWidget, Range, Position } from '@theia/editor/lib/browser';
|
|
26
|
-
import { DebugProtocol } from 'vscode
|
|
26
|
+
import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol';
|
|
27
27
|
import { TreeElement } from '@theia/core/lib/browser/source-tree';
|
|
28
28
|
import { DebugScope } from '../console/debug-console-items';
|
|
29
29
|
import { DebugSource } from './debug-source';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import * as React from '@theia/core/shared/react';
|
|
18
18
|
import { CancellationTokenSource, Emitter, Event } from '@theia/core';
|
|
19
|
-
import { DebugProtocol } from 'vscode
|
|
19
|
+
import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol';
|
|
20
20
|
import { TreeElement } from '@theia/core/lib/browser/source-tree';
|
|
21
21
|
import { DebugStackFrame } from './debug-stack-frame';
|
|
22
22
|
import { DebugSession } from '../debug-session';
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import URI from '@theia/core/lib/common/uri';
|
|
18
18
|
import * as React from '@theia/core/shared/react';
|
|
19
19
|
import { DebugConfigurationManager } from '../debug-configuration-manager';
|
|
20
|
-
import { DebugSessionOptions
|
|
20
|
+
import { DebugSessionOptions } from '../debug-session-options';
|
|
21
21
|
import { SelectComponent, SelectOption } from '@theia/core/lib/browser/widgets/select-component';
|
|
22
22
|
import { QuickInputService } from '@theia/core/lib/browser';
|
|
23
23
|
import { nls } from '@theia/core/lib/common/nls';
|
|
@@ -40,6 +40,7 @@ export class DebugConfigurationSelect extends React.Component<DebugConfiguration
|
|
|
40
40
|
protected static readonly PICK = '__PICK__';
|
|
41
41
|
protected static readonly NO_CONFIGURATION = '__NO_CONF__';
|
|
42
42
|
protected static readonly ADD_CONFIGURATION = '__ADD_CONF__';
|
|
43
|
+
protected static readonly CONFIG_MARKER = '__CONFIG__';
|
|
43
44
|
|
|
44
45
|
private readonly selectRef = React.createRef<SelectComponent>();
|
|
45
46
|
private manager: DebugConfigurationManager;
|
|
@@ -65,7 +66,7 @@ export class DebugConfigurationSelect extends React.Component<DebugConfiguration
|
|
|
65
66
|
override render(): React.ReactNode {
|
|
66
67
|
return <SelectComponent
|
|
67
68
|
options={this.renderOptions()}
|
|
68
|
-
defaultValue={this.currentValue}
|
|
69
|
+
defaultValue={this.state.currentValue}
|
|
69
70
|
onChange={option => this.setCurrentConfiguration(option)}
|
|
70
71
|
onFocus={() => this.refreshDebugConfigurations()}
|
|
71
72
|
onBlur={() => this.refreshDebugConfigurations()}
|
|
@@ -75,7 +76,26 @@ export class DebugConfigurationSelect extends React.Component<DebugConfiguration
|
|
|
75
76
|
|
|
76
77
|
protected get currentValue(): string {
|
|
77
78
|
const { current } = this.manager;
|
|
78
|
-
|
|
79
|
+
const matchingOption = this.getCurrentOption(current);
|
|
80
|
+
return matchingOption ? matchingOption.value! : current ? JSON.stringify(current) : DebugConfigurationSelect.NO_CONFIGURATION;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
protected getCurrentOption(current: DebugSessionOptions | undefined): SelectOption | undefined {
|
|
84
|
+
if (!current || !this.selectRef.current) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const matchingOption = this.selectRef.current!.options.find(option =>
|
|
88
|
+
option.userData === DebugConfigurationSelect.CONFIG_MARKER
|
|
89
|
+
&& this.matchesOption(JSON.parse(option.value!), current)
|
|
90
|
+
);
|
|
91
|
+
return matchingOption;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
protected matchesOption(sessionOption: DebugSessionOptions, current: DebugSessionOptions): boolean {
|
|
95
|
+
const matchesNameAndWorkspace = sessionOption.name === current.name && sessionOption.workspaceFolderUri === current.workspaceFolderUri;
|
|
96
|
+
return DebugSessionOptions.isConfiguration(sessionOption) && DebugSessionOptions.isConfiguration(current)
|
|
97
|
+
? matchesNameAndWorkspace && sessionOption.providerType === current.providerType
|
|
98
|
+
: matchesNameAndWorkspace;
|
|
79
99
|
}
|
|
80
100
|
|
|
81
101
|
protected readonly setCurrentConfiguration = (option: SelectOption) => {
|
|
@@ -88,12 +108,9 @@ export class DebugConfigurationSelect extends React.Component<DebugConfiguration
|
|
|
88
108
|
const providerType = this.parsePickValue(value);
|
|
89
109
|
this.selectDynamicConfigFromQuickPick(providerType);
|
|
90
110
|
} else {
|
|
91
|
-
const
|
|
92
|
-
this.manager.current =
|
|
93
|
-
|
|
94
|
-
workspaceFolderUri,
|
|
95
|
-
providerType === 'undefined' ? undefined : providerType
|
|
96
|
-
);
|
|
111
|
+
const data = JSON.parse(value) as DebugSessionOptions;
|
|
112
|
+
this.manager.current = data;
|
|
113
|
+
this.refreshDebugConfigurations();
|
|
97
114
|
}
|
|
98
115
|
};
|
|
99
116
|
|
|
@@ -151,13 +168,15 @@ export class DebugConfigurationSelect extends React.Component<DebugConfiguration
|
|
|
151
168
|
protected refreshDebugConfigurations = async () => {
|
|
152
169
|
const configsPerType = await this.manager.provideDynamicDebugConfigurations();
|
|
153
170
|
const providerTypes = [];
|
|
154
|
-
for (const [
|
|
171
|
+
for (const [type, configurations] of Object.entries(configsPerType)) {
|
|
155
172
|
if (configurations.length > 0) {
|
|
156
173
|
providerTypes.push(type);
|
|
157
174
|
}
|
|
158
175
|
}
|
|
159
|
-
|
|
160
|
-
|
|
176
|
+
|
|
177
|
+
const value = this.currentValue;
|
|
178
|
+
this.selectRef.current!.value = value;
|
|
179
|
+
this.setState({ providerTypes, currentValue: value });
|
|
161
180
|
};
|
|
162
181
|
|
|
163
182
|
protected renderOptions(): SelectOption[] {
|
|
@@ -165,10 +184,11 @@ export class DebugConfigurationSelect extends React.Component<DebugConfiguration
|
|
|
165
184
|
|
|
166
185
|
// Add non dynamic debug configurations
|
|
167
186
|
for (const config of this.manager.all) {
|
|
168
|
-
const value =
|
|
187
|
+
const value = JSON.stringify(config);
|
|
169
188
|
options.push({
|
|
170
189
|
value,
|
|
171
|
-
label: this.toName(config, this.props.isMultiRoot)
|
|
190
|
+
label: this.toName(config, this.props.isMultiRoot),
|
|
191
|
+
userData: DebugConfigurationSelect.CONFIG_MARKER
|
|
172
192
|
});
|
|
173
193
|
}
|
|
174
194
|
|
|
@@ -181,10 +201,11 @@ export class DebugConfigurationSelect extends React.Component<DebugConfiguration
|
|
|
181
201
|
});
|
|
182
202
|
}
|
|
183
203
|
for (const dynamicOption of recentDynamicOptions) {
|
|
184
|
-
const value =
|
|
204
|
+
const value = JSON.stringify(dynamicOption);
|
|
185
205
|
options.push({
|
|
186
206
|
value,
|
|
187
|
-
label: this.toName(dynamicOption, this.props.isMultiRoot) + ' (' + dynamicOption.providerType + ')'
|
|
207
|
+
label: this.toName(dynamicOption, this.props.isMultiRoot) + ' (' + dynamicOption.providerType + ')',
|
|
208
|
+
userData: DebugConfigurationSelect.CONFIG_MARKER
|
|
188
209
|
});
|
|
189
210
|
}
|
|
190
211
|
}
|
|
@@ -225,10 +246,11 @@ export class DebugConfigurationSelect extends React.Component<DebugConfiguration
|
|
|
225
246
|
return options;
|
|
226
247
|
}
|
|
227
248
|
|
|
228
|
-
protected toName(
|
|
229
|
-
|
|
230
|
-
|
|
249
|
+
protected toName(options: DebugSessionOptions, multiRoot: boolean): string {
|
|
250
|
+
const name = options.configuration?.name ?? options.name;
|
|
251
|
+
if (!options.workspaceFolderUri || !multiRoot) {
|
|
252
|
+
return name;
|
|
231
253
|
}
|
|
232
|
-
return `${
|
|
254
|
+
return `${name} (${new URI(options.workspaceFolderUri).path.base})`;
|
|
233
255
|
}
|
|
234
256
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { ReactWidget, QuickInputService } from '@theia/core/lib/browser';
|
|
18
|
-
import { CommandRegistry, Disposable, MessageService } from '@theia/core/lib/common';
|
|
18
|
+
import { CommandRegistry, Disposable, DisposableCollection, MessageService } from '@theia/core/lib/common';
|
|
19
19
|
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
20
20
|
import * as React from '@theia/core/shared/react';
|
|
21
21
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
@@ -55,6 +55,8 @@ export class DebugConfigurationWidget extends ReactWidget {
|
|
|
55
55
|
@inject(MessageService)
|
|
56
56
|
protected readonly messageService: MessageService;
|
|
57
57
|
|
|
58
|
+
protected readonly onRender = new DisposableCollection();
|
|
59
|
+
|
|
58
60
|
@postConstruct()
|
|
59
61
|
protected init(): void {
|
|
60
62
|
this.addClass('debug-toolbar');
|
|
@@ -80,7 +82,10 @@ export class DebugConfigurationWidget extends ReactWidget {
|
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
protected stepRef: DebugAction | undefined;
|
|
83
|
-
protected setStepRef = (stepRef: DebugAction | null) =>
|
|
85
|
+
protected setStepRef = (stepRef: DebugAction | null) => {
|
|
86
|
+
this.stepRef = stepRef || undefined;
|
|
87
|
+
this.onRender.dispose();
|
|
88
|
+
};
|
|
84
89
|
|
|
85
90
|
render(): React.ReactNode {
|
|
86
91
|
return <React.Fragment>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import * as React from '@theia/core/shared/react';
|
|
18
18
|
import { inject, postConstruct, injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import { Disposable, MenuPath } from '@theia/core';
|
|
19
|
+
import { Disposable, DisposableCollection, MenuPath } from '@theia/core';
|
|
20
20
|
import { ReactWidget } from '@theia/core/lib/browser/widgets';
|
|
21
21
|
import { DebugViewModel } from './debug-view-model';
|
|
22
22
|
import { DebugState } from '../debug-session';
|
|
@@ -31,6 +31,8 @@ export class DebugToolBar extends ReactWidget {
|
|
|
31
31
|
@inject(DebugViewModel)
|
|
32
32
|
protected readonly model: DebugViewModel;
|
|
33
33
|
|
|
34
|
+
protected readonly onRender = new DisposableCollection();
|
|
35
|
+
|
|
34
36
|
@postConstruct()
|
|
35
37
|
protected init(): void {
|
|
36
38
|
this.id = 'debug:toolbar:' + this.model.id;
|
|
@@ -55,7 +57,10 @@ export class DebugToolBar extends ReactWidget {
|
|
|
55
57
|
return true;
|
|
56
58
|
}
|
|
57
59
|
protected stepRef: DebugAction | undefined;
|
|
58
|
-
protected setStepRef = (stepRef: DebugAction | null) =>
|
|
60
|
+
protected setStepRef = (stepRef: DebugAction | null) => {
|
|
61
|
+
this.stepRef = stepRef || undefined;
|
|
62
|
+
this.onRender.dispose();
|
|
63
|
+
};
|
|
59
64
|
|
|
60
65
|
protected render(): React.ReactNode {
|
|
61
66
|
const { state } = this.model;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import * as React from '@theia/core/shared/react';
|
|
18
18
|
import { SingleTextInputDialog } from '@theia/core/lib/browser/dialogs';
|
|
19
19
|
import { ExpressionItem, DebugSessionProvider } from '../console/debug-console-items';
|
|
20
|
-
import { DebugProtocol } from 'vscode
|
|
20
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
21
21
|
|
|
22
22
|
export class DebugWatchExpression extends ExpressionItem {
|
|
23
23
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2022 EclipseSource 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
|
+
|
|
17
|
+
import { TaskIdentifier } from '@theia/task/lib/common';
|
|
18
|
+
|
|
19
|
+
export const defaultCompound: DebugCompound = { name: 'Compound', configurations: [] };
|
|
20
|
+
|
|
21
|
+
export interface DebugCompound {
|
|
22
|
+
name: string;
|
|
23
|
+
stopAll?: boolean;
|
|
24
|
+
preLaunchTask?: string | TaskIdentifier;
|
|
25
|
+
configurations: (string | { name: string, folder: string })[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export namespace DebugCompound {
|
|
29
|
+
export function is(arg: unknown): arg is DebugCompound {
|
|
30
|
+
return !!arg && typeof arg === 'object' && 'name' in arg && 'configurations' in arg;
|
|
31
|
+
}
|
|
32
|
+
}
|