@opensumi/ide-debug 2.24.4 → 2.24.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-manager.d.ts +3 -4
- package/lib/browser/breakpoint/breakpoint-manager.d.ts.map +1 -1
- package/lib/browser/breakpoint/breakpoint-manager.js +0 -7
- package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
- package/lib/browser/contextkeys/debug-contextkey.service.d.ts +0 -1
- package/lib/browser/contextkeys/debug-contextkey.service.d.ts.map +1 -1
- package/lib/browser/contextkeys/debug-contextkey.service.js +1 -2
- 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 +4 -42
- package/lib/browser/debug-contribution.js.map +1 -1
- package/lib/browser/debug-style.less +5 -34
- package/lib/browser/editor/debug-hover-model.d.ts +3 -0
- package/lib/browser/editor/debug-hover-model.d.ts.map +1 -1
- package/lib/browser/editor/debug-hover-model.js +5 -0
- 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 +9 -0
- package/lib/browser/editor/debug-hover-tree.model.service.js.map +1 -1
- package/lib/browser/editor/debug-model.d.ts +0 -2
- package/lib/browser/editor/debug-model.d.ts.map +1 -1
- package/lib/browser/editor/debug-model.js +2 -31
- package/lib/browser/editor/debug-model.js.map +1 -1
- package/lib/browser/editor/debug-styles.d.ts +0 -1
- package/lib/browser/editor/debug-styles.d.ts.map +1 -1
- package/lib/browser/editor/debug-styles.js +1 -7
- package/lib/browser/editor/debug-styles.js.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.module.less +8 -64
- package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts +1 -10
- package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js +0 -5
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts +0 -7
- package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.view.js +26 -80
- package/lib/browser/view/breakpoints/debug-breakpoints.view.js.map +1 -1
- package/lib/browser/view/console/debug-console-model.d.ts +3 -0
- package/lib/browser/view/console/debug-console-model.d.ts.map +1 -1
- package/lib/browser/view/console/debug-console-model.js +5 -0
- 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 +9 -0
- package/lib/browser/view/console/debug-console-tree.model.service.js.map +1 -1
- package/lib/browser/view/variables/debug-variables-model.d.ts +3 -0
- package/lib/browser/view/variables/debug-variables-model.d.ts.map +1 -1
- package/lib/browser/view/variables/debug-variables-model.js +5 -0
- 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 +9 -0
- package/lib/browser/view/variables/debug-variables-tree.model.service.js.map +1 -1
- package/lib/browser/view/watch/debug-watch-model.d.ts +3 -0
- package/lib/browser/view/watch/debug-watch-model.d.ts.map +1 -1
- package/lib/browser/view/watch/debug-watch-model.js +5 -0
- 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 +9 -0
- package/lib/browser/view/watch/debug-watch-tree.model.service.js.map +1 -1
- package/lib/common/commands.d.ts +0 -2
- package/lib/common/commands.d.ts.map +1 -1
- package/lib/common/commands.js +0 -6
- package/lib/common/commands.js.map +1 -1
- package/lib/common/constants.d.ts +0 -1
- package/lib/common/constants.d.ts.map +1 -1
- package/lib/common/constants.js +1 -2
- package/lib/common/constants.js.map +1 -1
- package/package.json +23 -23
- package/src/browser/breakpoint/breakpoint-manager.ts +3 -8
- package/src/browser/contextkeys/debug-contextkey.service.ts +1 -4
- package/src/browser/debug-contribution.ts +4 -47
- package/src/browser/debug-style.less +5 -34
- package/src/browser/editor/debug-hover-model.ts +6 -0
- package/src/browser/editor/debug-hover-tree.model.service.ts +10 -0
- package/src/browser/editor/debug-model.ts +3 -35
- package/src/browser/editor/debug-styles.ts +0 -7
- package/src/browser/view/breakpoints/debug-breakpoints.module.less +8 -64
- package/src/browser/view/breakpoints/debug-breakpoints.service.ts +0 -8
- package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +32 -139
- package/src/browser/view/console/debug-console-model.ts +6 -0
- package/src/browser/view/console/debug-console-tree.model.service.ts +10 -0
- package/src/browser/view/variables/debug-variables-model.ts +6 -0
- package/src/browser/view/variables/debug-variables-tree.model.service.ts +10 -0
- package/src/browser/view/watch/debug-watch-model.ts +6 -0
- package/src/browser/view/watch/debug-watch-tree.model.service.ts +10 -0
- package/src/common/commands.ts +0 -6
- package/src/common/constants.ts +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cls from 'classnames';
|
|
2
2
|
import { observer } from 'mobx-react-lite';
|
|
3
|
-
import React, { useCallback, useEffect,
|
|
3
|
+
import React, { useCallback, useEffect, 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,23 +13,16 @@ import {
|
|
|
13
13
|
Disposable,
|
|
14
14
|
ViewState,
|
|
15
15
|
Event,
|
|
16
|
-
isUndefined,
|
|
17
|
-
IRange,
|
|
18
|
-
localize,
|
|
19
16
|
} 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';
|
|
23
17
|
import { DebugProtocol } from '@opensumi/vscode-debugprotocol/lib/debugProtocol';
|
|
24
18
|
|
|
25
|
-
import {
|
|
19
|
+
import { IDebugBreakpoint, IDebugSessionManager, ISourceBreakpoint } from '../../../common';
|
|
26
20
|
import {
|
|
27
21
|
DebugExceptionBreakpoint,
|
|
28
22
|
isDebugBreakpoint,
|
|
29
23
|
isRuntimeBreakpoint,
|
|
30
24
|
getStatus,
|
|
31
25
|
EXCEPTION_BREAKPOINT_URI,
|
|
32
|
-
BreakpointManager,
|
|
33
26
|
} from '../../breakpoint';
|
|
34
27
|
import { DebugSessionManager } from '../../debug-session-manager';
|
|
35
28
|
|
|
@@ -98,19 +91,11 @@ export const DebugBreakpointView = observer(({ viewState }: React.PropsWithChild
|
|
|
98
91
|
} else {
|
|
99
92
|
const toURI = URI.parse(uri);
|
|
100
93
|
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);
|
|
103
94
|
|
|
104
95
|
breakpointTreeData.push({
|
|
105
|
-
label,
|
|
106
|
-
renderLabel: (
|
|
107
|
-
<BreakpointFileItem
|
|
108
|
-
label={label}
|
|
109
|
-
breakpointItems={breakpointItems}
|
|
110
|
-
title={toURI.toString()}
|
|
111
|
-
></BreakpointFileItem>
|
|
112
|
-
),
|
|
96
|
+
label: parent ? parent.relative(toURI)?.toString() || '' : URI.parse(uri).displayName,
|
|
113
97
|
expandable: true,
|
|
98
|
+
iconClassName: getIcon('file-text'),
|
|
114
99
|
expanded: true,
|
|
115
100
|
children: items.map((item) => ({
|
|
116
101
|
...item,
|
|
@@ -183,114 +168,46 @@ export const DebugBreakpointView = observer(({ viewState }: React.PropsWithChild
|
|
|
183
168
|
);
|
|
184
169
|
});
|
|
185
170
|
|
|
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
|
-
|
|
237
171
|
export const BreakpointItem = ({ data, toggle }: { data: BreakpointItem; toggle: () => void }) => {
|
|
238
172
|
const defaultValue = isDebugBreakpoint(data.breakpoint) ? data.breakpoint.enabled : !!data.breakpoint.default;
|
|
239
173
|
const manager = useInjectable<DebugSessionManager>(IDebugSessionManager);
|
|
240
|
-
const breakpointManager = useInjectable<BreakpointManager>(BreakpointManager);
|
|
241
174
|
const commandService = useInjectable<CommandService>(CommandService);
|
|
242
175
|
const debugBreakpointsService = useInjectable<DebugBreakpointsService>(DebugBreakpointsService);
|
|
243
176
|
const [enabled, setEnabled] = React.useState<boolean>(defaultValue);
|
|
244
177
|
const [status, setStatus] = React.useState<DebugProtocol.Breakpoint | false | undefined>(undefined);
|
|
245
178
|
const [description, setDescription] = React.useState<string>(data.description);
|
|
246
179
|
|
|
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
|
-
|
|
277
180
|
const handleBreakpointChange = () => {
|
|
278
181
|
toggle();
|
|
279
182
|
setEnabled(!enabled);
|
|
280
183
|
};
|
|
281
184
|
|
|
282
|
-
const handleBreakpointClick =
|
|
185
|
+
const handleBreakpointClick = () => {
|
|
283
186
|
if ((data.breakpoint as ISourceBreakpoint).uri) {
|
|
284
|
-
|
|
187
|
+
const options = {
|
|
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(
|
|
285
207
|
EDITOR_COMMANDS.OPEN_RESOURCE.id,
|
|
286
208
|
new URI((data.breakpoint as ISourceBreakpoint).uri),
|
|
287
|
-
|
|
209
|
+
options,
|
|
288
210
|
);
|
|
289
|
-
|
|
290
|
-
debugBreakpointsService.launchFocusedBreakpoints({
|
|
291
|
-
uri: new URI((data.breakpoint as ISourceBreakpoint).uri),
|
|
292
|
-
range: openOptions.range as IRange,
|
|
293
|
-
});
|
|
294
211
|
}
|
|
295
212
|
};
|
|
296
213
|
|
|
@@ -315,26 +232,11 @@ export const BreakpointItem = ({ data, toggle }: { data: BreakpointItem; toggle:
|
|
|
315
232
|
};
|
|
316
233
|
}, []);
|
|
317
234
|
|
|
318
|
-
const removeBreakpoint = (event: React.MouseEvent<
|
|
235
|
+
const removeBreakpoint = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
|
319
236
|
event.stopPropagation();
|
|
320
237
|
debugBreakpointsService.delBreakpoint(data.breakpoint as IDebugBreakpoint);
|
|
321
238
|
};
|
|
322
239
|
|
|
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
|
-
|
|
338
240
|
return (
|
|
339
241
|
<div className={cls(styles.debug_breakpoints_item)}>
|
|
340
242
|
<CheckBox
|
|
@@ -349,20 +251,11 @@ export const BreakpointItem = ({ data, toggle }: { data: BreakpointItem; toggle:
|
|
|
349
251
|
</div>
|
|
350
252
|
{isDebugBreakpoint(data.breakpoint) ? (
|
|
351
253
|
<>
|
|
352
|
-
<
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
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>
|
|
254
|
+
<a
|
|
255
|
+
title='删除断点'
|
|
256
|
+
onClick={(event) => removeBreakpoint(event)}
|
|
257
|
+
className={cls(styles.debug_remove_breakpoints_icon, getIcon('close'))}
|
|
258
|
+
></a>
|
|
366
259
|
<Badge className={styles.debug_breakpoints_badge}>
|
|
367
260
|
{(data.breakpoint as IDebugBreakpoint).raw.line}
|
|
368
261
|
{!!data.breakpoint.raw.column && `:${data.breakpoint.raw.column}`}
|
|
@@ -9,6 +9,7 @@ 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();
|
|
12
13
|
private _tempScrollOffset = 0;
|
|
13
14
|
|
|
14
15
|
constructor(@Optional() root: ExpressionContainer) {
|
|
@@ -16,6 +17,10 @@ export class DebugConsoleTreeModel extends TreeModel {
|
|
|
16
17
|
this.init(root);
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
get onWillUpdate(): Event<void> {
|
|
21
|
+
return this.onWillUpdateEmitter.event;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
/**
|
|
20
25
|
* 判断是否滚动到了底部
|
|
21
26
|
* TODO: //临时处理 by @Ricbet
|
|
@@ -35,6 +40,7 @@ export class DebugConsoleTreeModel extends TreeModel {
|
|
|
35
40
|
this.flushDispatchChangeDelayer.cancel();
|
|
36
41
|
}
|
|
37
42
|
this.flushDispatchChangeDelayer.trigger(async () => {
|
|
43
|
+
await this.onWillUpdateEmitter.fireAndAwait();
|
|
38
44
|
this.dispatchChange();
|
|
39
45
|
});
|
|
40
46
|
});
|
|
@@ -251,6 +251,16 @@ 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
|
+
);
|
|
254
264
|
}
|
|
255
265
|
|
|
256
266
|
async initTreeModel(session?: DebugSession, force?: boolean) {
|
|
@@ -9,12 +9,17 @@ 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();
|
|
12
13
|
|
|
13
14
|
constructor(@Optional() root: ExpressionContainer) {
|
|
14
15
|
super();
|
|
15
16
|
this.init(root);
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
get onWillUpdate(): Event<void> {
|
|
20
|
+
return this.onWillUpdateEmitter.event;
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
init(root: CompositeTreeNode) {
|
|
19
24
|
this.root = root;
|
|
20
25
|
// 分支更新时通知树刷新, 不是立即更新,而是延迟更新,待树稳定后再更新
|
|
@@ -25,6 +30,7 @@ export class DebugVariablesModel extends TreeModel {
|
|
|
25
30
|
this.flushDispatchChangeDelayer.cancel();
|
|
26
31
|
}
|
|
27
32
|
this.flushDispatchChangeDelayer.trigger(async () => {
|
|
33
|
+
await this.onWillUpdateEmitter.fireAndAwait();
|
|
28
34
|
this.dispatchChange();
|
|
29
35
|
});
|
|
30
36
|
});
|
|
@@ -252,6 +252,16 @@ 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
|
+
);
|
|
255
265
|
}
|
|
256
266
|
|
|
257
267
|
async initTreeModel(session?: DebugSession) {
|
|
@@ -9,12 +9,17 @@ 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();
|
|
12
13
|
|
|
13
14
|
constructor(@Optional() root: ExpressionContainer) {
|
|
14
15
|
super();
|
|
15
16
|
this.init(root);
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
get onWillUpdate(): Event<void> {
|
|
20
|
+
return this.onWillUpdateEmitter.event;
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
init(root: CompositeTreeNode) {
|
|
19
24
|
this.root = root;
|
|
20
25
|
// 分支更新时通知树刷新, 不是立即更新,而是延迟更新,待树稳定后再更新
|
|
@@ -25,6 +30,7 @@ export class DebugWatchModel extends TreeModel {
|
|
|
25
30
|
this.flushDispatchChangeDelayer.cancel();
|
|
26
31
|
}
|
|
27
32
|
this.flushDispatchChangeDelayer.trigger(async () => {
|
|
33
|
+
await this.onWillUpdateEmitter.fireAndAwait();
|
|
28
34
|
this.dispatchChange();
|
|
29
35
|
});
|
|
30
36
|
});
|
|
@@ -225,6 +225,16 @@ 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
|
+
);
|
|
228
238
|
}
|
|
229
239
|
|
|
230
240
|
async initTreeModel() {
|
package/src/common/commands.ts
CHANGED
|
@@ -25,12 +25,6 @@ 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
|
-
};
|
|
34
28
|
export const START: Command = {
|
|
35
29
|
id: 'debug.start',
|
|
36
30
|
};
|
package/src/common/constants.ts
CHANGED
|
@@ -79,5 +79,3 @@ 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);
|