@opensumi/ide-debug 2.23.4-rc-1681355094.0 → 2.23.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.
Files changed (48) hide show
  1. package/lib/browser/breakpoint/breakpoint-marker.d.ts +0 -2
  2. package/lib/browser/breakpoint/breakpoint-marker.d.ts.map +1 -1
  3. package/lib/browser/breakpoint/breakpoint-marker.js +1 -4
  4. package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -1
  5. package/lib/browser/model/debug-stack-frame.d.ts +0 -12
  6. package/lib/browser/model/debug-stack-frame.d.ts.map +1 -1
  7. package/lib/browser/model/debug-stack-frame.js +1 -27
  8. package/lib/browser/model/debug-stack-frame.js.map +1 -1
  9. package/lib/browser/model/debug-thread.d.ts.map +1 -1
  10. package/lib/browser/model/debug-thread.js +4 -6
  11. package/lib/browser/model/debug-thread.js.map +1 -1
  12. package/lib/browser/view/breakpoints/debug-breakpoints.module.less +5 -5
  13. package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts +3 -8
  14. package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts.map +1 -1
  15. package/lib/browser/view/breakpoints/debug-breakpoints.service.js +32 -76
  16. package/lib/browser/view/breakpoints/debug-breakpoints.service.js.map +1 -1
  17. package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts +1 -2
  18. package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts.map +1 -1
  19. package/lib/browser/view/breakpoints/debug-breakpoints.view.js +12 -60
  20. package/lib/browser/view/breakpoints/debug-breakpoints.view.js.map +1 -1
  21. package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts +0 -1
  22. package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts.map +1 -1
  23. package/lib/browser/view/frames/debug-call-stack-frame.view.js +26 -136
  24. package/lib/browser/view/frames/debug-call-stack-frame.view.js.map +1 -1
  25. package/lib/browser/view/frames/debug-call-stack-session.view.d.ts.map +1 -1
  26. package/lib/browser/view/frames/debug-call-stack-session.view.js +10 -17
  27. package/lib/browser/view/frames/debug-call-stack-session.view.js.map +1 -1
  28. package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts +0 -1
  29. package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts.map +1 -1
  30. package/lib/browser/view/frames/debug-call-stack-thread.view.js +7 -10
  31. package/lib/browser/view/frames/debug-call-stack-thread.view.js.map +1 -1
  32. package/lib/browser/view/frames/debug-call-stack.module.less +2 -1
  33. package/package.json +23 -23
  34. package/src/browser/breakpoint/breakpoint-marker.ts +1 -3
  35. package/src/browser/model/debug-stack-frame.ts +2 -28
  36. package/src/browser/model/debug-thread.ts +4 -6
  37. package/src/browser/view/breakpoints/debug-breakpoints.module.less +5 -5
  38. package/src/browser/view/breakpoints/debug-breakpoints.service.ts +30 -78
  39. package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +24 -118
  40. package/src/browser/view/frames/debug-call-stack-frame.view.tsx +51 -184
  41. package/src/browser/view/frames/debug-call-stack-session.view.tsx +15 -29
  42. package/src/browser/view/frames/debug-call-stack-thread.view.tsx +8 -14
  43. package/src/browser/view/frames/debug-call-stack.module.less +2 -1
  44. package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.d.ts +0 -14
  45. package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.d.ts.map +0 -1
  46. package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.js +0 -28
  47. package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.js.map +0 -1
  48. package/src/browser/view/breakpoints/debug-breakpoints-tree.model.ts +0 -35
@@ -1,6 +1,6 @@
1
1
  import cls from 'classnames';
2
2
  import { observer } from 'mobx-react-lite';
3
- import React, { useCallback, useEffect, useState, useRef } from 'react';
3
+ import React, { useCallback, useEffect, useState } from 'react';
4
4
 
5
5
  import { RecycleList } from '@opensumi/ide-components';
