@opensumi/ide-debug 2.23.3 → 2.23.4-rc-1681355094.0

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 +2 -0
  2. package/lib/browser/breakpoint/breakpoint-marker.d.ts.map +1 -1
  3. package/lib/browser/breakpoint/breakpoint-marker.js +4 -1
  4. package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -1
  5. package/lib/browser/model/debug-stack-frame.d.ts +12 -0
  6. package/lib/browser/model/debug-stack-frame.d.ts.map +1 -1
  7. package/lib/browser/model/debug-stack-frame.js +27 -1
  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 +6 -4
  11. package/lib/browser/model/debug-thread.js.map +1 -1
  12. package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.d.ts +14 -0
  13. package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.d.ts.map +1 -0
  14. package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.js +28 -0
  15. package/lib/browser/view/breakpoints/debug-breakpoints-tree.model.js.map +1 -0
  16. package/lib/browser/view/breakpoints/debug-breakpoints.module.less +5 -5
  17. package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts +8 -3
  18. package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts.map +1 -1
  19. package/lib/browser/view/breakpoints/debug-breakpoints.service.js +76 -32
  20. package/lib/browser/view/breakpoints/debug-breakpoints.service.js.map +1 -1
  21. package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts +2 -1
  22. package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts.map +1 -1
  23. package/lib/browser/view/breakpoints/debug-breakpoints.view.js +60 -12
  24. package/lib/browser/view/breakpoints/debug-breakpoints.view.js.map +1 -1
  25. package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts +1 -0
  26. package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts.map +1 -1
  27. package/lib/browser/view/frames/debug-call-stack-frame.view.js +136 -26
  28. package/lib/browser/view/frames/debug-call-stack-frame.view.js.map +1 -1
  29. package/lib/browser/view/frames/debug-call-stack-session.view.d.ts.map +1 -1
  30. package/lib/browser/view/frames/debug-call-stack-session.view.js +17 -10
  31. package/lib/browser/view/frames/debug-call-stack-session.view.js.map +1 -1
  32. package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts +1 -0
  33. package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts.map +1 -1
  34. package/lib/browser/view/frames/debug-call-stack-thread.view.js +10 -7
  35. package/lib/browser/view/frames/debug-call-stack-thread.view.js.map +1 -1
  36. package/lib/browser/view/frames/debug-call-stack.module.less +1 -2
  37. package/package.json +23 -23
  38. package/src/browser/breakpoint/breakpoint-marker.ts +3 -1
  39. package/src/browser/model/debug-stack-frame.ts +28 -2
  40. package/src/browser/model/debug-thread.ts +6 -4
  41. package/src/browser/view/breakpoints/debug-breakpoints-tree.model.ts +35 -0
  42. package/src/browser/view/breakpoints/debug-breakpoints.module.less +5 -5
  43. package/src/browser/view/breakpoints/debug-breakpoints.service.ts +78 -30
  44. package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +118 -24
  45. package/src/browser/view/frames/debug-call-stack-frame.view.tsx +184 -51
  46. package/src/browser/view/frames/debug-call-stack-session.view.tsx +29 -15
  47. package/src/browser/view/frames/debug-call-stack-thread.view.tsx +14 -8
  48. package/src/browser/view/frames/debug-call-stack.module.less +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"debug-call-stack-thread.view.js","sourceRoot":"","sources":["../../../../src/browser/view/frames/debug-call-stack-thread.view.tsx"],"names":[],"mappings":";;;;AAAA,uDAAgE;AAEhE,iEAA+G;AAE/G,4CAAuD;AAMvD,+EAAqE;AACrE,0GAAoD;AACpD,6EAAuE;AACvE,yEAAmE;AAS5D,MAAM,oBAAoB,GAAG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AAM,CAAC,GAAG,CAAC,EAAE,KAAK,MAAM,CAAC,cAAc,CAAC,QAAQ;wBAChD,CAAC,CAAC,GAAG,IAAA,2BAAQ,EAAC,2BAA2B,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,IAAI,IAAA,2BAAQ,EAClF,2BAA2B,CAC5B,EAAE;wBACL,CAAC,CAAC,IAAA,2BAAQ,EAAC,2BAA2B,CAAC;oBACzC,CAAC,CAAC,IAAA,2BAAQ,EAAC,2BAA2B,CAAC,CACpC,CACN,CACC,CACP;QACA,CAAC,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACrD,8BAAC,kDAAoB,IACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EACpD,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GAChB,CACH,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAnFW,QAAA,oBAAoB,wBAmF/B"}
