@opensumi/ide-debug 2.23.5-rc-1681808681.0 → 2.23.5
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 +0 -2
- package/lib/browser/breakpoint/breakpoint-marker.d.ts.map +1 -1
- package/lib/browser/breakpoint/breakpoint-marker.js +1 -4
- package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -1
- package/lib/browser/debug-contribution.js +2 -2
- package/lib/browser/debug-contribution.js.map +1 -1
- package/lib/browser/model/debug-stack-frame.d.ts +0 -12
- package/lib/browser/model/debug-stack-frame.d.ts.map +1 -1
- package/lib/browser/model/debug-stack-frame.js +1 -27
- package/lib/browser/model/debug-stack-frame.js.map +1 -1
- package/lib/browser/model/debug-thread.d.ts.map +1 -1
- package/lib/browser/model/debug-thread.js +4 -6
- package/lib/browser/model/debug-thread.js.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.module.less +5 -6
- package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts +3 -8
- package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js +33 -79
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts +1 -2
- package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.view.js +12 -69
- package/lib/browser/view/breakpoints/debug-breakpoints.view.js.map +1 -1
- package/lib/browser/view/configuration/debug-configuration.module.less +4 -10
- package/lib/browser/view/configuration/debug-configuration.view.d.ts +1 -9
- package/lib/browser/view/configuration/debug-configuration.view.d.ts.map +1 -1
- package/lib/browser/view/configuration/debug-configuration.view.js +8 -16
- package/lib/browser/view/configuration/debug-configuration.view.js.map +1 -1
- package/lib/browser/view/configuration/debug-toolbar.view.d.ts +0 -5
- package/lib/browser/view/configuration/debug-toolbar.view.d.ts.map +1 -1
- package/lib/browser/view/configuration/debug-toolbar.view.js +1 -5
- package/lib/browser/view/configuration/debug-toolbar.view.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts +0 -1
- package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-frame.view.js +26 -136
- package/lib/browser/view/frames/debug-call-stack-frame.view.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-session.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-session.view.js +10 -17
- package/lib/browser/view/frames/debug-call-stack-session.view.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts +0 -1
- package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-thread.view.js +7 -10
- package/lib/browser/view/frames/debug-call-stack-thread.view.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack.module.less +2 -1
- package/package.json +23 -23
- package/src/browser/breakpoint/breakpoint-marker.ts +1 -3
- package/src/browser/debug-contribution.ts +3 -3
- package/src/browser/model/debug-stack-frame.ts +2 -28
- package/src/browser/model/debug-thread.ts +4 -6
- package/src/browser/view/breakpoints/debug-breakpoints.module.less +5 -6
- package/src/browser/view/breakpoints/debug-breakpoints.service.ts +31 -80
- package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +23 -120
- package/src/browser/view/configuration/debug-configuration.module.less +4 -10
- package/src/browser/view/configuration/debug-configuration.view.tsx +20 -36
- package/src/browser/view/configuration/debug-toolbar.view.tsx +5 -10
- package/src/browser/view/frames/debug-call-stack-frame.view.tsx +51 -184
- package/src/browser/view/frames/debug-call-stack-session.view.tsx +15 -29
- package/src/browser/view/frames/debug-call-stack-thread.view.tsx +8 -14
- package/src/browser/view/frames/debug-call-stack.module.less +2 -1
- package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.d.ts +0 -14
- package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.d.ts.map +0 -1
- package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.js +0 -28
- package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.js.map +0 -1
- package/src/browser/view/breakpoints/debug-breakpoints-tree.model.ts +0 -35
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IRange } from '@opensumi/ide-core-browser';
|
|
2
2
|
import { IResourceOpenOptions } from '@opensumi/ide-editor';
|
|
3
3
|
import { Range } from '@opensumi/monaco-editor-core/esm/vs/editor/common/core/range';
|
|
4
4
|
import { DebugProtocol } from '@opensumi/vscode-debugprotocol/lib/debugProtocol';
|
|
@@ -9,15 +9,12 @@ import { DebugScope, ExpressionContainer } from '../tree/debug-tree-node.define'
|
|
|
9
9
|
import { DebugSource } from './debug-source';
|
|
10
10
|
import { DebugThread } from './debug-thread';
|
|
11
11
|
|
|
12
|
+
|
|
12
13
|
export class DebugStackFrameData {
|
|
13
14
|
readonly raw: DebugProtocol.StackFrame;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export class DebugStackFrame extends DebugStackFrameData {
|
|
17
|
-
public static is(frame: any): frame is DebugStackFrame {
|
|
18
|
-
return !!frame && 'raw' in frame;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
18
|
constructor(readonly thread: DebugThread, readonly session: DebugSession) {
|
|
22
19
|
super();
|
|
23
20
|
}
|
|
@@ -112,26 +109,3 @@ export class DebugStackFrame extends DebugStackFrameData {
|
|
|
112
109
|
return scopesContainingRange.length ? scopesContainingRange : nonExpensiveScopes;
|
|
113
110
|
}
|
|
114
111
|
}
|
|
115
|
-
|
|
116
|
-
export class ShowMoreDebugStackFrame {
|
|
117
|
-
constructor(
|
|
118
|
-
// `undefined` 说明已经在末尾
|
|
119
|
-
public readonly nextFrame: DebugStackFrame | undefined,
|
|
120
|
-
public readonly frames: DebugStackFrame[],
|
|
121
|
-
readonly session: DebugSession,
|
|
122
|
-
readonly origin: string,
|
|
123
|
-
readonly _open: (showMoreFrame: ShowMoreDebugStackFrame) => void,
|
|
124
|
-
) {}
|
|
125
|
-
|
|
126
|
-
get name() {
|
|
127
|
-
return formatLocalize('debug.stack.showMoreAndOrigin', this.frames.length, this.origin);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
get id(): string {
|
|
131
|
-
return `${this.session.id}:showMore:${this.nextFrame?.id}`;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
open = () => {
|
|
135
|
-
this._open(this);
|
|
136
|
-
};
|
|
137
|
-
}
|
|
@@ -158,12 +158,10 @@ export class DebugThread extends DebugThreadData {
|
|
|
158
158
|
const result = new Map<number, DebugStackFrame>(this._frames);
|
|
159
159
|
for (const raw of frames) {
|
|
160
160
|
const id = raw.id;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
result.set(id, frame);
|
|
166
|
-
}
|
|
161
|
+
const frame = this._frames.get(id) || new DebugStackFrame(this, this.session);
|
|
162
|
+
this._frames.set(id, frame);
|
|
163
|
+
frame.update({ raw });
|
|
164
|
+
result.set(id, frame);
|
|
167
165
|
}
|
|
168
166
|
const values = [...result.values()];
|
|
169
167
|
frontEndTime('doUpdateFrames');
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
pointer-events: none;
|
|
22
22
|
}
|
|
23
23
|
&:hover {
|
|
24
|
+
background: var(--list-hoverBackground);
|
|
25
|
+
color: var(--list-hoverForeground);
|
|
24
26
|
.debug_remove_breakpoints_icon {
|
|
25
27
|
display: inline-block;
|
|
26
28
|
pointer-events: all;
|
|
@@ -40,7 +42,6 @@
|
|
|
40
42
|
width: 19px;
|
|
41
43
|
height: 19px;
|
|
42
44
|
min-width: 19px;
|
|
43
|
-
margin-right: 3px;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
.debug_breakpoints_badge {
|
|
@@ -50,7 +51,9 @@
|
|
|
50
51
|
|
|
51
52
|
.debug_breakpoints_description {
|
|
52
53
|
display: block;
|
|
53
|
-
|
|
54
|
+
transform: scale(0.95);
|
|
55
|
+
opacity: 0.7;
|
|
56
|
+
margin-left: 5px;
|
|
54
57
|
display: inline;
|
|
55
58
|
}
|
|
56
59
|
|
|
@@ -66,7 +69,3 @@
|
|
|
66
69
|
margin-right: 5px;
|
|
67
70
|
flex: 1;
|
|
68
71
|
}
|
|
69
|
-
|
|
70
|
-
.debug_breakpoints_item_tree_node {
|
|
71
|
-
padding-left: 27px !important;
|
|
72
|
-
}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { observable, action, runInAction } from 'mobx';
|
|
2
2
|
|
|
3
3
|
import { Injectable, Autowired } from '@opensumi/di';
|
|
4
|
-
import {
|
|
5
|
-
URI,
|
|
6
|
-
WithEventBus,
|
|
7
|
-
OnEvent,
|
|
8
|
-
IContextKeyService,
|
|
9
|
-
IReporterService,
|
|
10
|
-
Schemes,
|
|
11
|
-
Emitter,
|
|
12
|
-
Event,
|
|
13
|
-
} from '@opensumi/ide-core-browser';
|
|
4
|
+
import { URI, WithEventBus, OnEvent, IContextKeyService, IReporterService, Schemes } from '@opensumi/ide-core-browser';
|
|
14
5
|
import { LabelService } from '@opensumi/ide-core-browser/lib/services';
|
|
15
6
|
import { ICodeEditor, EditorCollectionService, getSimpleEditorOptions } from '@opensumi/ide-editor';
|
|
16
7
|
import { IEditorDocumentModelService } from '@opensumi/ide-editor/lib/browser';
|
|
@@ -25,12 +16,10 @@ import {
|
|
|
25
16
|
isDebugExceptionBreakpoint,
|
|
26
17
|
BreakpointManager,
|
|
27
18
|
DebugDecorator,
|
|
28
|
-
EXCEPTION_BREAKPOINT_URI,
|
|
29
19
|
} from '../../breakpoint';
|
|
30
20
|
import { DebugSessionManager } from '../../debug-session-manager';
|
|
31
21
|
import { DebugViewModel } from '../debug-view-model';
|
|
32
22
|
|
|
33
|
-
import { BreakpointsTreeNode } from './debug-breakpoints-tree.model';
|
|
34
23
|
import { BreakpointItem } from './debug-breakpoints.view';
|
|
35
24
|
|
|
36
25
|
@Injectable()
|
|
@@ -62,17 +51,14 @@ export class DebugBreakpointsService extends WithEventBus {
|
|
|
62
51
|
@Autowired(IEditorDocumentModelService)
|
|
63
52
|
protected readonly documentService: IEditorDocumentModelService;
|
|
64
53
|
|
|
65
|
-
private readonly _onDidChangeBreakpointsTreeNode = new Emitter<Map<string, BreakpointsTreeNode[]>>();
|
|
66
|
-
readonly onDidChangeBreakpointsTreeNode: Event<Map<string, BreakpointsTreeNode[]>> =
|
|
67
|
-
this._onDidChangeBreakpointsTreeNode.event;
|
|
68
|
-
|
|
69
54
|
private _inputEditor: ICodeEditor;
|
|
70
55
|
|
|
71
56
|
public get inputEditor(): ICodeEditor {
|
|
72
57
|
return this._inputEditor;
|
|
73
58
|
}
|
|
74
59
|
|
|
75
|
-
|
|
60
|
+
@observable
|
|
61
|
+
public nodes: BreakpointItem[] = [];
|
|
76
62
|
|
|
77
63
|
@observable
|
|
78
64
|
public enable: boolean;
|
|
@@ -89,6 +75,7 @@ export class DebugBreakpointsService extends WithEventBus {
|
|
|
89
75
|
|
|
90
76
|
async init() {
|
|
91
77
|
await this.updateRoots();
|
|
78
|
+
await this.updateBreakpoints();
|
|
92
79
|
this.workspaceService.onWorkspaceChanged(async () => {
|
|
93
80
|
this.updateRoots();
|
|
94
81
|
this.updateBreakpoints();
|
|
@@ -99,9 +86,6 @@ export class DebugBreakpointsService extends WithEventBus {
|
|
|
99
86
|
this.breakpoints.onDidChangeExceptionsBreakpoints(() => {
|
|
100
87
|
this.updateBreakpoints();
|
|
101
88
|
});
|
|
102
|
-
this.breakpoints.whenReady.then(() => {
|
|
103
|
-
this.updateBreakpoints();
|
|
104
|
-
});
|
|
105
89
|
this.contextKeyService.onDidChangeContext((e) => {
|
|
106
90
|
if (e.payload.affectsSome(new Set([CONTEXT_IN_DEBUG_MODE_KEY]))) {
|
|
107
91
|
runInAction(() => {
|
|
@@ -155,71 +139,38 @@ export class DebugBreakpointsService extends WithEventBus {
|
|
|
155
139
|
}
|
|
156
140
|
}
|
|
157
141
|
|
|
158
|
-
extractNodes(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
142
|
+
extractNodes(items: (DebugExceptionBreakpoint | IDebugBreakpoint)[]) {
|
|
143
|
+
const nodes: BreakpointItem[] = [];
|
|
144
|
+
items.forEach((item) => {
|
|
145
|
+
if (isDebugBreakpoint(item)) {
|
|
146
|
+
const uri = URI.parse(item.uri);
|
|
147
|
+
const parent = this.roots.filter((root) => root.isEqualOrParent(uri))[0];
|
|
148
|
+
nodes.push({
|
|
149
|
+
id: item.id,
|
|
150
|
+
name: uri.displayName,
|
|
151
|
+
description: parent && parent.relative(uri)!.toString(),
|
|
152
|
+
breakpoint: item,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (isDebugExceptionBreakpoint(item)) {
|
|
156
|
+
nodes.push({
|
|
157
|
+
id: item.filter,
|
|
158
|
+
name: item.label,
|
|
159
|
+
description: '',
|
|
160
|
+
breakpoint: item,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return nodes;
|
|
177
165
|
}
|
|
178
166
|
|
|
179
167
|
@action
|
|
180
168
|
private async updateBreakpoints() {
|
|
181
169
|
await this.breakpoints.whenReady;
|
|
182
|
-
this.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
allBreakpoints.forEach((item) => {
|
|
187
|
-
const extractNode = this.extractNodes(item);
|
|
188
|
-
if (extractNode) {
|
|
189
|
-
const uri = isDebugBreakpoint(item) ? URI.parse(item.uri) : EXCEPTION_BREAKPOINT_URI;
|
|
190
|
-
const getTreeNodes = this.treeNodeMap.get(uri.toString()) || [];
|
|
191
|
-
getTreeNodes.push(new BreakpointsTreeNode(uri, extractNode));
|
|
192
|
-
this.treeNodeMap.set(uri.toString(), getTreeNodes);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
this._onDidChangeBreakpointsTreeNode.fire(this.treeNodeMap);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
private async getDocumentModelRef(uri: URI) {
|
|
199
|
-
const document = this.documentService.getModelReference(uri);
|
|
200
|
-
if (!document) {
|
|
201
|
-
return this.documentService.createModelReference(uri);
|
|
202
|
-
}
|
|
203
|
-
return document;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
public async refreshBreakpointsInfo() {
|
|
207
|
-
const treeNodeValues = this.treeNodeMap.values();
|
|
208
|
-
const allTreeNodes: BreakpointsTreeNode[] = Array.from(treeNodeValues).reduce((acc, cur) => acc.concat(cur), []);
|
|
209
|
-
|
|
210
|
-
for await (const node of allTreeNodes) {
|
|
211
|
-
const { rawData, uri } = node;
|
|
212
|
-
if (isDebugBreakpoint(rawData.breakpoint)) {
|
|
213
|
-
const line = rawData.breakpoint.raw.line;
|
|
214
|
-
const monacoModel = await this.getDocumentModelRef(uri);
|
|
215
|
-
if (!monacoModel) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
const getContent = monacoModel.instance.getMonacoModel().getLineContent(line);
|
|
220
|
-
node.fireDescriptionChange(getContent.trim());
|
|
221
|
-
}
|
|
222
|
-
}
|
|
170
|
+
this.nodes = this.extractNodes([
|
|
171
|
+
...this.breakpoints.getExceptionBreakpoints(),
|
|
172
|
+
...this.breakpoints.getBreakpoints(),
|
|
173
|
+
]);
|
|
223
174
|
}
|
|
224
175
|
|
|
225
176
|
removeAllBreakpoints() {
|
|
@@ -1,34 +1,16 @@
|
|
|
1
1
|
import cls from 'classnames';
|
|
2
2
|
import { observer } from 'mobx-react-lite';
|
|
3
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { Badge } from '@opensumi/ide-components';
|
|
7
|
-
import {
|
|
8
|
-
useInjectable,
|
|
9
|
-
CommandService,
|
|
10
|
-
EDITOR_COMMANDS,
|
|
11
|
-
URI,
|
|
12
|
-
getIcon,
|
|
13
|
-
Disposable,
|
|
14
|
-
ViewState,
|
|
15
|
-
Event,
|
|
16
|
-
isUndefined,
|
|
17
|
-
} from '@opensumi/ide-core-browser';
|
|
5
|
+
import { CheckBox } from '@opensumi/ide-components';
|
|
6
|
+
import { Badge, RecycleList } from '@opensumi/ide-components';
|
|
7
|
+
import { useInjectable, ViewState, CommandService, EDITOR_COMMANDS, URI, getIcon } from '@opensumi/ide-core-browser';
|
|
18
8
|
import { DebugProtocol } from '@opensumi/vscode-debugprotocol/lib/debugProtocol';
|
|
19
9
|
|
|
20
10
|
import { IDebugBreakpoint, IDebugSessionManager, ISourceBreakpoint } from '../../../common';
|
|
21
|
-
import {
|
|
22
|
-
DebugExceptionBreakpoint,
|
|
23
|
-
isDebugBreakpoint,
|
|
24
|
-
isRuntimeBreakpoint,
|
|
25
|
-
getStatus,
|
|
26
|
-
isDebugExceptionBreakpoint,
|
|
27
|
-
EXCEPTION_BREAKPOINT_URI,
|
|
28
|
-
} from '../../breakpoint';
|
|
11
|
+
import { DebugExceptionBreakpoint, isDebugBreakpoint, isRuntimeBreakpoint, getStatus } from '../../breakpoint';
|
|
29
12
|
import { DebugSessionManager } from '../../debug-session-manager';
|
|
30
13
|
|
|
31
|
-
import { BreakpointsTreeNode } from './debug-breakpoints-tree.model';
|
|
32
14
|
import styles from './debug-breakpoints.module.less';
|
|
33
15
|
import { DebugBreakpointsService } from './debug-breakpoints.service';
|
|
34
16
|
|
|
@@ -36,101 +18,29 @@ export interface BreakpointItem {
|
|
|
36
18
|
name: string;
|
|
37
19
|
id: string;
|
|
38
20
|
description: string;
|
|
39
|
-
onDescriptionChange: Event<string>;
|
|
40
21
|
breakpoint: IDebugBreakpoint | DebugExceptionBreakpoint;
|
|
41
22
|
}
|
|
42
23
|
|
|
43
24
|
export const DebugBreakpointView = observer(({ viewState }: React.PropsWithChildren<{ viewState: ViewState }>) => {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
nodes.forEach(([uri, items]) => {
|
|
54
|
-
const isException = EXCEPTION_BREAKPOINT_URI.toString() === uri;
|
|
55
|
-
if (isException) {
|
|
56
|
-
items.forEach((item) => {
|
|
57
|
-
breakpointTreeData.push({
|
|
58
|
-
label: '',
|
|
59
|
-
expandable: false,
|
|
60
|
-
children: [],
|
|
61
|
-
description: (
|
|
62
|
-
<BreakpointItem
|
|
63
|
-
toggle={() => toggleBreakpointEnable(item.breakpoint)}
|
|
64
|
-
breakpointEnabled={enable}
|
|
65
|
-
data={item.rawData}
|
|
66
|
-
isDebugMode={debugBreakpointsService.inDebugMode}
|
|
67
|
-
></BreakpointItem>
|
|
68
|
-
),
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
} else {
|
|
72
|
-
const toURI = URI.parse(uri);
|
|
73
|
-
const parent = roots.filter((root) => root.isEqualOrParent(toURI))[0];
|
|
74
|
-
|
|
75
|
-
breakpointTreeData.push({
|
|
76
|
-
label: parent ? parent.relative(toURI)?.toString() || '' : URI.parse(uri).displayName,
|
|
77
|
-
expandable: true,
|
|
78
|
-
iconClassName: getIcon('file-text'),
|
|
79
|
-
expanded: true,
|
|
80
|
-
children: items.map((item) => ({
|
|
81
|
-
...item,
|
|
82
|
-
label: '',
|
|
83
|
-
expandable: false,
|
|
84
|
-
description: (
|
|
85
|
-
<BreakpointItem
|
|
86
|
-
toggle={() => toggleBreakpointEnable(item.breakpoint)}
|
|
87
|
-
breakpointEnabled={enable}
|
|
88
|
-
data={item.rawData}
|
|
89
|
-
isDebugMode={debugBreakpointsService.inDebugMode}
|
|
90
|
-
></BreakpointItem>
|
|
91
|
-
),
|
|
92
|
-
})),
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
if (!isDisposed.current) {
|
|
97
|
-
setTreeData(breakpointTreeData);
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
[treeData],
|
|
25
|
+
const { nodes, enable, inDebugMode, toggleBreakpointEnable }: DebugBreakpointsService =
|
|
26
|
+
useInjectable(DebugBreakpointsService);
|
|
27
|
+
const template = ({ data }: { data: BreakpointItem }) => (
|
|
28
|
+
<BreakpointItem
|
|
29
|
+
toggle={() => toggleBreakpointEnable(data.breakpoint)}
|
|
30
|
+
breakpointEnabled={enable}
|
|
31
|
+
data={data}
|
|
32
|
+
isDebugMode={inDebugMode}
|
|
33
|
+
></BreakpointItem>
|
|
101
34
|
);
|
|
102
35
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
debugBreakpointsService.onDidChangeBreakpointsTreeNode((nodes: Map<string, BreakpointsTreeNode[]>) => {
|
|
108
|
-
updateTreeData(Array.from(nodes.entries()));
|
|
109
|
-
}),
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
return () => {
|
|
113
|
-
isDisposed.current = true;
|
|
114
|
-
dispose.dispose();
|
|
115
|
-
};
|
|
116
|
-
}, []);
|
|
36
|
+
const containerStyle = {
|
|
37
|
+
height: viewState.height,
|
|
38
|
+
width: viewState.width,
|
|
39
|
+
} as React.CSSProperties;
|
|
117
40
|
|
|
118
|
-
useEffect(() => {
|
|
119
|
-
if (treeData.length > 0) {
|
|
120
|
-
requestAnimationFrame(() => {
|
|
121
|
-
debugBreakpointsService.refreshBreakpointsInfo();
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}, [treeData]);
|
|
125
|
-
|
|
126
|
-
const getItemClassName = useCallback((item: ICompositeTreeNode) => {
|
|
127
|
-
if (!item.children && isUndefined((item as any).expandable)) {
|
|
128
|
-
return styles.debug_breakpoints_item_tree_node;
|
|
129
|
-
}
|
|
130
|
-
}, []);
|
|
131
41
|
return (
|
|
132
42
|
<div className={cls(styles.debug_breakpoints, !enable && styles.debug_breakpoints_disabled)}>
|
|
133
|
-
<
|
|
43
|
+
<RecycleList data={nodes} itemHeight={22} template={template} style={containerStyle} />
|
|
134
44
|
</div>
|
|
135
45
|
);
|
|
136
46
|
});
|
|
@@ -152,7 +62,6 @@ export const BreakpointItem = ({
|
|
|
152
62
|
const debugBreakpointsService = useInjectable<DebugBreakpointsService>(DebugBreakpointsService);
|
|
153
63
|
const [enabled, setEnabled] = React.useState<boolean>(defaultValue);
|
|
154
64
|
const [status, setStatus] = React.useState<DebugProtocol.Breakpoint | false | undefined>(undefined);
|
|
155
|
-
const [description, setDescription] = React.useState<string>(data.description);
|
|
156
65
|
|
|
157
66
|
const handleBreakpointChange = () => {
|
|
158
67
|
toggle();
|
|
@@ -189,8 +98,6 @@ export const BreakpointItem = ({
|
|
|
189
98
|
};
|
|
190
99
|
|
|
191
100
|
React.useEffect(() => {
|
|
192
|
-
const disposable = new Disposable();
|
|
193
|
-
|
|
194
101
|
const exec = () => {
|
|
195
102
|
if (isDebugBreakpoint(data.breakpoint) && isRuntimeBreakpoint(data.breakpoint)) {
|
|
196
103
|
const status = getStatus(data.breakpoint);
|
|
@@ -198,11 +105,9 @@ export const BreakpointItem = ({
|
|
|
198
105
|
}
|
|
199
106
|
};
|
|
200
107
|
|
|
201
|
-
disposable
|
|
108
|
+
const disposable = manager.onDidChangeActiveDebugSession(() => exec());
|
|
202
109
|
exec();
|
|
203
110
|
|
|
204
|
-
disposable.addDispose(data.onDescriptionChange(setDescription));
|
|
205
|
-
|
|
206
111
|
return () => {
|
|
207
112
|
setStatus(undefined);
|
|
208
113
|
disposable.dispose();
|
|
@@ -237,15 +142,13 @@ export const BreakpointItem = ({
|
|
|
237
142
|
debugBreakpointsService.delBreakpoint(data.breakpoint as IDebugBreakpoint);
|
|
238
143
|
};
|
|
239
144
|
|
|
240
|
-
const isExceptionBreakpoint = useMemo(() => isDebugExceptionBreakpoint(data.breakpoint), [data]);
|
|
241
|
-
|
|
242
145
|
return (
|
|
243
146
|
<div className={cls(styles.debug_breakpoints_item)}>
|
|
244
|
-
|
|
147
|
+
<div className={cls(converBreakpointClsState(), styles.debug_breakpoints_icon)}></div>
|
|
245
148
|
<CheckBox id={data.id} onChange={handleBreakpointChange} checked={enabled}></CheckBox>
|
|
246
149
|
<div className={styles.debug_breakpoints_wrapper} onClick={handleBreakpointClick}>
|
|
247
|
-
|
|
248
|
-
<span className={styles.debug_breakpoints_description}>{description}</span>
|
|
150
|
+
<span className={styles.debug_breakpoints_name}>{data.name}</span>
|
|
151
|
+
<span className={styles.debug_breakpoints_description}>{data.description}</span>
|
|
249
152
|
</div>
|
|
250
153
|
{isDebugBreakpoint(data.breakpoint) ? (
|
|
251
154
|
<>
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
@import '~@opensumi/ide-components/lib/style/mixins.less';
|
|
2
2
|
|
|
3
|
-
.debug_action_bar_internal {
|
|
4
|
-
padding: 0px 8px;
|
|
5
|
-
margin-bottom: 8px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
3
|
.debug_action_bar {
|
|
9
4
|
height: 28px;
|
|
10
5
|
display: flex;
|
|
11
6
|
align-items: center;
|
|
7
|
+
padding: 0px 8px;
|
|
8
|
+
margin-bottom: 8px;
|
|
12
9
|
justify-content: flex-start;
|
|
13
10
|
pointer-events: all;
|
|
14
11
|
overflow: hidden;
|
|
@@ -39,14 +36,11 @@
|
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
|
|
42
|
-
.debug_configuration_container {
|
|
43
|
-
padding-right: 8px;
|
|
44
|
-
margin-bottom: 8px;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
39
|
.debug_configuration_toolbar {
|
|
48
40
|
display: flex;
|
|
49
41
|
height: 28px;
|
|
42
|
+
padding-right: 8px;
|
|
43
|
+
margin-bottom: 8px;
|
|
50
44
|
align-items: center;
|
|
51
45
|
|
|
52
46
|
.debug_actions {
|
|
@@ -2,15 +2,15 @@ import cls from 'classnames';
|
|
|
2
2
|
import { observer } from 'mobx-react-lite';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Select, Option } from '@opensumi/ide-components';
|
|
6
|
+
import { useInjectable, localize, URI, AppConfig } from '@opensumi/ide-core-browser';
|
|
7
7
|
import { Select as NativeSelect } from '@opensumi/ide-core-browser/lib/components/select';
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
DEFAULT_ADD_CONFIGURATION_KEY,
|
|
11
|
+
DEFAULT_NO_CONFIGURATION_KEY,
|
|
11
12
|
DEFAULT_CONFIGURATION_INDEX_SEPARATOR,
|
|
12
13
|
DEFAULT_CONFIGURATION_NAME_SEPARATOR,
|
|
13
|
-
DEFAULT_NO_CONFIGURATION_KEY,
|
|
14
14
|
DebugSessionOptions,
|
|
15
15
|
} from '../../../common';
|
|
16
16
|
import { DebugAction } from '../../components';
|
|
@@ -198,26 +198,7 @@ export const DebugActionBar = React.memo(({ runDebug, openConfiguration, openDeb
|
|
|
198
198
|
</div>
|
|
199
199
|
));
|
|
200
200
|
|
|
201
|
-
export const
|
|
202
|
-
const { float } = useInjectable<DebugConfigurationService>(DebugConfigurationService);
|
|
203
|
-
|
|
204
|
-
return (
|
|
205
|
-
<>
|
|
206
|
-
<DebugControllerView className={styles.debug_configuration_container} />
|
|
207
|
-
{!float && <DebugToolbarView float={false} className={styles.debug_action_bar_internal} />}
|
|
208
|
-
</>
|
|
209
|
-
);
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
export interface DebugControllerViewProps {
|
|
213
|
-
className?: string;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* 该组件支持用户导入
|
|
218
|
-
* 后续如果有一些改动需要考虑是否有 breakchange
|
|
219
|
-
*/
|
|
220
|
-
export const DebugControllerView = observer((props: DebugControllerViewProps) => {
|
|
201
|
+
export const DebugConfigurationView = observer((props) => {
|
|
221
202
|
const {
|
|
222
203
|
configurationOptions,
|
|
223
204
|
toValue,
|
|
@@ -227,12 +208,12 @@ export const DebugControllerView = observer((props: DebugControllerViewProps) =>
|
|
|
227
208
|
openDebugConsole,
|
|
228
209
|
updateConfiguration,
|
|
229
210
|
start,
|
|
211
|
+
float,
|
|
230
212
|
isMultiRootWorkspace,
|
|
231
213
|
workspaceRoots,
|
|
232
214
|
} = useInjectable<DebugConfigurationService>(DebugConfigurationService);
|
|
233
215
|
const appConfig = useInjectable<AppConfig>(AppConfig);
|
|
234
216
|
const addConfigurationLabel = localize('debug.action.add.configuration');
|
|
235
|
-
|
|
236
217
|
const setCurrentConfiguration = React.useCallback((event: React.ChangeEvent<HTMLSelectElement> | string) => {
|
|
237
218
|
let value: React.ChangeEvent<HTMLSelectElement> | string;
|
|
238
219
|
if (typeof event === 'object') {
|
|
@@ -255,18 +236,21 @@ export const DebugControllerView = observer((props: DebugControllerViewProps) =>
|
|
|
255
236
|
}, []);
|
|
256
237
|
|
|
257
238
|
return (
|
|
258
|
-
<div
|
|
259
|
-
<
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
239
|
+
<div>
|
|
240
|
+
<div className={styles.debug_configuration_toolbar}>
|
|
241
|
+
<ConfigurationSelector
|
|
242
|
+
currentValue={currentValue}
|
|
243
|
+
options={configurationOptions}
|
|
244
|
+
onChangeConfiguration={setCurrentConfiguration}
|
|
245
|
+
isMultiRootWorkspace={isMultiRootWorkspace}
|
|
246
|
+
addConfigurationLabel={addConfigurationLabel}
|
|
247
|
+
toValue={toValue}
|
|
248
|
+
isElectronRenderer={appConfig.isElectronRenderer}
|
|
249
|
+
workspaceRoots={workspaceRoots}
|
|
250
|
+
/>
|
|
251
|
+
<DebugActionBar runDebug={start} openConfiguration={openConfiguration} openDebugConsole={openDebugConsole} />
|
|
252
|
+
</div>
|
|
253
|
+
{!float && <DebugToolbarView float={false} />}
|
|
270
254
|
</div>
|
|
271
255
|
);
|
|
272
256
|
});
|
|
@@ -7,13 +7,13 @@ import { Injectable } from '@opensumi/di';
|
|
|
7
7
|
import { Option, Select } from '@opensumi/ide-components';
|
|
8
8
|
import {
|
|
9
9
|
AppConfig,
|
|
10
|
-
DisposableCollection,
|
|
11
|
-
PreferenceService,
|
|
12
|
-
electronEnv,
|
|
13
10
|
getIcon,
|
|
14
|
-
isMacintosh,
|
|
15
11
|
localize,
|
|
12
|
+
PreferenceService,
|
|
16
13
|
useInjectable,
|
|
14
|
+
DisposableCollection,
|
|
15
|
+
electronEnv,
|
|
16
|
+
isMacintosh,
|
|
17
17
|
} from '@opensumi/ide-core-browser';
|
|
18
18
|
import { InlineMenuBar } from '@opensumi/ide-core-browser/lib/components/actions';
|
|
19
19
|
import { Select as NativeSelect } from '@opensumi/ide-core-browser/lib/components/select';
|
|
@@ -79,13 +79,8 @@ class FloatController {
|
|
|
79
79
|
|
|
80
80
|
export interface DebugToolbarViewProps {
|
|
81
81
|
float: boolean;
|
|
82
|
-
className?: string;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
/**
|
|
86
|
-
* 该组件支持用户导入
|
|
87
|
-
* 后续如果有一些改动需要考虑是否有 breakchange
|
|
88
|
-
*/
|
|
89
84
|
export const DebugToolbarView = observer((props: DebugToolbarViewProps) => {
|
|
90
85
|
const {
|
|
91
86
|
state,
|
|
@@ -226,7 +221,7 @@ export const DebugToolbarView = observer((props: DebugToolbarViewProps) => {
|
|
|
226
221
|
);
|
|
227
222
|
|
|
228
223
|
return (
|
|
229
|
-
<div className={
|
|
224
|
+
<div className={styles.debug_action_bar}>
|
|
230
225
|
{renderSelections(sessions.filter((s: DebugSession) => !s.parentSession))}
|
|
231
226
|
<div className={styles.debug_actions}>
|
|
232
227
|
{renderContinue(state)}
|