6
6
  import {
@@ -15,7 +15,7 @@ import {
15
15
  import { IDebugSessionManager } from '../../../common';
16
16
  import { DebugSession } from '../../debug-session';
17
17
  import { DebugSessionManager } from '../../debug-session-manager';
18
- import { DebugStackFrame, ShowMoreDebugStackFrame } from '../../model';
18
+ import { DebugStackFrame } from '../../model';
19
19
  import { DebugThread } from '../../model/debug-thread';
20
20
 
21
21
  import styles from './debug-call-stack.module.less';
@@ -27,18 +27,16 @@ export interface DebugStackSessionViewProps {
27
27
  thread: DebugThread;
28
28
  viewState: ViewState;
29
29
  indent?: number;
30
- isBottom?: boolean;
31
30
  }
32
31
 
33
32
  export const DebugStackFramesView = observer((props: DebugStackSessionViewProps) => {
34
- const { viewState, frames: rawFrames, thread, indent = 0, session, isBottom } = props;
33
+ const { viewState, frames: rawFrames, thread, indent = 0, session } = props;
35
34
  const [selected, setSelected] = useState<number | undefined>();
36
35
  const [isLoading, setIsLoading] = useState<boolean>(false);
37
- const [frames, setFrames] = useState<(DebugStackFrame | ShowMoreDebugStackFrame)[]>([]);
36
+ const [frames, setFrames] = useState<DebugStackFrame[]>([]);
38
37
  const [framesErrorMessage, setFramesErrorMessage] = useState<string>('');
39
38
  const [canLoadMore, setCanLoadMore] = useState<boolean>(false);
40
39
  const manager = useInjectable<DebugSessionManager>(IDebugSessionManager);
41
- const currentFrames = useRef<(DebugStackFrame | ShowMoreDebugStackFrame)[]>([]);
42
40
  const debugCallStackService = useInjectable<DebugCallStackService>(DebugCallStackService);
43
41
 
44
42
  const loadMore = useCallback(async () => {
@@ -59,99 +57,11 @@ export const DebugStackFramesView = observer((props: DebugStackSessionViewProps)
59
57
  }
60
58
  };
61
59
 
62
- const expandFrame = useCallback(
63
- (frame: ShowMoreDebugStackFrame) => {
64
- const expanedFrames = currentFrames.current.slice(0);
65
- let index = -1;
66
- if (!frame.nextFrame) {
67
- index = expanedFrames.length;
68
- } else {
69
- index = expanedFrames.findIndex((f) => DebugStackFrame.is(f) && f.id === frame.nextFrame?.id);
70
- }
71
- if (index > -1) {
72
- expanedFrames.splice(index - 1, 1, ...frame.frames);
73
- currentFrames.current = expanedFrames;
74
- setFrames(expanedFrames);
75
- }
76
- },
77
- [currentFrames.current],
78
- );
79
-
80
- const mergeFrames = useCallback(
81
- (current: (DebugStackFrame | ShowMoreDebugStackFrame)[], frames: DebugStackFrame[]) => {
82
- const len = frames.length;
83
- let offset = -1;
84
- let lastFrame = current.length > 0 ? current[current.length + offset] : undefined;
85
- while (lastFrame && !DebugStackFrame.is(lastFrame)) {
86
- offset -= 1;
87
- lastFrame = current[current.length + offset];
88
- }
89
- // 合并位置调整,方便将进一步加载的含 `frames[i].source?.raw.origin` 进行合并
90
- const results: (DebugStackFrame | ShowMoreDebugStackFrame)[] = current.slice(0, current.length + offset + 1);
91
-
92
- const startIndex = lastFrame ? frames.findIndex((frame) => frame.id === lastFrame?.id) + 1 : 0;
93
- let showMoreFrames: DebugStackFrame[] = [];
94
- let showMoreOrigin;
95
- let hasOrigin = false;
96
- for (let i = startIndex; i < len; i++) {
97
- if (frames[i].source?.raw.origin) {
98
- if (hasOrigin) {
99
- if (showMoreOrigin === frames[i].source?.raw.origin) {
100
- showMoreFrames.push(frames[i]);
101
- continue;
102
- } else {
103
- if (showMoreFrames.length > 1) {
104
- results.push(
105
- new ShowMoreDebugStackFrame(frames[i], showMoreFrames, session, showMoreOrigin, expandFrame),
106
- );
107
- offset -= showMoreFrames.length - 1;
108
- } else {
109
- results.push(showMoreFrames[0]);
110
- }
111
- showMoreFrames = [];
112
- hasOrigin = false;
113
- showMoreOrigin = frames[i].source?.raw.origin;
114
- showMoreFrames.push(frames[i]);
115
- }
116
- } else {
117
- hasOrigin = true;
118
- showMoreFrames.push(frames[i]);
119
- showMoreOrigin = frames[i].source?.raw.origin;
120
- }
121
- } else {
122
- if (hasOrigin && showMoreFrames.length > 0) {
123
- if (showMoreFrames.length > 1) {
124
- results.push(
125
- new ShowMoreDebugStackFrame(frames[i], showMoreFrames, session, showMoreOrigin, expandFrame),
126
- );
127
- offset -= showMoreFrames.length - 1;
128
- } else {
129
- results.push(showMoreFrames[0]);
130
- }
131
- showMoreFrames = [];
132
- hasOrigin = false;
133
- }
134
- results.push(frames[i]);
135
- }
136
- }
137
- if (hasOrigin && showMoreFrames.length > 0) {
138
- if (showMoreFrames.length > 1) {
139
- results.push(new ShowMoreDebugStackFrame(undefined, showMoreFrames, session, showMoreOrigin, expandFrame));
140
- } else {
141
- results.push(showMoreFrames[0]);
142
- }
143
- }
144
- return results;
145
- },
146
- [],
147
- );
148
-
149
60
  const updateFrames = useCallback(
150
61
  (frames: DebugStackFrame[]) => {
151
- currentFrames.current = mergeFrames(currentFrames.current, frames);
152
- setFrames(currentFrames.current);
62
+ setFrames(frames);
153
63
  },
154
- [frames, mergeFrames],
64
+ [frames],
155
65
  );
156
66
 
157
67
  const updateSelected = useCallback(
@@ -208,18 +118,13 @@ export const DebugStackFramesView = observer((props: DebugStackSessionViewProps)
208
118
  }, [frames]);
209
119
 
210
120
  const template = ({ data }) => {
211
- const frame: DebugStackFrame | ShowMoreDebugStackFrame = data;
212
- const isLabel = DebugStackFrame.is(frame) && frame.raw.presentationHint === 'label';
213
- const isSubtle = DebugStackFrame.is(frame) && frame.raw.presentationHint === 'subtle';
214
- const isDeemphasize = DebugStackFrame.is(frame) && frame.raw?.source?.presentationHint === 'deemphasize';
215
- const onClickHandler = useCallback(() => {
121
+ const frame: DebugStackFrame = data;
122
+ const isLabel = frame.raw.presentationHint === 'label';
123
+ const isSubtle = frame.raw.presentationHint === 'subtle';
124
+ const clickHandler = useCallback(() => {
216
125
  if (isLabel || isSubtle) {
217
126
  return;
218
127
  }
219
- if (!DebugStackFrame.is(frame)) {
220
- frame.open();
221
- return;
222
- }
223
128
  manager.updateCurrentSession(frame.session);
224
129
 
225
130
  frame.session.currentThread = frame.thread;
@@ -230,125 +135,86 @@ export const DebugStackFramesView = observer((props: DebugStackSessionViewProps)
230
135
  const restartFrame = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
231
136
  event.preventDefault();
232
137
  event.stopPropagation();
233
- if (!DebugStackFrame.is(frame)) {
234
- return;
235
- }
138
+
236
139
  if (frame.canRestart) {
237
140
  frame.restart();
238
141
  }
239
142
  };
240
143
 
241
- const frameItemStyle = {
242
- paddingLeft: `${indent}px`,
243
- };
244
-
245
- if (DebugStackFrame.is(frame) && isDeemphasize) {
246
- frameItemStyle['color'] = 'var(--list-deemphasizedForeground)';
247
- }
248
-
249
- const renderFrame = useCallback((frame) => {
250
- if (DebugStackFrame.is(frame)) {
251
- return (
252
- <>
253
- <span
254
- className={cls(styles.debug_stack_frames_item_label, isLabel && styles.label, isSubtle && styles.subtle)}
255
- >
256
- {frame.raw && frame.raw.name}
257
- </span>
258
- {!isLabel && (
259
- <span className={styles.debug_stack_frames_item_description}>
260
- {(frame.raw && frame.raw.source && frame.raw.source.name) || localize('debug.stack.frame.noSource')}
261
- </span>
262
- )}
263
- <>
264
- {frame.canRestart && (
265
- <a
266
- title=''
267
- onClick={(event) => restartFrame(event)}
268
- className={cls(styles.debug_restart_frame_icon, getIcon('debug-restart-frame'))}
269
- ></a>
270
- )}
271
- {!isLabel && !isDeemphasize && (
272
- <div className={cls(!isUndefined(frame.raw.line) && styles.debug_stack_frames_item_badge)}>
273
- {frame.raw && frame.raw.line}
274
- {!isUndefined(frame.raw.line) && ':'}
275
- {frame.raw && frame.raw.column}
276
- </div>
277
- )}
278
- </>
279
- </>
280
- );
281
- } else {
282
- return <span className={styles.debug_stack_frames_load_more}>{frame.name}</span>;
283
- }
284
- }, []);
285
-
286
144
  return (
287
145
  <div
288
- style={frameItemStyle}
146
+ style={{ paddingLeft: `${indent}px` }}
289
147
  className={cls(
290
148
  styles.debug_stack_frames_item,
291
- isLabel && styles.is_label,
292
- DebugStackFrame.is(frame) && selected === frame.raw.id && styles.selected,
293
- DebugStackFrame.is(frame) &&
294
- !(frame.raw && frame.raw.source && frame.raw.source.name) &&
295
- styles.debug_stack_frames_item_hidden,
149
+ selected === frame.raw.id && styles.selected,
150
+ !(frame.raw && frame.raw.source && frame.raw.source.name) && styles.debug_stack_frames_item_hidden,
296
151
  )}
297
- onClick={onClickHandler}
152
+ onClick={clickHandler}
298
153
  onContextMenu={(event: React.MouseEvent<HTMLDivElement, MouseEvent>) =>
299
154
  debugCallStackService.handleContextMenu(event, data)
300
155
  }
301
156
  >
302
- {renderFrame(frame)}
157
+ <span className={cls(styles.debug_stack_frames_item_label, isLabel && styles.label, isSubtle && styles.subtle)}>
158
+ {frame.raw && frame.raw.name}
159
+ </span>
160
+ <span className={styles.debug_stack_frames_item_description}>
161
+ {(frame.raw && frame.raw.source && frame.raw.source.name) || localize('debug.stack.frame.noSource')}
162
+ </span>
163
+ <>
164
+ <a
165
+ title=''
166
+ onClick={(event) => restartFrame(event)}
167
+ className={cls(styles.debug_restart_frame_icon, getIcon('debug-restart-frame'))}
168
+ ></a>
169
+ <div className={cls(!isUndefined(frame.raw.line) && styles.debug_stack_frames_item_badge)}>
170
+ {frame.raw && frame.raw.line}
171
+ {!isUndefined(frame.raw.line) && ':'}
172
+ {frame.raw && frame.raw.column}
173
+ </div>
174
+ </>
303
175
  </div>
304
176
  );
305
177
  };
306
178
 
307
- const renderLoadMoreStackFrames = useCallback(() => {
308
- const onClickHandler = async () => {
179
+ const renderLoadMoreStackFrames = () => {
180
+ const clickHandler = async () => {
309
181
  setIsLoading(true);
310
182
  await loadMore();
311
183
  setIsLoading(false);
312
184
  };
313
185
  return (
314
- <div className={styles.debug_stack_frames_item} onClick={onClickHandler}>
186
+ <div className={styles.debug_stack_frames_item} onClick={clickHandler}>
315
187
  <span className={styles.debug_stack_frames_load_more}>{localize('debug.stack.loadMore')}</span>
316
188
  </div>
317
189
  );
318
- }, [isLoading, loadMore]);
190
+ };
319
191
 
320
- const renderLoading = useCallback(
321
- () => (
322
- <div className={styles.debug_stack_frames_item}>
323
- <span className={styles.debug_stack_frames_load_more}>{localize('debug.stack.loading')}</span>
324
- </div>
325
- ),
326
- [],
192
+ const renderLoading = () => (
193
+ <div className={styles.debug_stack_frames_item}>
194
+ <span className={styles.debug_stack_frames_load_more}>{localize('debug.stack.loading')}</span>
195
+ </div>
327
196
  );
328
197
 
329
- const renderFramesErrorMessage = useCallback(
330
- (message: string) => (
331
- <div className={styles.debug_stack_frames_item}>
332
- <span className={styles.debug_stack_frames_error_message} title={message}>
333
- {message}
334
- </span>
335
- </div>
336
- ),
337
- [],
198
+ const renderFramesErrorMessage = (message: string) => (
199
+ <div className={styles.debug_stack_frames_item}>
200
+ <span className={styles.debug_stack_frames_error_message} title={message}>
201
+ {message}
202
+ </span>
203
+ </div>
338
204
  );
339
205
 
340
206
  if (framesErrorMessage) {
341
207
  return <div className={styles.debug_stack_frames}>{renderFramesErrorMessage(framesErrorMessage)}</div>;
342
208
  }
343
209
 
344
- const footer = useCallback(() => {
210
+ const footer = () => {
345
211
  if (isLoading) {
346
212
  return renderLoading();
347
213
  } else if (canLoadMore) {
348
214
  return renderLoadMoreStackFrames();
349
215
  }
350
216
  return null;
351
- }, [isLoading, canLoadMore]);
217
+ };
352
218
 
353
219
  return (
354
220
  <RecycleList
@@ -356,7 +222,8 @@ export const DebugStackFramesView = observer((props: DebugStackSessionViewProps)
356
222
  template={template}
357
223
  itemHeight={22}
358
224
  width={viewState.width}
359
- height={(isLoading || canLoadMore ? (frames.length + 1) * 22 : frames.length * 22) + (isBottom ? 10 : 0)}
225
+ paddingBottomSize={0}
226
+ height={isLoading || canLoadMore ? (frames.length + 1) * 22 : frames.length * 22}
360
227
  footer={isLoading || canLoadMore ? footer : undefined}
361
228
  />
362
229
  );
@@ -1,5 +1,5 @@
1
1
  import cls from 'classnames';
2
- import React, { useCallback, useState, useEffect, useRef } from 'react';
2
+ import React, { useCallback, useState, useEffect } from 'react';
3
3
 
4
4
  import { ViewState, getIcon, useInjectable, DisposableCollection, localize } from '@opensumi/ide-core-browser';
5
5
 
@@ -34,7 +34,6 @@ export const DebugStackSessionView = (props: DebugStackSessionViewProps) => {
34
34
  const mutipleSession = manager.sessions.length > 1;
35
35
  const supportsThreadIdCorrespond = session.supportsThreadIdCorrespond;
36
36
 
37
- const disposed = useRef<boolean>(false);
38
37
  // 从 manager.sessions 中找出 parentSession id 是当前 session id 的 session
39
38
  const findSubSessions = () => {
40
39
  const hasParentSessions = manager.sessions.filter((s) => s.parentSession);
@@ -58,30 +57,20 @@ export const DebugStackSessionView = (props: DebugStackSessionViewProps) => {
58
57
  };
59
58
 
60
59
  useEffect(() => {
61
- const disposables = new DisposableCollection();
62
- disposables.push(
63
- manager.onDidCreateDebugSession(() => {
64
- if (disposed.current) {
65
- return;
66
- }
67
- const sub = findSubSessions();
68
- setSubSession(sub);
69
- }),
70
- );
60
+ const createDispose = manager.onDidCreateDebugSession(() => {
61
+ const sub = findSubSessions();
62
+ setSubSession(sub);
63
+ });
71
64
 
72
- disposables.push(
73
- manager.onDidDestroyDebugSession(() => {
74
- if (disposed.current) {
75
- return;
76
- }
77
- const sub = findSubSessions();
78
- setSubSession(sub);
79
- }),
80
- );
65
+ const destroyDispose = manager.onDidDestroyDebugSession(() => {
66
+ const sub = findSubSessions();
67
+ setSubSession(sub);
68
+ });
81
69
 
82
70
  return () => {
83
- disposed.current = true;
84
- disposables.dispose();
71
+ createDispose.dispose();
72
+ destroyDispose.dispose();
73
+ setSubSession([]);
85
74
  };
86
75
  }, []);
87
76
 
@@ -164,7 +153,7 @@ export const DebugStackSessionView = (props: DebugStackSessionViewProps) => {
164
153
  </div>
165
154
  ) : (
166
155
  otherThreads.map(
167
- (thread: DebugThread, index: number) =>
156
+ (thread) =>
168
157
  !session.hasInMultipleThreadPaused(thread.raw.id) && (
169
158
  <DebugStackThreadView
170
159
  key={thread.id}
@@ -172,7 +161,6 @@ export const DebugStackSessionView = (props: DebugStackSessionViewProps) => {
172
161
  viewState={viewState}
173
162
  thread={thread}
174
163
  session={session}
175
- isBottom={index === otherThreads.length - 1}
176
164
  />
177
165
  ),
178
166
  )
@@ -237,27 +225,25 @@ export const DebugStackSessionView = (props: DebugStackSessionViewProps) => {
237
225
  </div>
238
226
  )}
239
227
  {supportsThreadIdCorrespond && unfold
240
- ? multipleThreadPaused.map((t: DebugThread, index: number) => (
228
+ ? multipleThreadPaused.map((t) => (
241
229
  <DebugStackThreadView
242
230
  key={t.id}
243
231
  indent={mutipleSession ? 16 : 0}
244
232
  viewState={viewState}
245
233
  thread={t}
246
234
  session={session}
247
- isBottom={index === multipleThreadPaused.length - 1}
248
235
  />
249
236
  ))
250
237
  : null}
251
238
  {!supportsThreadIdCorrespond &&
252
239
  (!mutipleSession || unfold) &&
253
- threads.map((thread: DebugThread, index: number) => (
240
+ threads.map((thread) => (
254
241
  <DebugStackThreadView
255
242
  key={thread.id}
256
243
  indent={mutipleSession ? 16 : 0}
257
244
  viewState={viewState}
258
245
  thread={thread}
259
246
  session={session}
260
- isBottom={index === threads.length - 1}
261
247
  />
262
248
  ))}
263
249
  {subSession.length > 0 &&
@@ -1,6 +1,5 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
2
 
3
- import { Badge } from '@opensumi/ide-components';
4
3
  import { ViewState, getIcon, useInjectable, localize, DisposableCollection } from '@opensumi/ide-core-browser';
5
4
 
6
5
  import { IDebugSessionManager } from '../../../common';
@@ -19,11 +18,10 @@ export interface DebugStackThreadViewProps {
19
18
  viewState: ViewState;
20
19
  thread: DebugThread;
21
20
  indent?: number;
22
- isBottom?: boolean;
23
21
  }
24
22
 
25
23
  export const DebugStackThreadView = (props: DebugStackThreadViewProps) => {
26
- const { thread, viewState, indent, session, isBottom } = props;
24
+ const { thread, viewState, indent, session } = props;
27
25
  const manager = useInjectable<DebugSessionManager>(IDebugSessionManager);
28
26
  const debugCallStackService = useInjectable<DebugCallStackService>(DebugCallStackService);
29
27
  const [expanded, setExpanded] = useState<boolean>(true);
@@ -60,15 +58,6 @@ export const DebugStackThreadView = (props: DebugStackThreadViewProps) => {
60
58
  };
61
59
  }, []);
62
60
 
63
- const statusDescription =
64
- thread.stopped && thread.stoppedDetails
65
- ? thread.raw.id === thread.stoppedDetails.threadId
66
- ? `${localize('debug.stack.frame.because')} ${thread.stoppedDetails.reason} ${localize(
67
- 'debug.stack.frame.stopped',
68
- )}`
69
- : localize('debug.stack.frame.stopped')
70
- : localize('debug.stack.frame.running');
71
-
72
61
  return (
73
62
  <div
74
63
  className={styles.debug_stack_item}
@@ -92,7 +81,13 @@ export const DebugStackThreadView = (props: DebugStackThreadViewProps) => {
92
81
  <DebugStackOperationView thread={thread} />
93
82
  </div>
94
83
  <span className={styles.debug_threads_description}>
95
- <Badge>{statusDescription.toUpperCase()}</Badge>
84
+ {thread.stopped && thread.stoppedDetails
85
+ ? thread.raw.id === thread.stoppedDetails.threadId
86
+ ? `${localize('debug.stack.frame.because')} ${thread.stoppedDetails.reason} ${localize(
87
+ 'debug.stack.frame.stopped',
88
+ )}`
89
+ : localize('debug.stack.frame.stopped')
90
+ : localize('debug.stack.frame.running')}
96
91
  </span>
97
92
  </>
98
93
  </div>
@@ -100,7 +95,6 @@ export const DebugStackThreadView = (props: DebugStackThreadViewProps) => {
100
95
  {(!mutiple || expanded) && thread.frames.length > 0 && (
101
96
  <DebugStackFramesView
102
97
  indent={mutiple ? (mutipleS ? 24 + 14 : 16 + 14) : 8}
103
- isBottom={isBottom}
104
98
  viewState={viewState}
105
99
  thread={thread}
106
100
  frames={frames}
@@ -126,7 +126,7 @@
126
126
  flex: 1;
127
127
  margin-right: 12px;
128
128
  &.label {
129
- text-align: left;
129
+ text-align: center;
130
130
  min-width: fit-content;
131
131
  opacity: 0.7;
132
132
  }
@@ -148,6 +148,7 @@
148
148
  color: var(--badge-foreground);
149
149
  font-size: 12px;
150
150
  margin-left: 5px;
151
+ display: inline-block;
151
152
  }
152
153
  .debug_stack_frames_item_hidden {
153
154
  opacity: 0.4;
@@ -1,14 +0,0 @@
1
- import { IBasicTreeData } from '@opensumi/ide-components';
2
- import { URI } from '@opensumi/ide-core-common';
3
- import { BreakpointItem } from './debug-breakpoints.view';
4
- export declare class BreakpointsTreeNode implements IBasicTreeData {
5
- label: string;
6
- rawData: BreakpointItem;
7
- private _uri;
8
- private _onDescriptionChange;
9
- constructor(uri: URI, rawData: BreakpointItem);
10
- get breakpoint(): import("../../../index").IDebugBreakpoint | import("../../breakpoint").IExceptionBreakpoint;
11
- get uri(): URI;
12
- fireDescriptionChange(value: string): void;
13
- }
14
- //# sourceMappingURL=debug-breakpoints-tree.model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-breakpoints-tree.model.d.ts","sourceRoot":"","sources":["../../../../src/browser/view/breakpoints/debug-breakpoints-tree.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAW,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAIzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,qBAAa,mBAAoB,YAAW,cAAc;IACjD,KAAK,SAAM;IACX,OAAO,EAAE,cAAc,CAAC;IAC/B,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,CAAC,oBAAoB,CAAyB;gBAEzC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc;IAS7C,IAAI,UAAU,gGAEb;IAED,IAAI,GAAG,QAEN;IAED,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAI3C"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BreakpointsTreeNode = void 0;
4
- const ide_core_common_1 = require("@opensumi/ide-core-common");
5
- const breakpoint_1 = require("../../breakpoint");
6
- class BreakpointsTreeNode {
7
- constructor(uri, rawData) {
8
- this.label = '';
9
- this._onDescriptionChange = new ide_core_common_1.Emitter();
10
- const { breakpoint } = rawData;
11
- this._uri = uri;
12
- this.label = (0, breakpoint_1.isDebugBreakpoint)(breakpoint) ? uri.displayName : '';
13
- this.rawData = rawData;
14
- this.rawData.onDescriptionChange = this._onDescriptionChange.event;
15
- }
16
- get breakpoint() {
17
- return this.rawData.breakpoint;
18
- }
19
- get uri() {
20
- return this._uri;
21
- }
22
- fireDescriptionChange(value) {
23
- this.rawData.description = value;
24
- this._onDescriptionChange.fire(value);
25
- }
26
- }
27
- exports.BreakpointsTreeNode = BreakpointsTreeNode;
28
- //# sourceMappingURL=debug-breakpoints-tree.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-breakpoints-tree.model.js","sourceRoot":"","sources":["../../../../src/browser/view/breakpoints/debug-breakpoints-tree.model.ts"],"names":[],"mappings":";;;AACA,+DAAyD;AAEzD,iDAAqD;AAIrD,MAAa,mBAAmB;IAM9B,YAAY,GAAQ,EAAE,OAAuB;QALtC,UAAK,GAAG,EAAE,CAAC;QAGV,yBAAoB,GAAG,IAAI,yBAAO,EAAU,CAAC;QAGnD,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE/B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,IAAA,8BAAiB,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACrE,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IACjC,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,qBAAqB,CAAC,KAAa;QACjC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC;QACjC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;CACF;AA3BD,kDA2BC"}
@@ -1,35 +0,0 @@
1
- import { IBasicTreeData } from '@opensumi/ide-components';
2
- import { Emitter, URI } from '@opensumi/ide-core-common';
3
-
4
- import { isDebugBreakpoint } from '../../breakpoint';
5
-
6
- import { BreakpointItem } from './debug-breakpoints.view';
7
-
8
- export class BreakpointsTreeNode implements IBasicTreeData {
9
- public label = '';
10
- public rawData: BreakpointItem;
11
- private _uri: URI;
12
- private _onDescriptionChange = new Emitter<string>();
13
-
14
- constructor(uri: URI, rawData: BreakpointItem) {
15
- const { breakpoint } = rawData;
16
-
17
- this._uri = uri;
18
- this.label = isDebugBreakpoint(breakpoint) ? uri.displayName : '';
19
- this.rawData = rawData;
20
- this.rawData.onDescriptionChange = this._onDescriptionChange.event;
21
- }
22
-
23
- get breakpoint() {
24
- return this.rawData.breakpoint;
25
- }
26
-
27
- get uri() {
28
- return this._uri;
29
- }
30
-
31
- fireDescriptionChange(value: string): void {
32
- this.rawData.description = value;
33
- this._onDescriptionChange.fire(value);
34
- }
35
- }