1
+ {"version":3,"file":"debug-call-stack-thread.view.js","sourceRoot":"","sources":["../../../../src/browser/view/frames/debug-call-stack-thread.view.tsx"],"names":[],"mappings":";;;;AAAA,uDAAgE;AAEhE,6DAAiD;AACjD,iEAA+G;AAE/G,4CAAuD;AAMvD,+EAAqE;AACrE,0GAAoD;AACpD,6EAAuE;AACvE,yEAAmE;AAU5D,MAAM,oBAAoB,GAAG,CAAC,KAAgC,EAAE,EAAE;;IACvE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAA,gCAAa,EAAsB,6BAAoB,CAAC,CAAC;IACz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AClE;gBACE,uCAAK,SAAS,EAAE,sCAAM,CAAC,uBAAuB;oBAC5C,8BAAC,oDAAuB,IAAC,MAAM,EAAE,MAAM,GAAI,CACvC;gBACN,wCAAM,SAAS,EAAE,sCAAM,CAAC,yBAAyB;oBAC/C,8BAAC,sBAAK,QAAE,iBAAiB,CAAC,WAAW,EAAE,CAAS,CAC3C,CACN,CACC,CACP;QACA,CAAC,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACrD,8BAAC,kDAAoB,IACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EACpD,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GAChB,CACH,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAvFW,QAAA,oBAAoB,wBAuF/B"}
@@ -126,7 +126,7 @@
126
126
  flex: 1;
127
127
  margin-right: 12px;
128
128
  &.label {
129
- text-align: center;
129
+ text-align: left;
130
130
  min-width: fit-content;
131
131
  opacity: 0.7;
132
132
  }
@@ -148,7 +148,6 @@
148
148
  color: var(--badge-foreground);
149
149
  font-size: 12px;
150
150
  margin-left: 5px;
151
- display: inline-block;
152
151
  }
