@opensumi/ide-debug 2.24.3 → 2.24.4
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-manager.d.ts +4 -3
- package/lib/browser/breakpoint/breakpoint-manager.d.ts.map +1 -1
- package/lib/browser/breakpoint/breakpoint-manager.js +7 -0
- package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
- package/lib/browser/contextkeys/debug-contextkey.service.d.ts +1 -0
- package/lib/browser/contextkeys/debug-contextkey.service.d.ts.map +1 -1
- package/lib/browser/contextkeys/debug-contextkey.service.js +2 -1
- package/lib/browser/contextkeys/debug-contextkey.service.js.map +1 -1
- package/lib/browser/debug-contribution.d.ts.map +1 -1
- package/lib/browser/debug-contribution.js +42 -4
- package/lib/browser/debug-contribution.js.map +1 -1
- package/lib/browser/debug-style.less +34 -5
- package/lib/browser/editor/debug-hover-model.d.ts +0 -3
- package/lib/browser/editor/debug-hover-model.d.ts.map +1 -1
- package/lib/browser/editor/debug-hover-model.js +0 -5
- package/lib/browser/editor/debug-hover-model.js.map +1 -1
- package/lib/browser/editor/debug-hover-tree.model.service.d.ts.map +1 -1
- package/lib/browser/editor/debug-hover-tree.model.service.js +0 -9
- package/lib/browser/editor/debug-hover-tree.model.service.js.map +1 -1
- package/lib/browser/editor/debug-model.d.ts +2 -0
- package/lib/browser/editor/debug-model.d.ts.map +1 -1
- package/lib/browser/editor/debug-model.js +31 -2
- package/lib/browser/editor/debug-model.js.map +1 -1
- package/lib/browser/editor/debug-styles.d.ts +1 -0
- package/lib/browser/editor/debug-styles.d.ts.map +1 -1
- package/lib/browser/editor/debug-styles.js +7 -1
- package/lib/browser/editor/debug-styles.js.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.module.less +64 -8
- package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts +10 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js +5 -0
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts +7 -0
- package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.view.js +80 -26
- package/lib/browser/view/breakpoints/debug-breakpoints.view.js.map +1 -1
- package/lib/browser/view/console/debug-console-model.d.ts +0 -3
- package/lib/browser/view/console/debug-console-model.d.ts.map +1 -1
- package/lib/browser/view/console/debug-console-model.js +0 -5
- package/lib/browser/view/console/debug-console-model.js.map +1 -1
- package/lib/browser/view/console/debug-console-tree.model.service.d.ts.map +1 -1
- package/lib/browser/view/console/debug-console-tree.model.service.js +0 -9
- package/lib/browser/view/console/debug-console-tree.model.service.js.map +1 -1
- package/lib/browser/view/variables/debug-variables-model.d.ts +0 -3
- package/lib/browser/view/variables/debug-variables-model.d.ts.map +1 -1
- package/lib/browser/view/variables/debug-variables-model.js +0 -5
- package/lib/browser/view/variables/debug-variables-model.js.map +1 -1
- package/lib/browser/view/variables/debug-variables-tree.model.service.d.ts.map +1 -1
- package/lib/browser/view/variables/debug-variables-tree.model.service.js +0 -9
- package/lib/browser/view/variables/debug-variables-tree.model.service.js.map +1 -1
- package/lib/browser/view/watch/debug-watch-model.d.ts +0 -3
- package/lib/browser/view/watch/debug-watch-model.d.ts.map +1 -1
- package/lib/browser/view/watch/debug-watch-model.js +0 -5
- package/lib/browser/view/watch/debug-watch-model.js.map +1 -1
- package/lib/browser/view/watch/debug-watch-tree.model.service.d.ts.map +1 -1
- package/lib/browser/view/watch/debug-watch-tree.model.service.js +0 -9
- package/lib/browser/view/watch/debug-watch-tree.model.service.js.map +1 -1
- package/lib/common/commands.d.ts +2 -0
- package/lib/common/commands.d.ts.map +1 -1
- package/lib/common/commands.js +6 -0
- package/lib/common/commands.js.map +1 -1
- package/lib/common/constants.d.ts +1 -0
- package/lib/common/constants.d.ts.map +1 -1
- package/lib/common/constants.js +2 -1
- package/lib/common/constants.js.map +1 -1
- package/package.json +23 -23
- package/src/browser/breakpoint/breakpoint-manager.ts +8 -3
- package/src/browser/contextkeys/debug-contextkey.service.ts +4 -1
- package/src/browser/debug-contribution.ts +47 -4
- package/src/browser/debug-style.less +34 -5
- package/src/browser/editor/debug-hover-model.ts +0 -6
- package/src/browser/editor/debug-hover-tree.model.service.ts +0 -10
- package/src/browser/editor/debug-model.ts +35 -3
- package/src/browser/editor/debug-styles.ts +7 -0
- package/src/browser/view/breakpoints/debug-breakpoints.module.less +64 -8
- package/src/browser/view/breakpoints/debug-breakpoints.service.ts +8 -0
- package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +139 -32
- package/src/browser/view/console/debug-console-model.ts +0 -6
- package/src/browser/view/console/debug-console-tree.model.service.ts +0 -10
- package/src/browser/view/variables/debug-variables-model.ts +0 -6
- package/src/browser/view/variables/debug-variables-tree.model.service.ts +0 -10
- package/src/browser/view/watch/debug-watch-model.ts +0 -6
- package/src/browser/view/watch/debug-watch-tree.model.service.ts +0 -10
- package/src/common/commands.ts +6 -0
- package/src/common/constants.ts +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cls from 'classnames';
|
|
2
2
|
import { observer } from 'mobx-react-lite';
|
|
3
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { BasicRecycleTree, CheckBox, IBasicTreeData } from '@opensumi/ide-components';
|
|
6
6
|
import { Badge } from '@opensumi/ide-components';
|
|
@@ -13,16 +13,23 @@ import {
|
|
|
13
13
|
Disposable,
|
|
14
14
|
ViewState,
|
|
15
15
|
Event,
|
|
16
|
+
isUndefined,
|
|
17
|
+
IRange,
|
|
18
|
+
localize,
|
|
16
19
|
} from '@opensumi/ide-core-browser';
|
|
20
|
+
import { getExternalIcon } from '@opensumi/ide-core-browser';
|
|
21
|
+
import { IResourceOpenOptions } from '@opensumi/ide-editor';
|
|
22
|
+
import * as monaco from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
|
|
17
23
|
import { DebugProtocol } from '@opensumi/vscode-debugprotocol/lib/debugProtocol';
|
|
18
24
|
|
|
19
|
-
import { IDebugBreakpoint, IDebugSessionManager, ISourceBreakpoint } from '../../../common';
|
|
25
|
+
import { DEBUG_COMMANDS, IDebugBreakpoint, IDebugSessionManager, ISourceBreakpoint } from '../../../common';
|
|
20
26
|
import {
|
|
21
27
|
DebugExceptionBreakpoint,
|
|
22
28
|
isDebugBreakpoint,
|
|
23
29
|
isRuntimeBreakpoint,
|
|
24
30
|
getStatus,
|
|
25
31
|
EXCEPTION_BREAKPOINT_URI,
|
|
32
|
+
BreakpointManager,
|
|
26
33
|
} from '../../breakpoint';
|
|
27
34
|
import { DebugSessionManager } from '../../debug-session-manager';
|
|
28
35
|
|
|
@@ -91,11 +98,19 @@ export const DebugBreakpointView = observer(({ viewState }: React.PropsWithChild
|
|
|
91
98
|
} else {
|
|
92
99
|
const toURI = URI.parse(uri);
|
|
93
100
|
const parent = roots.filter((root) => root.isEqualOrParent(toURI))[0];
|
|
101
|
+
const label = parent ? parent.relative(toURI)?.toString() || '' : URI.parse(uri).displayName;
|
|
102
|
+
const breakpointItems = items.map((item) => item.breakpoint as IDebugBreakpoint);
|
|
94
103
|
|
|
95
104
|
breakpointTreeData.push({
|
|
96
|
-
label
|
|
105
|
+
label,
|
|
106
|
+
renderLabel: (
|
|
107
|
+
<BreakpointFileItem
|
|
108
|
+
label={label}
|
|
109
|
+
breakpointItems={breakpointItems}
|
|
110
|
+
title={toURI.toString()}
|
|
111
|
+
></BreakpointFileItem>
|
|
112
|
+
),
|
|
97
113
|
expandable: true,
|
|
98
|
-
iconClassName: getIcon('file-text'),
|
|
99
114
|
expanded: true,
|
|
100
115
|
children: items.map((item) => ({
|
|
101
116
|
...item,
|
|
@@ -168,46 +183,114 @@ export const DebugBreakpointView = observer(({ viewState }: React.PropsWithChild
|
|
|
168
183
|
);
|
|
169
184
|
});
|
|
170
185
|
|
|
186
|
+
interface BreakpointFileItemProps {
|
|
187
|
+
label: string;
|
|
188
|
+
breakpointItems: IDebugBreakpoint[];
|
|
189
|
+
title?: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export const BreakpointFileItem = ({ label, title, breakpointItems }: BreakpointFileItemProps) => {
|
|
193
|
+
const debugBreakpointsService: DebugBreakpointsService = useInjectable(DebugBreakpointsService);
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* 只要断点列表有一个是启用的,那么就认为是启用状态
|
|
197
|
+
*/
|
|
198
|
+
const defaultEnabled = useMemo(() => breakpointItems.some((item) => item.enabled), [breakpointItems]);
|
|
199
|
+
const [enabled, setEnabled] = React.useState<boolean>(defaultEnabled);
|
|
200
|
+
|
|
201
|
+
const handleCheckBoxChange = useCallback(
|
|
202
|
+
(preEnabled: boolean) => {
|
|
203
|
+
const matchBreakpoints = breakpointItems.filter((item) => item.enabled === preEnabled);
|
|
204
|
+
matchBreakpoints.forEach((breakpoint) => {
|
|
205
|
+
debugBreakpointsService.toggleBreakpointEnable(breakpoint);
|
|
206
|
+
});
|
|
207
|
+
setEnabled(!enabled);
|
|
208
|
+
},
|
|
209
|
+
[enabled],
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
const removeBreakpoint = useCallback((event: React.MouseEvent) => {
|
|
213
|
+
event.stopPropagation();
|
|
214
|
+
breakpointItems.forEach((breakpoint) => {
|
|
215
|
+
debugBreakpointsService.delBreakpoint(breakpoint);
|
|
216
|
+
});
|
|
217
|
+
}, []);
|
|
218
|
+
|
|
219
|
+
return (
|
|
220
|
+
<div className={styles.debug_breakpoints_file_item}>
|
|
221
|
+
<div className={styles.file_item_control}>
|
|
222
|
+
<CheckBox
|
|
223
|
+
className={styles.file_item_checkbox}
|
|
224
|
+
onChange={() => handleCheckBoxChange(enabled)}
|
|
225
|
+
checked={enabled}
|
|
226
|
+
></CheckBox>
|
|
227
|
+
<i className={cls(getIcon('file-text'), styles.file_item_icon)}></i>
|
|
228
|
+
<span title={title}>{label}</span>
|
|
229
|
+
</div>
|
|
230
|
+
<div className={styles.file_item_control_right}>
|
|
231
|
+
<i className={cls(getIcon('close'), styles.close_icon)} onClick={(event) => removeBreakpoint(event)}></i>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
);
|
|
235
|
+
};
|
|
236
|
+
|
|
171
237
|
export const BreakpointItem = ({ data, toggle }: { data: BreakpointItem; toggle: () => void }) => {
|
|
172
238
|
const defaultValue = isDebugBreakpoint(data.breakpoint) ? data.breakpoint.enabled : !!data.breakpoint.default;
|
|
173
239
|
const manager = useInjectable<DebugSessionManager>(IDebugSessionManager);
|
|
240
|
+
const breakpointManager = useInjectable<BreakpointManager>(BreakpointManager);
|
|
174
241
|
const commandService = useInjectable<CommandService>(CommandService);
|
|
175
242
|
const debugBreakpointsService = useInjectable<DebugBreakpointsService>(DebugBreakpointsService);
|
|
176
243
|
const [enabled, setEnabled] = React.useState<boolean>(defaultValue);
|
|
177
244
|
const [status, setStatus] = React.useState<DebugProtocol.Breakpoint | false | undefined>(undefined);
|
|
178
245
|
const [description, setDescription] = React.useState<string>(data.description);
|
|
179
246
|
|
|
247
|
+
const openOptions = useMemo(() => {
|
|
248
|
+
const options: IResourceOpenOptions = {
|
|
249
|
+
preview: true,
|
|
250
|
+
focus: true,
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
if (!isDebugBreakpoint(data.breakpoint)) {
|
|
254
|
+
return options;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (status) {
|
|
258
|
+
options.range = {
|
|
259
|
+
startColumn: status.column || 0,
|
|
260
|
+
endColumn: status.column || 0,
|
|
261
|
+
startLineNumber: status.line,
|
|
262
|
+
endLineNumber: status.line,
|
|
263
|
+
};
|
|
264
|
+
} else {
|
|
265
|
+
const { raw } = data.breakpoint as IDebugBreakpoint;
|
|
266
|
+
options.range = {
|
|
267
|
+
startColumn: raw.column || 0,
|
|
268
|
+
endColumn: raw.column || 0,
|
|
269
|
+
startLineNumber: raw.line,
|
|
270
|
+
endLineNumber: raw.line,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return options;
|
|
275
|
+
}, [status, data.breakpoint]);
|
|
276
|
+
|
|
180
277
|
const handleBreakpointChange = () => {
|
|
181
278
|
toggle();
|
|
182
279
|
setEnabled(!enabled);
|
|
183
280
|
};
|
|
184
281
|
|
|
185
|
-
const handleBreakpointClick = () => {
|
|
282
|
+
const handleBreakpointClick = async () => {
|
|
186
283
|
if ((data.breakpoint as ISourceBreakpoint).uri) {
|
|
187
|
-
|
|
188
|
-
preview: true,
|
|
189
|
-
focus: true,
|
|
190
|
-
};
|
|
191
|
-
if (status) {
|
|
192
|
-
options['range'] = {
|
|
193
|
-
startColumn: status.column || 0,
|
|
194
|
-
endColumn: status.column || 0,
|
|
195
|
-
startLineNumber: status.line,
|
|
196
|
-
endLineNumber: status.line,
|
|
197
|
-
};
|
|
198
|
-
} else {
|
|
199
|
-
options['range'] = {
|
|
200
|
-
startColumn: (data.breakpoint as IDebugBreakpoint).raw.column || 0,
|
|
201
|
-
endColumn: (data.breakpoint as IDebugBreakpoint).raw.column || 0,
|
|
202
|
-
startLineNumber: (data.breakpoint as IDebugBreakpoint).raw.line,
|
|
203
|
-
endLineNumber: (data.breakpoint as IDebugBreakpoint).raw.line,
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
commandService.executeCommand(
|
|
284
|
+
await commandService.executeCommand(
|
|
207
285
|
EDITOR_COMMANDS.OPEN_RESOURCE.id,
|
|
208
286
|
new URI((data.breakpoint as ISourceBreakpoint).uri),
|
|
209
|
-
|
|
287
|
+
openOptions,
|
|
210
288
|
);
|
|
289
|
+
|
|
290
|
+
debugBreakpointsService.launchFocusedBreakpoints({
|
|
291
|
+
uri: new URI((data.breakpoint as ISourceBreakpoint).uri),
|
|
292
|
+
range: openOptions.range as IRange,
|
|
293
|
+
});
|
|
211
294
|
}
|
|
212
295
|
};
|
|
213
296
|
|
|
@@ -232,11 +315,26 @@ export const BreakpointItem = ({ data, toggle }: { data: BreakpointItem; toggle:
|
|
|
232
315
|
};
|
|
233
316
|
}, []);
|
|
234
317
|
|
|
235
|
-
const removeBreakpoint = (event: React.MouseEvent<
|
|
318
|
+
const removeBreakpoint = (event: React.MouseEvent<HTMLElement, MouseEvent>) => {
|
|
236
319
|
event.stopPropagation();
|
|
237
320
|
debugBreakpointsService.delBreakpoint(data.breakpoint as IDebugBreakpoint);
|
|
238
321
|
};
|
|
239
322
|
|
|
323
|
+
const editBreakpoint = async (event: React.MouseEvent<HTMLElement, MouseEvent>) => {
|
|
324
|
+
event.stopPropagation();
|
|
325
|
+
|
|
326
|
+
await commandService.executeCommand(
|
|
327
|
+
EDITOR_COMMANDS.OPEN_RESOURCE.id,
|
|
328
|
+
new URI((data.breakpoint as ISourceBreakpoint).uri),
|
|
329
|
+
openOptions,
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
const { range } = openOptions;
|
|
333
|
+
|
|
334
|
+
const position = new monaco.Position(range?.startLineNumber || 1, range?.startColumn || 1);
|
|
335
|
+
await commandService.executeCommand(DEBUG_COMMANDS.EDIT_BREAKPOINT.id, position);
|
|
336
|
+
};
|
|
337
|
+
|
|
240
338
|
return (
|
|
241
339
|
<div className={cls(styles.debug_breakpoints_item)}>
|
|
242
340
|
<CheckBox
|
|
@@ -251,11 +349,20 @@ export const BreakpointItem = ({ data, toggle }: { data: BreakpointItem; toggle:
|
|
|
251
349
|
</div>
|
|
252
350
|
{isDebugBreakpoint(data.breakpoint) ? (
|
|
253
351
|
<>
|
|
254
|
-
<
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
352
|
+
<div className={styles.debug_breakpoints_item_control}>
|
|
353
|
+
{openOptions.range && (
|
|
354
|
+
<i
|
|
355
|
+
title={localize('debug.menu.edit.breakpoint')}
|
|
356
|
+
onClick={(event) => editBreakpoint(event)}
|
|
357
|
+
className={cls(styles.debug_edit_breakpoints_icon, getExternalIcon('edit'))}
|
|
358
|
+
></i>
|
|
359
|
+
)}
|
|
360
|
+
<i
|
|
361
|
+
title={localize('debug.menu.delete.breakpoint')}
|
|
362
|
+
onClick={(event) => removeBreakpoint(event)}
|
|
363
|
+
className={cls(styles.debug_remove_breakpoints_icon, getIcon('close'))}
|
|
364
|
+
></i>
|
|
365
|
+
</div>
|
|
259
366
|
<Badge className={styles.debug_breakpoints_badge}>
|
|
260
367
|
{(data.breakpoint as IDebugBreakpoint).raw.line}
|
|
261
368
|
{!!data.breakpoint.raw.column && `:${data.breakpoint.raw.column}`}
|
|
@@ -9,7 +9,6 @@ export class DebugConsoleTreeModel extends TreeModel {
|
|
|
9
9
|
static DEFAULT_FLUSH_DELAY = 100;
|
|
10
10
|
|
|
11
11
|
private flushDispatchChangeDelayer = new ThrottledDelayer<void>(DebugConsoleTreeModel.DEFAULT_FLUSH_DELAY);
|
|
12
|
-
private onWillUpdateEmitter: Emitter<void> = new Emitter();
|
|
13
12
|
private _tempScrollOffset = 0;
|
|
14
13
|
|
|
15
14
|
constructor(@Optional() root: ExpressionContainer) {
|
|
@@ -17,10 +16,6 @@ export class DebugConsoleTreeModel extends TreeModel {
|
|
|
17
16
|
this.init(root);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
get onWillUpdate(): Event<void> {
|
|
21
|
-
return this.onWillUpdateEmitter.event;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
19
|
/**
|
|
25
20
|
* 判断是否滚动到了底部
|
|
26
21
|
* TODO: //临时处理 by @Ricbet
|
|
@@ -40,7 +35,6 @@ export class DebugConsoleTreeModel extends TreeModel {
|
|
|
40
35
|
this.flushDispatchChangeDelayer.cancel();
|
|
41
36
|
}
|
|
42
37
|
this.flushDispatchChangeDelayer.trigger(async () => {
|
|
43
|
-
await this.onWillUpdateEmitter.fireAndAwait();
|
|
44
38
|
this.dispatchChange();
|
|
45
39
|
});
|
|
46
40
|
});
|
|
@@ -251,16 +251,6 @@ export class DebugConsoleModelService implements IDebugConsoleModelService {
|
|
|
251
251
|
this.loadingDecoration.removeTarget(target);
|
|
252
252
|
}),
|
|
253
253
|
);
|
|
254
|
-
this.treeModelDisposableCollection.push(
|
|
255
|
-
this.treeModel.onWillUpdate(() => {
|
|
256
|
-
// 更新树前更新下选中节点
|
|
257
|
-
if (this.selectedNodes.length !== 0) {
|
|
258
|
-
// 仅处理一下单选情况
|
|
259
|
-
const node = this.treeModel?.root.getTreeNodeByPath(this.selectedNodes[0].path);
|
|
260
|
-
this.selectedDecoration.addTarget(node as ExpressionNode);
|
|
261
|
-
}
|
|
262
|
-
}),
|
|
263
|
-
);
|
|
264
254
|
}
|
|
265
255
|
|
|
266
256
|
async initTreeModel(session?: DebugSession, force?: boolean) {
|
|
@@ -9,17 +9,12 @@ export class DebugVariablesModel extends TreeModel {
|
|
|
9
9
|
static DEFAULT_FLUSH_DELAY = 100;
|
|
10
10
|
|
|
11
11
|
private flushDispatchChangeDelayer = new ThrottledDelayer<void>(DebugVariablesModel.DEFAULT_FLUSH_DELAY);
|
|
12
|
-
private onWillUpdateEmitter: Emitter<void> = new Emitter();
|
|
13
12
|
|
|
14
13
|
constructor(@Optional() root: ExpressionContainer) {
|
|
15
14
|
super();
|
|
16
15
|
this.init(root);
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
get onWillUpdate(): Event<void> {
|
|
20
|
-
return this.onWillUpdateEmitter.event;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
18
|
init(root: CompositeTreeNode) {
|
|
24
19
|
this.root = root;
|
|
25
20
|
// 分支更新时通知树刷新, 不是立即更新,而是延迟更新,待树稳定后再更新
|
|
@@ -30,7 +25,6 @@ export class DebugVariablesModel extends TreeModel {
|
|
|
30
25
|
this.flushDispatchChangeDelayer.cancel();
|
|
31
26
|
}
|
|
32
27
|
this.flushDispatchChangeDelayer.trigger(async () => {
|
|
33
|
-
await this.onWillUpdateEmitter.fireAndAwait();
|
|
34
28
|
this.dispatchChange();
|
|
35
29
|
});
|
|
36
30
|
});
|
|
@@ -252,16 +252,6 @@ export class DebugVariablesModelService {
|
|
|
252
252
|
this.loadingDecoration.removeTarget(target);
|
|
253
253
|
}),
|
|
254
254
|
);
|
|
255
|
-
this.disposableCollection.push(
|
|
256
|
-
this.treeModel.onWillUpdate(() => {
|
|
257
|
-
// 更新树前更新下选中节点
|
|
258
|
-
if (this.selectedNodes.length !== 0) {
|
|
259
|
-
// 仅处理一下单选情况
|
|
260
|
-
const node = this.treeModel?.root.getTreeNodeByPath(this.selectedNodes[0].path);
|
|
261
|
-
this.selectedDecoration.addTarget(node as ExpressionNode);
|
|
262
|
-
}
|
|
263
|
-
}),
|
|
264
|
-
);
|
|
265
255
|
}
|
|
266
256
|
|
|
267
257
|
async initTreeModel(session?: DebugSession) {
|
|
@@ -9,17 +9,12 @@ export class DebugWatchModel extends TreeModel {
|
|
|
9
9
|
static DEFAULT_FLUSH_DELAY = 100;
|
|
10
10
|
|
|
11
11
|
private flushDispatchChangeDelayer = new ThrottledDelayer<void>(DebugWatchModel.DEFAULT_FLUSH_DELAY);
|
|
12
|
-
private onWillUpdateEmitter: Emitter<void> = new Emitter();
|
|
13
12
|
|
|
14
13
|
constructor(@Optional() root: ExpressionContainer) {
|
|
15
14
|
super();
|
|
16
15
|
this.init(root);
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
get onWillUpdate(): Event<void> {
|
|
20
|
-
return this.onWillUpdateEmitter.event;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
18
|
init(root: CompositeTreeNode) {
|
|
24
19
|
this.root = root;
|
|
25
20
|
// 分支更新时通知树刷新, 不是立即更新,而是延迟更新,待树稳定后再更新
|
|
@@ -30,7 +25,6 @@ export class DebugWatchModel extends TreeModel {
|
|
|
30
25
|
this.flushDispatchChangeDelayer.cancel();
|
|
31
26
|
}
|
|
32
27
|
this.flushDispatchChangeDelayer.trigger(async () => {
|
|
33
|
-
await this.onWillUpdateEmitter.fireAndAwait();
|
|
34
28
|
this.dispatchChange();
|
|
35
29
|
});
|
|
36
30
|
});
|
|
@@ -225,16 +225,6 @@ export class DebugWatchModelService {
|
|
|
225
225
|
this.loadingDecoration.removeTarget(target);
|
|
226
226
|
}),
|
|
227
227
|
);
|
|
228
|
-
this.disposableCollection.push(
|
|
229
|
-
this.treeModel.onWillUpdate(() => {
|
|
230
|
-
// 更新树前更新下选中节点
|
|
231
|
-
if (this.selectedNodes.length !== 0) {
|
|
232
|
-
// 仅处理一下单选情况
|
|
233
|
-
const node = this.treeModel?.root.getTreeNodeByPath(this.selectedNodes[0].path);
|
|
234
|
-
this.selectedDecoration.addTarget(node as ExpressionNode);
|
|
235
|
-
}
|
|
236
|
-
}),
|
|
237
|
-
);
|
|
238
228
|
}
|
|
239
229
|
|
|
240
230
|
async initTreeModel() {
|
package/src/common/commands.ts
CHANGED
|
@@ -25,6 +25,12 @@ export namespace DEBUG_COMMANDS {
|
|
|
25
25
|
export const TOGGLE_BREAKPOINTS: Command = {
|
|
26
26
|
id: 'debug.breakpoints.toggle',
|
|
27
27
|
};
|
|
28
|
+
export const ACTIVE_BREAKPOINTS: Command = {
|
|
29
|
+
id: 'debug.breakpoints.active',
|
|
30
|
+
};
|
|
31
|
+
export const DEACTIVE_BREAKPOINTS: Command = {
|
|
32
|
+
id: 'debug.breakpoints.deactive',
|
|
33
|
+
};
|
|
28
34
|
export const START: Command = {
|
|
29
35
|
id: 'debug.start',
|
|
30
36
|
};
|
package/src/common/constants.ts
CHANGED
|
@@ -79,3 +79,5 @@ export const CONTEXT_EXCEPTION_WIDGET_VISIBLE = new RawContextKey<boolean>('exce
|
|
|
79
79
|
export const CONTEXT_MULTI_SESSION_REPL = new RawContextKey<boolean>('multiSessionRepl', false);
|
|
80
80
|
export const CONTEXT_MULTI_SESSION_DEBUG = new RawContextKey<boolean>('multiSessionDebug', false);
|
|
81
81
|
export const CONTEXT_CAN_VIEW_MEMORY = new RawContextKey<boolean>('canViewMemory', undefined);
|
|
82
|
+
|
|
83
|
+
export const CONTEXT_ACTIVE_BREAKPOINTS = new RawContextKey<boolean>('activateBreakpoints', true);
|