@opensumi/ide-debug 2.22.11 → 2.23.1-next-1679481979.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.
- package/lib/browser/breakpoint/breakpoint-manager.d.ts +2 -0
- package/lib/browser/breakpoint/breakpoint-manager.d.ts.map +1 -1
- package/lib/browser/breakpoint/breakpoint-manager.js +5 -0
- package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
- package/lib/browser/contextkeys/debug-contextkey.service.d.ts +1 -1
- package/lib/browser/contextkeys/debug-contextkey.service.d.ts.map +1 -1
- package/lib/browser/contextkeys/debug-contextkey.service.js +1 -1
- package/lib/browser/contextkeys/debug-contextkey.service.js.map +1 -1
- package/lib/browser/debug-session-manager.d.ts.map +1 -1
- package/lib/browser/debug-session-manager.js +1 -5
- package/lib/browser/debug-session-manager.js.map +1 -1
- package/lib/browser/debug-session.js +3 -3
- package/lib/browser/debug-session.js.map +1 -1
- package/lib/browser/editor/debug-editor-contribution.d.ts.map +1 -1
- package/lib/browser/editor/debug-editor-contribution.js +1 -1
- package/lib/browser/editor/debug-editor-contribution.js.map +1 -1
- package/lib/browser/editor/debug-model.d.ts +2 -2
- package/lib/browser/editor/debug-model.d.ts.map +1 -1
- package/lib/browser/editor/debug-model.js +4 -3
- package/lib/browser/editor/debug-model.js.map +1 -1
- package/lib/browser/model/debug-stack-frame.d.ts +12 -0
- package/lib/browser/model/debug-stack-frame.d.ts.map +1 -1
- package/lib/browser/model/debug-stack-frame.js +24 -1
- package/lib/browser/model/debug-stack-frame.js.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.service.d.ts.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js +5 -4
- package/lib/browser/view/breakpoints/debug-breakpoints.service.js.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.view.d.ts.map +1 -1
- package/lib/browser/view/breakpoints/debug-breakpoints.view.js.map +1 -1
- package/lib/browser/view/configuration/debug-toolbar.view.d.ts.map +1 -1
- package/lib/browser/view/configuration/debug-toolbar.view.js +27 -25
- package/lib/browser/view/configuration/debug-toolbar.view.js.map +1 -1
- package/lib/browser/view/console/debug-console.service.js +2 -2
- package/lib/browser/view/console/debug-console.service.js.map +1 -1
- package/lib/browser/view/debug-view-model.d.ts.map +1 -1
- package/lib/browser/view/debug-view-model.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts +1 -0
- package/lib/browser/view/frames/debug-call-stack-frame.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-frame.view.js +101 -26
- package/lib/browser/view/frames/debug-call-stack-frame.view.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-session.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-session.view.js +4 -4
- package/lib/browser/view/frames/debug-call-stack-session.view.js.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts +1 -0
- package/lib/browser/view/frames/debug-call-stack-thread.view.d.ts.map +1 -1
- package/lib/browser/view/frames/debug-call-stack-thread.view.js +3 -3
- package/lib/browser/view/frames/debug-call-stack-thread.view.js.map +1 -1
- package/lib/common/debug-service.d.ts +1 -6
- package/lib/common/debug-service.d.ts.map +1 -1
- package/lib/common/debug-service.js +1 -9
- package/lib/common/debug-service.js.map +1 -1
- package/lib/common/inline-values.d.ts +1 -0
- package/lib/common/inline-values.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/browser/breakpoint/breakpoint-manager.ts +6 -0
- package/src/browser/contextkeys/debug-contextkey.service.ts +2 -2
- package/src/browser/debug-session-manager.ts +1 -7
- package/src/browser/debug-session.ts +3 -3
- package/src/browser/editor/debug-editor-contribution.ts +1 -1
- package/src/browser/editor/debug-model.ts +4 -3
- package/src/browser/model/debug-stack-frame.ts +27 -2
- package/src/browser/view/breakpoints/debug-breakpoints.service.ts +4 -4
- package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +1 -7
- package/src/browser/view/configuration/debug-toolbar.view.tsx +112 -94
- package/src/browser/view/console/debug-console.service.ts +2 -2
- package/src/browser/view/debug-view-model.ts +6 -2
- package/src/browser/view/frames/debug-call-stack-frame.view.tsx +139 -50
- package/src/browser/view/frames/debug-call-stack-session.view.tsx +10 -4
- package/src/browser/view/frames/debug-call-stack-thread.view.tsx +7 -2
- package/src/common/debug-service.ts +1 -15
|
@@ -262,8 +262,8 @@ export class DebugModel implements IDebugModel {
|
|
|
262
262
|
this.renderFrames();
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
render()
|
|
266
|
-
this.renderBreakpoints();
|
|
265
|
+
async render() {
|
|
266
|
+
await this.renderBreakpoints();
|
|
267
267
|
this.renderFrames();
|
|
268
268
|
}
|
|
269
269
|
|
|
@@ -271,7 +271,8 @@ export class DebugModel implements IDebugModel {
|
|
|
271
271
|
* 渲染断点信息装饰器
|
|
272
272
|
* @memberof DebugModel
|
|
273
273
|
*/
|
|
274
|
-
renderBreakpoints()
|
|
274
|
+
async renderBreakpoints() {
|
|
275
|
+
await this.breakpointManager.whenReady;
|
|
275
276
|
this.renderNormalBreakpoints();
|
|
276
277
|
this.renderCurrentBreakpoints();
|
|
277
278
|
}
|
|
@@ -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,25 @@ export class DebugStackFrame extends DebugStackFrameData {
|
|
|
109
112
|
return scopesContainingRange.length ? scopesContainingRange : nonExpensiveScopes;
|
|
110
113
|
}
|
|
111
114
|
}
|
|
115
|
+
|
|
116
|
+
export class ShowMoreDebugStackFrame {
|
|
117
|
+
constructor(
|
|
118
|
+
public readonly startIndex: number,
|
|
119
|
+
public readonly frames: DebugStackFrame[],
|
|
120
|
+
readonly session: DebugSession,
|
|
121
|
+
readonly origin: string,
|
|
122
|
+
readonly _open: (showMoreFrame: ShowMoreDebugStackFrame) => void,
|
|
123
|
+
) {}
|
|
124
|
+
|
|
125
|
+
get name() {
|
|
126
|
+
return formatLocalize('debug.stack.showMoreAndOrigin', this.frames.length, this.origin);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
get id(): string {
|
|
130
|
+
return `${this.session.id}:showMore:${this.startIndex}`;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
open = () => {
|
|
134
|
+
this._open(this);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
@@ -11,7 +11,6 @@ import { WorkspaceEditDidRenameFileEvent, WorkspaceEditDidDeleteFileEvent } from
|
|
|
11
11
|
import { DEBUG_REPORT_NAME, CONTEXT_IN_DEBUG_MODE_KEY, IDebugBreakpoint } from '../../../common';
|
|
12
12
|
import { IDebugSessionManager } from '../../../common/debug-session';
|
|
13
13
|
import {
|
|
14
|
-
DebugBreakpoint,
|
|
15
14
|
DebugExceptionBreakpoint,
|
|
16
15
|
isDebugBreakpoint,
|
|
17
16
|
isDebugExceptionBreakpoint,
|
|
@@ -76,9 +75,9 @@ export class DebugBreakpointsService extends WithEventBus {
|
|
|
76
75
|
|
|
77
76
|
async init() {
|
|
78
77
|
await this.updateRoots();
|
|
79
|
-
this.updateBreakpoints();
|
|
78
|
+
await this.updateBreakpoints();
|
|
80
79
|
this.workspaceService.onWorkspaceChanged(async () => {
|
|
81
|
-
|
|
80
|
+
this.updateRoots();
|
|
82
81
|
this.updateBreakpoints();
|
|
83
82
|
});
|
|
84
83
|
this.breakpoints.onDidChangeBreakpoints(() => {
|
|
@@ -166,7 +165,8 @@ export class DebugBreakpointsService extends WithEventBus {
|
|
|
166
165
|
}
|
|
167
166
|
|
|
168
167
|
@action
|
|
169
|
-
private updateBreakpoints() {
|
|
168
|
+
private async updateBreakpoints() {
|
|
169
|
+
await this.breakpoints.whenReady;
|
|
170
170
|
this.nodes = this.extractNodes([
|
|
171
171
|
...this.breakpoints.getExceptionBreakpoints(),
|
|
172
172
|
...this.breakpoints.getBreakpoints(),
|
|
@@ -8,13 +8,7 @@ import { useInjectable, ViewState, CommandService, EDITOR_COMMANDS, URI, getIcon
|
|
|
8
8
|
import { DebugProtocol } from '@opensumi/vscode-debugprotocol/lib/debugProtocol';
|
|
9
9
|
|
|
10
10
|
import { IDebugBreakpoint, IDebugSessionManager, ISourceBreakpoint } from '../../../common';
|
|
11
|
-
import {
|
|
12
|
-
DebugBreakpoint,
|
|
13
|
-
DebugExceptionBreakpoint,
|
|
14
|
-
isDebugBreakpoint,
|
|
15
|
-
isRuntimeBreakpoint,
|
|
16
|
-
getStatus,
|
|
17
|
-
} from '../../breakpoint';
|
|
11
|
+
import { DebugExceptionBreakpoint, isDebugBreakpoint, isRuntimeBreakpoint, getStatus } from '../../breakpoint';
|
|
18
12
|
import { DebugSessionManager } from '../../debug-session-manager';
|
|
19
13
|
|
|
20
14
|
import styles from './debug-breakpoints.module.less';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import cls from 'classnames';
|
|
2
2
|
import { action, observable } from 'mobx';
|
|
3
3
|
import { observer } from 'mobx-react-lite';
|
|
4
|
-
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
5
5
|
|
|
6
6
|
import { Injectable } from '@opensumi/di';
|
|
7
7
|
import { Option, Select } from '@opensumi/ide-components';
|
|
@@ -104,63 +104,80 @@ export const DebugToolbarView = observer((props: DebugToolbarViewProps) => {
|
|
|
104
104
|
|
|
105
105
|
const currentSessionId = currentSession && currentSession.id;
|
|
106
106
|
|
|
107
|
-
const renderToolBar = (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
const renderToolBar = useCallback(
|
|
108
|
+
(session: DebugSession | undefined): React.ReactNode => {
|
|
109
|
+
if (session && session.id) {
|
|
110
|
+
const menus = toolBarMenuMap.get(session.id);
|
|
111
|
+
if (menus) {
|
|
112
|
+
return <InlineMenuBar menus={menus} />;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
},
|
|
117
|
+
[toolBarMenuMap],
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const renderStop = useCallback(
|
|
121
|
+
(state: DebugState): React.ReactNode => {
|
|
122
|
+
if (isAttach) {
|
|
123
|
+
return (
|
|
124
|
+
<DebugAction
|
|
125
|
+
run={doStop}
|
|
126
|
+
enabled={typeof state === 'number' && state !== DebugState.Inactive}
|
|
127
|
+
icon={'disconnect'}
|
|
128
|
+
label={localize('debug.action.disattach')}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
115
132
|
return (
|
|
116
133
|
<DebugAction
|
|
117
134
|
run={doStop}
|
|
118
135
|
enabled={typeof state === 'number' && state !== DebugState.Inactive}
|
|
119
|
-
icon={'
|
|
120
|
-
label={localize('debug.action.
|
|
136
|
+
icon={'stop'}
|
|
137
|
+
label={localize('debug.action.stop')}
|
|
121
138
|
/>
|
|
122
139
|
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
run={doStop}
|
|
127
|
-
enabled={typeof state === 'number' && state !== DebugState.Inactive}
|
|
128
|
-
icon={'stop'}
|
|
129
|
-
label={localize('debug.action.stop')}
|
|
130
|
-
/>
|
|
131
|
-
);
|
|
132
|
-
};
|
|
133
|
-
const renderContinue = (state: DebugState): React.ReactNode => {
|
|
134
|
-
if (state === DebugState.Stopped) {
|
|
135
|
-
return <DebugAction run={doContinue} icon={'continue'} label={localize('debug.action.continue')} />;
|
|
136
|
-
}
|
|
137
|
-
return (
|
|
138
|
-
<DebugAction
|
|
139
|
-
run={doPause}
|
|
140
|
-
enabled={typeof state === 'number' && state === DebugState.Running}
|
|
141
|
-
icon={'pause'}
|
|
142
|
-
label={localize('debug.action.pause')}
|
|
143
|
-
/>
|
|
144
|
-
);
|
|
145
|
-
};
|
|
140
|
+
},
|
|
141
|
+
[doStop],
|
|
142
|
+
);
|
|
146
143
|
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
if (
|
|
150
|
-
return (
|
|
151
|
-
<option key={session.id} value={session.id}>
|
|
152
|
-
{session.label}
|
|
153
|
-
</option>
|
|
154
|
-
);
|
|
144
|
+
const renderContinue = useCallback(
|
|
145
|
+
(state: DebugState): React.ReactNode => {
|
|
146
|
+
if (state === DebugState.Stopped) {
|
|
147
|
+
return <DebugAction run={doContinue} icon={'continue'} label={localize('debug.action.continue')} />;
|
|
155
148
|
}
|
|
156
149
|
return (
|
|
157
|
-
<
|
|
158
|
-
{
|
|
159
|
-
|
|
150
|
+
<DebugAction
|
|
151
|
+
run={doPause}
|
|
152
|
+
enabled={typeof state === 'number' && state === DebugState.Running}
|
|
153
|
+
icon={'pause'}
|
|
154
|
+
label={localize('debug.action.pause')}
|
|
155
|
+
/>
|
|
160
156
|
);
|
|
161
|
-
}
|
|
157
|
+
},
|
|
158
|
+
[doPause, doContinue],
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
const renderSessionOptions = useCallback(
|
|
162
|
+
(sessions: DebugSession[]) =>
|
|
163
|
+
sessions.map((session: DebugSession) => {
|
|
164
|
+
if (isElectronRenderer) {
|
|
165
|
+
return (
|
|
166
|
+
<option key={session.id} value={session.id}>
|
|
167
|
+
{session.label}
|
|
168
|
+
</option>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
return (
|
|
172
|
+
<Option key={session.id} label={session.label} value={session.id}>
|
|
173
|
+
{session.label}
|
|
174
|
+
</Option>
|
|
175
|
+
);
|
|
176
|
+
}),
|
|
177
|
+
[],
|
|
178
|
+
);
|
|
162
179
|
|
|
163
|
-
const renderSelections = (sessions: DebugSession[]) => {
|
|
180
|
+
const renderSelections = useCallback((sessions: DebugSession[]) => {
|
|
164
181
|
if (sessions.length > 1) {
|
|
165
182
|
return (
|
|
166
183
|
<div className={cls(styles.debug_selection)}>
|
|
@@ -182,59 +199,60 @@ export const DebugToolbarView = observer((props: DebugToolbarViewProps) => {
|
|
|
182
199
|
</div>
|
|
183
200
|
);
|
|
184
201
|
}
|
|
185
|
-
};
|
|
202
|
+
}, []);
|
|
186
203
|
|
|
187
|
-
const setCurrentSession = (
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
204
|
+
const setCurrentSession = useCallback(
|
|
205
|
+
(event: React.ChangeEvent<HTMLSelectElement> | string | number) => {
|
|
206
|
+
let value = event;
|
|
207
|
+
if (isElectronRenderer) {
|
|
208
|
+
value = (event as React.ChangeEvent<HTMLSelectElement>).target.value;
|
|
209
|
+
}
|
|
192
210
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
for (const session of sessions) {
|
|
197
|
-
if (session.id === value) {
|
|
198
|
-
updateCurrentSession(session);
|
|
211
|
+
if (!sessions) {
|
|
212
|
+
return;
|
|
199
213
|
}
|
|
200
|
-
|
|
201
|
-
|
|
214
|
+
for (const session of sessions) {
|
|
215
|
+
if (session.id === value) {
|
|
216
|
+
updateCurrentSession(session);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
[updateCurrentSession],
|
|
221
|
+
);
|
|
202
222
|
|
|
203
223
|
return (
|
|
204
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
{renderToolBar(currentSession)}
|
|
235
|
-
</div>
|
|
224
|
+
<div className={styles.debug_action_bar}>
|
|
225
|
+
{renderSelections(sessions.filter((s: DebugSession) => !s.parentSession))}
|
|
226
|
+
<div className={styles.debug_actions}>
|
|
227
|
+
{renderContinue(state)}
|
|
228
|
+
<DebugAction
|
|
229
|
+
run={doStepOver}
|
|
230
|
+
enabled={typeof state === 'number' && state === DebugState.Stopped}
|
|
231
|
+
icon={'step'}
|
|
232
|
+
label={localize('debug.action.step-over')}
|
|
233
|
+
/>
|
|
234
|
+
<DebugAction
|
|
235
|
+
run={doStepIn}
|
|
236
|
+
enabled={typeof state === 'number' && state === DebugState.Stopped}
|
|
237
|
+
icon={'step-in'}
|
|
238
|
+
label={localize('debug.action.step-into')}
|
|
239
|
+
/>
|
|
240
|
+
<DebugAction
|
|
241
|
+
run={doStepOut}
|
|
242
|
+
enabled={typeof state === 'number' && state === DebugState.Stopped}
|
|
243
|
+
icon={'step-out'}
|
|
244
|
+
label={localize('debug.action.step-out')}
|
|
245
|
+
/>
|
|
246
|
+
<DebugAction
|
|
247
|
+
run={doRestart}
|
|
248
|
+
enabled={typeof state === 'number' && state !== DebugState.Inactive}
|
|
249
|
+
icon={'reload'}
|
|
250
|
+
label={localize('debug.action.restart')}
|
|
251
|
+
/>
|
|
252
|
+
{renderStop(state)}
|
|
253
|
+
{renderToolBar(currentSession)}
|
|
236
254
|
</div>
|
|
237
|
-
</
|
|
255
|
+
</div>
|
|
238
256
|
);
|
|
239
257
|
});
|
|
240
258
|
|
|
@@ -156,11 +156,11 @@ export class DebugConsoleService implements IHistoryNavigationWidget {
|
|
|
156
156
|
if (inDebugMode) {
|
|
157
157
|
this.updateReadOnly(false);
|
|
158
158
|
this.updateInputDecoration();
|
|
159
|
-
this.debugContextKey.
|
|
159
|
+
this.debugContextKey.contextInDebugMode.set(true);
|
|
160
160
|
} else {
|
|
161
161
|
this.updateReadOnly(true);
|
|
162
162
|
if (this.debugContextKey) {
|
|
163
|
-
this.debugContextKey.
|
|
163
|
+
this.debugContextKey.contextInDebugMode.set(false);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
}
|
|
@@ -24,7 +24,6 @@ import { DebugSessionManager } from '../debug-session-manager';
|
|
|
24
24
|
import { DebugStackFrame } from '../model/debug-stack-frame';
|
|
25
25
|
import { DebugThread } from '../model/debug-thread';
|
|
26
26
|
|
|
27
|
-
|
|
28
27
|
@Injectable()
|
|
29
28
|
export class DebugViewModel implements IDisposable {
|
|
30
29
|
@Autowired(IDebugSessionManager)
|
|
@@ -43,7 +42,6 @@ export class DebugViewModel implements IDisposable {
|
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
protected readonly toDispose = new DisposableCollection(this.onDidChangeEmitter, this.onDidChangeBreakpointsEmitter);
|
|
46
|
-
|
|
47
45
|
protected readonly _sessions = new Set<DebugSession>();
|
|
48
46
|
|
|
49
47
|
get sessions(): IterableIterator<DebugSession> {
|
|
@@ -77,9 +75,11 @@ export class DebugViewModel implements IDisposable {
|
|
|
77
75
|
get id(): string {
|
|
78
76
|
return (this.session && this.session.id) || '-1';
|
|
79
77
|
}
|
|
78
|
+
|
|
80
79
|
get label(): string {
|
|
81
80
|
return (this.session && this.session.label) || 'Unknown Session';
|
|
82
81
|
}
|
|
82
|
+
|
|
83
83
|
has(session: DebugSession | undefined): session is DebugSession {
|
|
84
84
|
return !!session && this._sessions.has(session);
|
|
85
85
|
}
|
|
@@ -120,10 +120,12 @@ export class DebugViewModel implements IDisposable {
|
|
|
120
120
|
return this.manager.currentSession.getThreads(() => true);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
+
|
|
123
124
|
get currentSession(): DebugSession | undefined {
|
|
124
125
|
const { currentSession } = this.manager;
|
|
125
126
|
return (this.has(currentSession) && currentSession) || this.session;
|
|
126
127
|
}
|
|
128
|
+
|
|
127
129
|
set currentSession(currentSession: DebugSession | undefined) {
|
|
128
130
|
this.manager.updateCurrentSession(currentSession);
|
|
129
131
|
}
|
|
@@ -132,10 +134,12 @@ export class DebugViewModel implements IDisposable {
|
|
|
132
134
|
const { currentSession } = this;
|
|
133
135
|
return (currentSession && currentSession.state) || DebugState.Inactive;
|
|
134
136
|
}
|
|
137
|
+
|
|
135
138
|
get currentThread(): DebugThread | undefined {
|
|
136
139
|
const { currentSession } = this;
|
|
137
140
|
return currentSession && currentSession.currentThread;
|
|
138
141
|
}
|
|
142
|
+
|
|
139
143
|
get currentFrame(): DebugStackFrame | undefined {
|
|
140
144
|
const { currentThread } = this;
|
|
141
145
|
return currentThread && currentThread.currentFrame;
|