153
152
  .debug_stack_frames_item_hidden {
154
153
  opacity: 0.4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/ide-debug",
3
- "version": "2.23.3",
3
+ "version": "2.23.4-rc-1681355094.0",
4
4
  "files": [
5
5
  "lib",
6
6
  "src"
@@ -17,33 +17,33 @@
17
17
  "url": "git@github.com:opensumi/core.git"
18
18
  },
19
19
  "dependencies": {
20
- "@opensumi/ide-connection": "2.23.3",
21
- "@opensumi/ide-core-common": "2.23.3",
22
- "@opensumi/ide-core-node": "2.23.3",
23
- "@opensumi/ide-file-service": "2.23.3",
24
- "@opensumi/ide-task": "2.23.3",
25
- "@opensumi/ide-terminal-next": "2.23.3",
20
+ "@opensumi/ide-connection": "2.23.4-rc-1681355094.0",
21
+ "@opensumi/ide-core-common": "2.23.4-rc-1681355094.0",
22
+ "@opensumi/ide-core-node": "2.23.4-rc-1681355094.0",
23
+ "@opensumi/ide-file-service": "2.23.4-rc-1681355094.0",
24
+ "@opensumi/ide-task": "2.23.4-rc-1681355094.0",
25
+ "@opensumi/ide-terminal-next": "2.23.4-rc-1681355094.0",
26
26
  "anser": "^1.4.9",
27
27
  "btoa": "^1.2.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@opensumi/ide-components": "2.23.3",
31
- "@opensumi/ide-core-browser": "2.23.3",
30
+ "@opensumi/ide-components": "2.23.4-rc-1681355094.0",
31
+ "@opensumi/ide-core-browser": "2.23.4-rc-1681355094.0",
32
32
  "@opensumi/ide-dev-tool": "1.3.1",
33
- "@opensumi/ide-editor": "2.23.3",
34
- "@opensumi/ide-main-layout": "2.23.3",
35
- "@opensumi/ide-monaco": "2.23.3",
36
- "@opensumi/ide-monaco-enhance": "2.23.3",
37
- "@opensumi/ide-output": "2.23.3",
38
- "@opensumi/ide-overlay": "2.23.3",
39
- "@opensumi/ide-preferences": "2.23.3",
40
- "@opensumi/ide-quick-open": "2.23.3",
41
- "@opensumi/ide-storage": "2.23.3",
42
- "@opensumi/ide-theme": "2.23.3",
43
- "@opensumi/ide-variable": "2.23.3",
44
- "@opensumi/ide-workspace": "2.23.3",
45
- "@opensumi/ide-workspace-edit": "2.23.3",
33
+ "@opensumi/ide-editor": "2.23.4-rc-1681355094.0",
34
+ "@opensumi/ide-main-layout": "2.23.4-rc-1681355094.0",
35
+ "@opensumi/ide-monaco": "2.23.4-rc-1681355094.0",
36
+ "@opensumi/ide-monaco-enhance": "2.23.4-rc-1681355094.0",
37
+ "@opensumi/ide-output": "2.23.4-rc-1681355094.0",
38
+ "@opensumi/ide-overlay": "2.23.4-rc-1681355094.0",
39
+ "@opensumi/ide-preferences": "2.23.4-rc-1681355094.0",
40
+ "@opensumi/ide-quick-open": "2.23.4-rc-1681355094.0",
41
+ "@opensumi/ide-storage": "2.23.4-rc-1681355094.0",
42
+ "@opensumi/ide-theme": "2.23.4-rc-1681355094.0",
43
+ "@opensumi/ide-variable": "2.23.4-rc-1681355094.0",
44
+ "@opensumi/ide-workspace": "2.23.4-rc-1681355094.0",
45
+ "@opensumi/ide-workspace-edit": "2.23.4-rc-1681355094.0",
46
46
  "@types/btoa": "^1.2.3"
47
47
  },
48
- "gitHead": "88cbaea169c860d1157b046362f005d9bc475bbd"
48
+ "gitHead": "658765398c518774a248005d9b46a720b2159c5b"
49
49
  }
@@ -1,12 +1,14 @@
1
1
  import btoa from 'btoa';
2
2
 
3
- import { URI } from '@opensumi/ide-core-common';
3
+ import { Schemes, URI } from '@opensumi/ide-core-common';
4
4
  import { DebugProtocol } from '@opensumi/vscode-debugprotocol/lib/debugProtocol';
5
5
 
6
6
  import { IRuntimeBreakpoint, IDebugBreakpoint } from '../../common';
7
7
  import { Marker } from '../markers';
8
8
 
9
9
  export const BREAKPOINT_KIND = 'breakpoint';
10
+ export const EXCEPTION_BREAKPOINT_KIND = 'exception_breakpoint';
11
+ export const EXCEPTION_BREAKPOINT_URI = URI.parse(EXCEPTION_BREAKPOINT_KIND).withScheme(Schemes.inMemory);
10
12
 
11
13
  function generateId(uri: string, line: number, column = 1) {
12
14
  return btoa(`${uri}:${line}:${column}`);
@@ -1,4 +1,4 @@
1
- import { IRange } from '@opensumi/ide-core-browser';
1
+ import { formatLocalize, 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,12 +9,15 @@ 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
-
13
12
  export class DebugStackFrameData {
14
13
  readonly raw: DebugProtocol.StackFrame;
15
14
  }
16
15
 
17
16
  export class DebugStackFrame extends DebugStackFrameData {
17
+ public static is(frame: any): frame is DebugStackFrame {
18
+ return !!frame && 'raw' in frame;
19
+ }
20
+
18
21
  constructor(readonly thread: DebugThread, readonly session: DebugSession) {
19
22
  super();
20
23
  }
@@ -109,3 +112,26 @@ export class DebugStackFrame extends DebugStackFrameData {
109
112
  return scopesContainingRange.length ? scopesContainingRange : nonExpensiveScopes;
110
113
  }
111
114
  }
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,10 +158,12 @@ 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
- 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);
161
+ if (!this._frames.has(id)) {
162
+ const frame = new DebugStackFrame(this, this.session);
163
+ this._frames.set(id, frame);
164
+ frame.update({ raw });
165
+ result.set(id, frame);
166
+ }
165
167
  }
166
168
  const values = [...result.values()];
167
169
  frontEndTime('doUpdateFrames');
@@ -0,0 +1,35 @@
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
+ }
@@ -21,8 +21,6 @@
21
21
  pointer-events: none;
22
22
  }
23
23
  &:hover {
24
- background: var(--list-hoverBackground);
25
- color: var(--list-hoverForeground);
26
24
  .debug_remove_breakpoints_icon {
27
25
  display: inline-block;
28
26
  pointer-events: all;
@@ -51,9 +49,7 @@
51
49
 
52
50
  .debug_breakpoints_description {
53
51
  display: block;
54
- transform: scale(0.95);
55
- opacity: 0.7;
56
- margin-left: 5px;
52
+ opacity: 0.85;
57
53
  display: inline;
58
54
  }
59
55
 
@@ -69,3 +65,7 @@
69
65
  margin-right: 5px;
70
66
  flex: 1;
71
67
  }
68
+
69
+ .debug_breakpoints_item_tree_node {
70
+ padding-left: 22px !important;
71
+ }
@@ -1,7 +1,16 @@
1
1
  import { observable, action, runInAction } from 'mobx';
2
2
 
3
3
  import { Injectable, Autowired } from '@opensumi/di';
4
- import { URI, WithEventBus, OnEvent, IContextKeyService, IReporterService, Schemes } from '@opensumi/ide-core-browser';
4
+ import {
5
+ URI,
6
+ WithEventBus,
7
+ OnEvent,
8
+ IContextKeyService,
9
+ IReporterService,
10
+ Schemes,
11
+ Emitter,
12
+ Event,
13
+ } from '@opensumi/ide-core-browser';
5
14
  import { LabelService } from '@opensumi/ide-core-browser/lib/services';
6
15
  import { ICodeEditor, EditorCollectionService, getSimpleEditorOptions } from '@opensumi/ide-editor';
7
16
  import { IEditorDocumentModelService } from '@opensumi/ide-editor/lib/browser';
@@ -16,10 +25,12 @@ import {
16
25
  isDebugExceptionBreakpoint,
17
26
  BreakpointManager,
18
27
  DebugDecorator,
28
+ EXCEPTION_BREAKPOINT_URI,
19
29
  } from '../../breakpoint';
20
30
  import { DebugSessionManager } from '../../debug-session-manager';
21
31
  import { DebugViewModel } from '../debug-view-model';
22
32
 
33
+ import { BreakpointsTreeNode } from './debug-breakpoints-tree.model';
23
34
  import { BreakpointItem } from './debug-breakpoints.view';
24
35
 
25
36
  @Injectable()
@@ -51,14 +62,17 @@ export class DebugBreakpointsService extends WithEventBus {
51
62
  @Autowired(IEditorDocumentModelService)
52
63
  protected readonly documentService: IEditorDocumentModelService;
53
64
 
65
+ private readonly _onDidChangeBreakpointsTreeNode = new Emitter<Map<string, BreakpointsTreeNode[]>>();
66
+ readonly onDidChangeBreakpointsTreeNode: Event<Map<string, BreakpointsTreeNode[]>> =
67
+ this._onDidChangeBreakpointsTreeNode.event;
68
+
54
69
  private _inputEditor: ICodeEditor;
55
70
 
56
71
  public get inputEditor(): ICodeEditor {
57
72
  return this._inputEditor;
58
73
  }
59
74
 
60
- @observable
61
- public nodes: BreakpointItem[] = [];
75
+ public treeNodeMap: Map<string, BreakpointsTreeNode[]> = new Map();
62
76
 
63
77
  @observable
64
78
  public enable: boolean;
@@ -139,38 +153,72 @@ export class DebugBreakpointsService extends WithEventBus {
139
153
  }
140
154
  }
141
155
 
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;
156
+ extractNodes(item: DebugExceptionBreakpoint | IDebugBreakpoint): BreakpointItem | undefined {
157
+ if (isDebugBreakpoint(item)) {
158
+ return {
159
+ id: item.id,
160
+ name: '',
161
+ description: '',
162
+ onDescriptionChange: Event.None,
163
+ breakpoint: item,
164
+ };
165
+ }
166
+ if (isDebugExceptionBreakpoint(item)) {
167
+ return {
168
+ id: item.filter,
169
+ name: item.label,
170
+ onDescriptionChange: Event.None,
171
+ description: '',
172
+ breakpoint: item,
173
+ };
174
+ }
165
175
  }
166
176
 
167
177
  @action
168
178
  private async updateBreakpoints() {
169
179
  await this.breakpoints.whenReady;
170
- this.nodes = this.extractNodes([
171
- ...this.breakpoints.getExceptionBreakpoints(),
172
- ...this.breakpoints.getBreakpoints(),
173
- ]);
180
+ this.treeNodeMap.clear();
181
+
182
+ const allBreakpoints = [...this.breakpoints.getExceptionBreakpoints(), ...this.breakpoints.getBreakpoints()];
183
+
184
+ allBreakpoints.forEach((item) => {
185
+ const extractNode = this.extractNodes(item);
186
+ if (extractNode) {
187
+ const uri = isDebugBreakpoint(item) ? URI.parse(item.uri) : EXCEPTION_BREAKPOINT_URI;
188
+ const getTreeNodes = this.treeNodeMap.get(uri.toString()) || [];
189
+ getTreeNodes.push(new BreakpointsTreeNode(uri, extractNode));
190
+ this.treeNodeMap.set(uri.toString(), getTreeNodes);
191
+ }
192
+ });
193
+
194
+ this._onDidChangeBreakpointsTreeNode.fire(this.treeNodeMap);
195
+ }
196
+
197
+ private async getDocumentModelRef(uri: URI) {
198
+ const document = this.documentService.getModelReference(uri);
199
+ if (!document) {
200
+ return this.documentService.createModelReference(uri);
201
+ }
202
+ return document;
203
+ }
204
+
205
+ public async refreshBreakpointsInfo() {
206
+ const treeNodeValues = this.treeNodeMap.values();
207
+ const allTreeNodes: BreakpointsTreeNode[] = Array.from(treeNodeValues).reduce((acc, cur) => acc.concat(cur), []);
208
+
209
+ for await (const node of allTreeNodes) {
210
+ const { rawData, uri } = node;
211
+ if (isDebugBreakpoint(rawData.breakpoint)) {
212
+ const line = rawData.breakpoint.raw.line;
213
+ const monacoModel = await this.getDocumentModelRef(uri);
214
+ if (!monacoModel) {
215
+ return;
216
+ }
217
+
218
+ const getContent = monacoModel.instance.getMonacoModel().getLineContent(line);
219
+ node.fireDescriptionChange(getContent.trim());
220
+ }
221
+ }
174
222
  }
175
223
 
176
224
  removeAllBreakpoints() {
@@ -1,14 +1,36 @@
1
1
  import cls from 'classnames';
2
2
  import { observer } from 'mobx-react-lite';
3
- import React from 'react';
3
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
4
4
 
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';
5
+ import {
6
+ BasicRecycleTree,
7
+ CheckBox,
8
+ IBasicTreeData,
9
+ ICompositeTreeNode,
10
+ ITreeNodeOrCompositeTreeNode,
11
+ } from '@opensumi/ide-components';
12
+ import { Badge } from '@opensumi/ide-components';
13
+ import {
14
+ useInjectable,
15
+ CommandService,
16
+ EDITOR_COMMANDS,
17
+ URI,
18
+ getIcon,
19
+ Disposable,
20
+ ViewState,
21
+ Event,
22
+ } from '@opensumi/ide-core-browser';
8
23
  import { DebugProtocol } from '@opensumi/vscode-debugprotocol/lib/debugProtocol';
9
24
 
10
25
  import { IDebugBreakpoint, IDebugSessionManager, ISourceBreakpoint } from '../../../common';
11
- import { DebugExceptionBreakpoint, isDebugBreakpoint, isRuntimeBreakpoint, getStatus } from '../../breakpoint';
26
+ import {
27
+ DebugExceptionBreakpoint,
28
+ isDebugBreakpoint,
29
+ isRuntimeBreakpoint,
30
+ getStatus,
31
+ isDebugExceptionBreakpoint,
32
+ EXCEPTION_BREAKPOINT_URI,
33
+ } from '../../breakpoint';
12
34
  import { DebugSessionManager } from '../../debug-session-manager';
13
35
 
14
36
  import styles from './debug-breakpoints.module.less';
@@ -18,29 +40,94 @@ export interface BreakpointItem {
18
40
  name: string;
19
41
  id: string;
20
42
  description: string;
43
+ onDescriptionChange: Event<string>;
21
44
  breakpoint: IDebugBreakpoint | DebugExceptionBreakpoint;
22
45
  }
23
46
 
24
47
  export const DebugBreakpointView = observer(({ viewState }: React.PropsWithChildren<{ viewState: ViewState }>) => {
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>
34
- );
48
+ const debugBreakpointsService: DebugBreakpointsService = useInjectable(DebugBreakpointsService);
49
+ const { enable, toggleBreakpointEnable } = debugBreakpointsService;
50
+ const [treeData, setTreeData] = useState<IBasicTreeData[]>([]);
51
+
52
+ useEffect(() => {
53
+ const dispose = new Disposable();
54
+
55
+ dispose.addDispose(
56
+ debugBreakpointsService.onDidChangeBreakpointsTreeNode((nodes) => {
57
+ const { roots } = debugBreakpointsService;
58
+ const breakpointTreeData: IBasicTreeData[] = [];
59
+
60
+ Array.from(nodes.entries()).forEach(([uri, items]) => {
61
+ const isException = EXCEPTION_BREAKPOINT_URI.toString() === uri;
62
+
63
+ if (isException) {
64
+ items.forEach((item) => {
65
+ breakpointTreeData.push({
66
+ label: '',
67
+ expandable: false,
68
+ children: [],
69
+ description: (
70
+ <BreakpointItem
71
+ toggle={() => toggleBreakpointEnable(item.breakpoint)}
72
+ breakpointEnabled={enable}
73
+ data={item.rawData}
74
+ isDebugMode={debugBreakpointsService.inDebugMode}
75
+ ></BreakpointItem>
76
+ ),
77
+ });
78
+ });
79
+ } else {
80
+ const toURI = URI.parse(uri);
81
+ const parent = roots.filter((root) => root.isEqualOrParent(toURI))[0];
35
82
 
36
- const containerStyle = {
37
- height: viewState.height,
38
- width: viewState.width,
39
- } as React.CSSProperties;
83
+ breakpointTreeData.push({
84
+ label: parent ? parent.relative(toURI)!.toString() : URI.parse(uri).displayName,
85
+ expandable: true,
86
+ iconClassName: getIcon('file-text'),
87
+ expanded: true,
88
+ children: items.map((item) => ({
89
+ ...item,
90
+ label: '',
91
+ expandable: false,
92
+ description: (
93
+ <BreakpointItem
94
+ toggle={() => toggleBreakpointEnable(item.breakpoint)}
95
+ breakpointEnabled={enable}
96
+ data={item.rawData}
97
+ isDebugMode={debugBreakpointsService.inDebugMode}
98
+ ></BreakpointItem>
99
+ ),
100
+ })),
101
+ });
102
+ }
103
+ });
104
+
105
+ setTreeData(breakpointTreeData);
106
+ }),
107
+ );
108
+
109
+ return () => {
110
+ dispose.dispose();
111
+ };
112
+ }, []);
113
+
114
+ useEffect(() => {
115
+ if (treeData.length > 0) {
116
+ requestAnimationFrame(() => {
117
+ debugBreakpointsService.refreshBreakpointsInfo();
118
+ });
119
+ }
120
+ }, [treeData]);
121
+
122
+ const getItemClassName = useCallback((item: ICompositeTreeNode) => {
123
+ if (!item.children) {
124
+ return styles.debug_breakpoints_item_tree_node;
125
+ }
126
+ }, []);
40
127
 
41
128
  return (
42
129
  <div className={cls(styles.debug_breakpoints, !enable && styles.debug_breakpoints_disabled)}>
43
- <RecycleList data={nodes} itemHeight={22} template={template} style={containerStyle} />
130
+ <BasicRecycleTree treeData={treeData} height={viewState.height} getItemClassName={getItemClassName} />
44
131
  </div>
45
132
  );
46
133
  });
@@ -62,6 +149,7 @@ export const BreakpointItem = ({
62
149
  const debugBreakpointsService = useInjectable<DebugBreakpointsService>(DebugBreakpointsService);
63
150
  const [enabled, setEnabled] = React.useState<boolean>(defaultValue);
64
151
  const [status, setStatus] = React.useState<DebugProtocol.Breakpoint | false | undefined>(undefined);
152
+ const [description, setDescription] = React.useState<string>(data.description);
65
153
 
66
154
  const handleBreakpointChange = () => {
67
155
  toggle();
@@ -98,6 +186,8 @@ export const BreakpointItem = ({
98
186
  };
99
187
 
100
188
  React.useEffect(() => {
189
+ const disposable = new Disposable();
190
+
101
191
  const exec = () => {
102
192
  if (isDebugBreakpoint(data.breakpoint) && isRuntimeBreakpoint(data.breakpoint)) {
103
193
  const status = getStatus(data.breakpoint);
@@ -105,9 +195,11 @@ export const BreakpointItem = ({
105
195
  }
106
196
  };
107
197
 
108
- const disposable = manager.onDidChangeActiveDebugSession(() => exec());
198
+ disposable.addDispose(manager.onDidChangeActiveDebugSession(() => exec()));
109
199
  exec();
110
200
 
201
+ disposable.addDispose(data.onDescriptionChange(setDescription));
202
+
111
203
  return () => {
112
204
  setStatus(undefined);
113
205
  disposable.dispose();
@@ -142,13 +234,15 @@ export const BreakpointItem = ({
142
234
  debugBreakpointsService.delBreakpoint(data.breakpoint as IDebugBreakpoint);
143
235
  };
144
236
 
237
+ const isExceptionBreakpoint = useMemo(() => isDebugExceptionBreakpoint(data.breakpoint), [data]);
238
+
145
239
  return (
146
240
  <div className={cls(styles.debug_breakpoints_item)}>
147
- <div className={cls(converBreakpointClsState(), styles.debug_breakpoints_icon)}></div>
241
+ {!isExceptionBreakpoint && <div className={cls(converBreakpointClsState(), styles.debug_breakpoints_icon)}></div>}
148
242
  <CheckBox id={data.id} onChange={handleBreakpointChange} checked={enabled}></CheckBox>
149
243
  <div className={styles.debug_breakpoints_wrapper} onClick={handleBreakpointClick}>
150
- <span className={styles.debug_breakpoints_name}>{data.name}</span>
151
- <span className={styles.debug_breakpoints_description}>{data.description}</span>
244
+ {data.name && <span className={styles.debug_breakpoints_name}>{data.name}</span>}
245
+ <span className={styles.debug_breakpoints_description}>{description}</span>
152
246
  </div>
153
247
  {isDebugBreakpoint(data.breakpoint) ? (
154
248
  <>