@codingame/monaco-vscode-debug-service-override 4.0.0 → 4.1.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/debug.js +4 -4
- package/package.json +2 -2
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/external/tslib/tslib.es6.js +0 -11
- package/override/vs/platform/dialogs/common/dialogs.js +0 -10
- package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +0 -73
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +0 -1026
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +0 -1004
- package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +0 -347
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +0 -337
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +0 -432
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +0 -1039
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +0 -649
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +0 -64
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +0 -636
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +0 -740
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +0 -408
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +0 -206
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +0 -80
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +0 -169
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +0 -1271
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +0 -1330
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +0 -115
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +0 -77
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +0 -307
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +0 -31
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +0 -387
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +0 -267
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +0 -817
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +0 -131
- package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +0 -142
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +0 -262
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +0 -669
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +0 -709
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +0 -1002
- package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +0 -48
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +0 -352
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +0 -129
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +0 -734
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +0 -501
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +0 -162
- package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +0 -21
- package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +0 -17
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +0 -110
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +0 -62
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +0 -460
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +0 -166
- package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +0 -36
- package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +0 -150
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +0 -289
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +0 -87
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +0 -64
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +0 -311
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +0 -29
|
@@ -1,1026 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { append, $ as $$1 } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
-
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
4
|
-
import { HighlightedLabel } from 'vscode/vscode/vs/base/browser/ui/highlightedlabel/highlightedLabel';
|
|
5
|
-
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
6
|
-
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
7
|
-
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
8
|
-
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
9
|
-
import { createMatches } from 'vscode/vscode/vs/base/common/filters';
|
|
10
|
-
import { DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
|
-
import { posix } from 'vscode/vscode/vs/base/common/path';
|
|
12
|
-
import { commonSuffixLength } from 'vscode/vscode/vs/base/common/strings';
|
|
13
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
14
|
-
import { MenuEntryActionViewItem, SubmenuEntryActionViewItem, createAndFillInContextMenuActions, createAndFillInActionBarActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
15
|
-
import { MenuItemAction, SubmenuItemAction, MenuId, registerAction2, MenuRegistry, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
16
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
17
|
-
import { ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
18
|
-
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
19
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
20
|
-
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
21
|
-
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
|
|
22
|
-
import { WorkbenchCompressibleAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
23
|
-
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
24
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
25
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
26
|
-
import { asCssVariable } from 'vscode/vscode/vs/platform/theme/common/colorUtils';
|
|
27
|
-
import { textLinkForeground } from 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
|
|
28
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
|
|
29
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
|
|
30
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/inputColors';
|
|
31
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/listColors';
|
|
32
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/menuColors';
|
|
33
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
34
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
35
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
36
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
37
|
-
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
38
|
-
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
39
|
-
import { ViewAction, ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
40
|
-
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
41
|
-
import { renderViewTree } from 'vscode/vscode/vs/workbench/contrib/debug/browser/baseDebugView';
|
|
42
|
-
import { STOP_ID, DISCONNECT_ID, PAUSE_LABEL, PAUSE_ID, CONTINUE_LABEL, CONTINUE_ID, RESTART_LABEL, RESTART_SESSION_ID, STOP_LABEL, DISCONNECT_LABEL, STEP_OVER_LABEL, STEP_OVER_ID, STEP_INTO_LABEL, STEP_INTO_ID, STEP_OUT_LABEL, STEP_OUT_ID } from './debugCommands.js';
|
|
43
|
-
import { callstackViewSession, debugRestartFrame, debugPause, debugContinue, debugRestart, debugStop, debugDisconnect, debugStepOver, debugStepInto, debugStepOut } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
|
|
44
|
-
import { createDisconnectMenuItemAction } from './debugToolBar.js';
|
|
45
|
-
import { CALLSTACK_VIEW_ID, CONTEXT_DEBUG_STATE, getStateLabel, CONTEXT_CALLSTACK_ITEM_TYPE, CONTEXT_CALLSTACK_SESSION_HAS_ONE_THREAD, CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG, CONTEXT_CALLSTACK_ITEM_STOPPED, CONTEXT_CALLSTACK_SESSION_IS_ATTACH, CONTEXT_STACK_FRAME_SUPPORTS_RESTART, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
46
|
-
import { Thread, StackFrame, ThreadAndSessionIds } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
|
|
47
|
-
import { isSessionAttach } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugUtils';
|
|
48
|
-
import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatableHoverWidget';
|
|
49
|
-
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
50
|
-
|
|
51
|
-
var SessionsRenderer_1, ThreadsRenderer_1, StackFramesRenderer_1;
|
|
52
|
-
const $ = $$1;
|
|
53
|
-
function assignSessionContext(element, context) {
|
|
54
|
-
context.sessionId = element.getId();
|
|
55
|
-
return context;
|
|
56
|
-
}
|
|
57
|
-
function assignThreadContext(element, context) {
|
|
58
|
-
context.threadId = element.getId();
|
|
59
|
-
assignSessionContext(element.session, context);
|
|
60
|
-
return context;
|
|
61
|
-
}
|
|
62
|
-
function assignStackFrameContext(element, context) {
|
|
63
|
-
context.frameId = element.getId();
|
|
64
|
-
context.frameName = element.name;
|
|
65
|
-
context.frameLocation = { range: element.range, source: element.source.raw };
|
|
66
|
-
assignThreadContext(element.thread, context);
|
|
67
|
-
return context;
|
|
68
|
-
}
|
|
69
|
-
function getContext(element) {
|
|
70
|
-
if (element instanceof StackFrame) {
|
|
71
|
-
return assignStackFrameContext(element, {});
|
|
72
|
-
}
|
|
73
|
-
else if (element instanceof Thread) {
|
|
74
|
-
return assignThreadContext(element, {});
|
|
75
|
-
}
|
|
76
|
-
else if (isDebugSession(element)) {
|
|
77
|
-
return assignSessionContext(element, {});
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
return undefined;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function getContextForContributedActions(element) {
|
|
84
|
-
if (element instanceof StackFrame) {
|
|
85
|
-
if (element.source.inMemory) {
|
|
86
|
-
return element.source.raw.path || element.source.reference || element.source.name;
|
|
87
|
-
}
|
|
88
|
-
return ( element.source.uri.toString());
|
|
89
|
-
}
|
|
90
|
-
if (element instanceof Thread) {
|
|
91
|
-
return element.threadId;
|
|
92
|
-
}
|
|
93
|
-
if (isDebugSession(element)) {
|
|
94
|
-
return element.getId();
|
|
95
|
-
}
|
|
96
|
-
return '';
|
|
97
|
-
}
|
|
98
|
-
function getSpecificSourceName(stackFrame) {
|
|
99
|
-
let callStack = stackFrame.thread.getStaleCallStack();
|
|
100
|
-
callStack = callStack.length > 0 ? callStack : stackFrame.thread.getCallStack();
|
|
101
|
-
const otherSources = ( callStack.map(sf => sf.source)).filter(s => s !== stackFrame.source);
|
|
102
|
-
let suffixLength = 0;
|
|
103
|
-
otherSources.forEach(s => {
|
|
104
|
-
if (s.name === stackFrame.source.name) {
|
|
105
|
-
suffixLength = Math.max(suffixLength, commonSuffixLength(stackFrame.source.uri.path, s.uri.path));
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
if (suffixLength === 0) {
|
|
109
|
-
return stackFrame.source.name;
|
|
110
|
-
}
|
|
111
|
-
const from = Math.max(0, stackFrame.source.uri.path.lastIndexOf(posix.sep, stackFrame.source.uri.path.length - suffixLength - 1));
|
|
112
|
-
return (from > 0 ? '...' : '') + stackFrame.source.uri.path.substring(from);
|
|
113
|
-
}
|
|
114
|
-
async function expandTo(session, tree) {
|
|
115
|
-
if (session.parentSession) {
|
|
116
|
-
await expandTo(session.parentSession, tree);
|
|
117
|
-
}
|
|
118
|
-
await tree.expand(session);
|
|
119
|
-
}
|
|
120
|
-
let CallStackView = class CallStackView extends ViewPane {
|
|
121
|
-
constructor(options, contextMenuService, debugService, keybindingService, instantiationService, viewDescriptorService, configurationService, contextKeyService, openerService, themeService, telemetryService, menuService) {
|
|
122
|
-
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
123
|
-
this.options = options;
|
|
124
|
-
this.debugService = debugService;
|
|
125
|
-
this.menuService = menuService;
|
|
126
|
-
this.needsRefresh = false;
|
|
127
|
-
this.ignoreSelectionChangedEvent = false;
|
|
128
|
-
this.ignoreFocusStackFrameEvent = false;
|
|
129
|
-
this.autoExpandedSessions = ( new Set());
|
|
130
|
-
this.selectionNeedsUpdate = false;
|
|
131
|
-
this.onCallStackChangeScheduler = this._register(( new RunOnceScheduler(async () => {
|
|
132
|
-
const sessions = this.debugService.getModel().getSessions();
|
|
133
|
-
if (sessions.length === 0) {
|
|
134
|
-
this.autoExpandedSessions.clear();
|
|
135
|
-
}
|
|
136
|
-
const thread = sessions.length === 1 && sessions[0].getAllThreads().length === 1 ? sessions[0].getAllThreads()[0] : undefined;
|
|
137
|
-
const stoppedDetails = sessions.length === 1 ? sessions[0].getStoppedDetails() : undefined;
|
|
138
|
-
if (stoppedDetails && (thread || typeof stoppedDetails.threadId !== 'number')) {
|
|
139
|
-
this.stateMessageLabel.textContent = stoppedDescription(stoppedDetails);
|
|
140
|
-
this.stateMessageLabelHover.update(stoppedText(stoppedDetails));
|
|
141
|
-
this.stateMessageLabel.classList.toggle('exception', stoppedDetails.reason === 'exception');
|
|
142
|
-
this.stateMessage.hidden = false;
|
|
143
|
-
}
|
|
144
|
-
else if (sessions.length === 1 && sessions[0].state === 3 ) {
|
|
145
|
-
this.stateMessageLabel.textContent = ( localizeWithPath(
|
|
146
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
147
|
-
{ key: 'running', comment: ['indicates state'] },
|
|
148
|
-
"Running"
|
|
149
|
-
));
|
|
150
|
-
this.stateMessageLabelHover.update(sessions[0].getLabel());
|
|
151
|
-
this.stateMessageLabel.classList.remove('exception');
|
|
152
|
-
this.stateMessage.hidden = false;
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
this.stateMessage.hidden = true;
|
|
156
|
-
}
|
|
157
|
-
this.updateActions();
|
|
158
|
-
this.needsRefresh = false;
|
|
159
|
-
this.dataSource.deemphasizedStackFramesToShow = [];
|
|
160
|
-
await this.tree.updateChildren();
|
|
161
|
-
try {
|
|
162
|
-
const toExpand = ( new Set());
|
|
163
|
-
sessions.forEach(s => {
|
|
164
|
-
if (s.parentSession && !( this.autoExpandedSessions.has(s.parentSession))) {
|
|
165
|
-
toExpand.add(s.parentSession);
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
for (const session of toExpand) {
|
|
169
|
-
await expandTo(session, this.tree);
|
|
170
|
-
this.autoExpandedSessions.add(session);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
catch (e) {
|
|
174
|
-
}
|
|
175
|
-
if (this.selectionNeedsUpdate) {
|
|
176
|
-
this.selectionNeedsUpdate = false;
|
|
177
|
-
await this.updateTreeSelection();
|
|
178
|
-
}
|
|
179
|
-
}, 50)));
|
|
180
|
-
}
|
|
181
|
-
renderHeaderTitle(container) {
|
|
182
|
-
super.renderHeaderTitle(container, this.options.title);
|
|
183
|
-
this.stateMessage = append(container, $('span.call-stack-state-message'));
|
|
184
|
-
this.stateMessage.hidden = true;
|
|
185
|
-
this.stateMessageLabel = append(this.stateMessage, $('span.label'));
|
|
186
|
-
this.stateMessageLabelHover = this._register(setupCustomHover(getDefaultHoverDelegate('mouse'), this.stateMessage, ''));
|
|
187
|
-
}
|
|
188
|
-
renderBody(container) {
|
|
189
|
-
super.renderBody(container);
|
|
190
|
-
this.element.classList.add('debug-pane');
|
|
191
|
-
container.classList.add('debug-call-stack');
|
|
192
|
-
const treeContainer = renderViewTree(container);
|
|
193
|
-
this.dataSource = ( new CallStackDataSource(this.debugService));
|
|
194
|
-
this.tree = this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'CallStackView', treeContainer, ( new CallStackDelegate()), ( new CallStackCompressionDelegate(this.debugService)), [
|
|
195
|
-
this.instantiationService.createInstance(SessionsRenderer),
|
|
196
|
-
this.instantiationService.createInstance(ThreadsRenderer),
|
|
197
|
-
this.instantiationService.createInstance(StackFramesRenderer),
|
|
198
|
-
( new ErrorsRenderer()),
|
|
199
|
-
( new LoadMoreRenderer()),
|
|
200
|
-
( new ShowMoreRenderer())
|
|
201
|
-
], this.dataSource, {
|
|
202
|
-
accessibilityProvider: ( new CallStackAccessibilityProvider()),
|
|
203
|
-
compressionEnabled: true,
|
|
204
|
-
autoExpandSingleChildren: true,
|
|
205
|
-
identityProvider: {
|
|
206
|
-
getId: (element) => {
|
|
207
|
-
if (typeof element === 'string') {
|
|
208
|
-
return element;
|
|
209
|
-
}
|
|
210
|
-
if (element instanceof Array) {
|
|
211
|
-
return `showMore ${element[0].getId()}`;
|
|
212
|
-
}
|
|
213
|
-
return element.getId();
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
keyboardNavigationLabelProvider: {
|
|
217
|
-
getKeyboardNavigationLabel: (e) => {
|
|
218
|
-
if (isDebugSession(e)) {
|
|
219
|
-
return e.getLabel();
|
|
220
|
-
}
|
|
221
|
-
if (e instanceof Thread) {
|
|
222
|
-
return `${e.name} ${e.stateLabel}`;
|
|
223
|
-
}
|
|
224
|
-
if (e instanceof StackFrame || typeof e === 'string') {
|
|
225
|
-
return e;
|
|
226
|
-
}
|
|
227
|
-
if (e instanceof ThreadAndSessionIds) {
|
|
228
|
-
return LoadMoreRenderer.LABEL;
|
|
229
|
-
}
|
|
230
|
-
return ( localizeWithPath(
|
|
231
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
232
|
-
'showMoreStackFrames2',
|
|
233
|
-
"Show More Stack Frames"
|
|
234
|
-
));
|
|
235
|
-
},
|
|
236
|
-
getCompressedNodeKeyboardNavigationLabel: (e) => {
|
|
237
|
-
const firstItem = e[0];
|
|
238
|
-
if (isDebugSession(firstItem)) {
|
|
239
|
-
return firstItem.getLabel();
|
|
240
|
-
}
|
|
241
|
-
return '';
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
expandOnlyOnTwistieClick: true,
|
|
245
|
-
overrideStyles: {
|
|
246
|
-
listBackground: this.getBackgroundColor()
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
this.tree.setInput(this.debugService.getModel());
|
|
250
|
-
this._register(this.tree);
|
|
251
|
-
this._register(this.tree.onDidOpen(async (e) => {
|
|
252
|
-
if (this.ignoreSelectionChangedEvent) {
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
const focusStackFrame = (stackFrame, thread, session, options = {}) => {
|
|
256
|
-
this.ignoreFocusStackFrameEvent = true;
|
|
257
|
-
try {
|
|
258
|
-
this.debugService.focusStackFrame(stackFrame, thread, session, { ...options, ...{ explicit: true } });
|
|
259
|
-
}
|
|
260
|
-
finally {
|
|
261
|
-
this.ignoreFocusStackFrameEvent = false;
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
const element = e.element;
|
|
265
|
-
if (element instanceof StackFrame) {
|
|
266
|
-
const opts = {
|
|
267
|
-
preserveFocus: e.editorOptions.preserveFocus,
|
|
268
|
-
sideBySide: e.sideBySide,
|
|
269
|
-
pinned: e.editorOptions.pinned
|
|
270
|
-
};
|
|
271
|
-
focusStackFrame(element, element.thread, element.thread.session, opts);
|
|
272
|
-
}
|
|
273
|
-
if (element instanceof Thread) {
|
|
274
|
-
focusStackFrame(undefined, element, element.session);
|
|
275
|
-
}
|
|
276
|
-
if (isDebugSession(element)) {
|
|
277
|
-
focusStackFrame(undefined, undefined, element);
|
|
278
|
-
}
|
|
279
|
-
if (element instanceof ThreadAndSessionIds) {
|
|
280
|
-
const session = this.debugService.getModel().getSession(element.sessionId);
|
|
281
|
-
const thread = session && session.getThread(element.threadId);
|
|
282
|
-
if (thread) {
|
|
283
|
-
const totalFrames = thread.stoppedDetails?.totalFrames;
|
|
284
|
-
const remainingFramesCount = typeof totalFrames === 'number' ? (totalFrames - thread.getCallStack().length) : undefined;
|
|
285
|
-
await thread.fetchCallStack(remainingFramesCount);
|
|
286
|
-
await this.tree.updateChildren();
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
if (element instanceof Array) {
|
|
290
|
-
this.dataSource.deemphasizedStackFramesToShow.push(...element);
|
|
291
|
-
this.tree.updateChildren();
|
|
292
|
-
}
|
|
293
|
-
}));
|
|
294
|
-
this._register(this.debugService.getModel().onDidChangeCallStack(() => {
|
|
295
|
-
if (!this.isBodyVisible()) {
|
|
296
|
-
this.needsRefresh = true;
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
if (!this.onCallStackChangeScheduler.isScheduled()) {
|
|
300
|
-
this.onCallStackChangeScheduler.schedule();
|
|
301
|
-
}
|
|
302
|
-
}));
|
|
303
|
-
const onFocusChange = Event.any(this.debugService.getViewModel().onDidFocusStackFrame, this.debugService.getViewModel().onDidFocusSession);
|
|
304
|
-
this._register(onFocusChange(async () => {
|
|
305
|
-
if (this.ignoreFocusStackFrameEvent) {
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
if (!this.isBodyVisible()) {
|
|
309
|
-
this.needsRefresh = true;
|
|
310
|
-
this.selectionNeedsUpdate = true;
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
if (this.onCallStackChangeScheduler.isScheduled()) {
|
|
314
|
-
this.selectionNeedsUpdate = true;
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
await this.updateTreeSelection();
|
|
318
|
-
}));
|
|
319
|
-
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
|
320
|
-
if (this.debugService.state === 2 ) {
|
|
321
|
-
this.onCallStackChangeScheduler.schedule(0);
|
|
322
|
-
}
|
|
323
|
-
this._register(this.onDidChangeBodyVisibility(visible => {
|
|
324
|
-
if (visible && this.needsRefresh) {
|
|
325
|
-
this.onCallStackChangeScheduler.schedule();
|
|
326
|
-
}
|
|
327
|
-
}));
|
|
328
|
-
this._register(this.debugService.onDidNewSession(s => {
|
|
329
|
-
const sessionListeners = [];
|
|
330
|
-
sessionListeners.push(s.onDidChangeName(() => {
|
|
331
|
-
if (this.tree.hasNode(s)) {
|
|
332
|
-
this.tree.rerender(s);
|
|
333
|
-
}
|
|
334
|
-
}));
|
|
335
|
-
sessionListeners.push(s.onDidEndAdapter(() => dispose(sessionListeners)));
|
|
336
|
-
if (s.parentSession) {
|
|
337
|
-
this.autoExpandedSessions.delete(s.parentSession);
|
|
338
|
-
}
|
|
339
|
-
}));
|
|
340
|
-
}
|
|
341
|
-
layoutBody(height, width) {
|
|
342
|
-
super.layoutBody(height, width);
|
|
343
|
-
this.tree.layout(height, width);
|
|
344
|
-
}
|
|
345
|
-
focus() {
|
|
346
|
-
super.focus();
|
|
347
|
-
this.tree.domFocus();
|
|
348
|
-
}
|
|
349
|
-
collapseAll() {
|
|
350
|
-
this.tree.collapseAll();
|
|
351
|
-
}
|
|
352
|
-
async updateTreeSelection() {
|
|
353
|
-
if (!this.tree || !this.tree.getInput()) {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
const updateSelectionAndReveal = (element) => {
|
|
357
|
-
this.ignoreSelectionChangedEvent = true;
|
|
358
|
-
try {
|
|
359
|
-
this.tree.setSelection([element]);
|
|
360
|
-
if (this.tree.getRelativeTop(element) === null) {
|
|
361
|
-
this.tree.reveal(element, 0.5);
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
this.tree.reveal(element);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
catch (e) { }
|
|
368
|
-
finally {
|
|
369
|
-
this.ignoreSelectionChangedEvent = false;
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
const thread = this.debugService.getViewModel().focusedThread;
|
|
373
|
-
const session = this.debugService.getViewModel().focusedSession;
|
|
374
|
-
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
|
|
375
|
-
if (!thread) {
|
|
376
|
-
if (!session) {
|
|
377
|
-
this.tree.setSelection([]);
|
|
378
|
-
}
|
|
379
|
-
else {
|
|
380
|
-
updateSelectionAndReveal(session);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
else {
|
|
384
|
-
try {
|
|
385
|
-
await expandTo(thread.session, this.tree);
|
|
386
|
-
}
|
|
387
|
-
catch (e) { }
|
|
388
|
-
try {
|
|
389
|
-
await this.tree.expand(thread);
|
|
390
|
-
}
|
|
391
|
-
catch (e) { }
|
|
392
|
-
const toReveal = stackFrame || session;
|
|
393
|
-
if (toReveal) {
|
|
394
|
-
updateSelectionAndReveal(toReveal);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
onContextMenu(e) {
|
|
399
|
-
const element = e.element;
|
|
400
|
-
let overlay = [];
|
|
401
|
-
if (isDebugSession(element)) {
|
|
402
|
-
overlay = getSessionContextOverlay(element);
|
|
403
|
-
}
|
|
404
|
-
else if (element instanceof Thread) {
|
|
405
|
-
overlay = getThreadContextOverlay(element);
|
|
406
|
-
}
|
|
407
|
-
else if (element instanceof StackFrame) {
|
|
408
|
-
overlay = getStackFrameContextOverlay(element);
|
|
409
|
-
}
|
|
410
|
-
const primary = [];
|
|
411
|
-
const secondary = [];
|
|
412
|
-
const result = { primary, secondary };
|
|
413
|
-
const contextKeyService = this.contextKeyService.createOverlay(overlay);
|
|
414
|
-
const menu = this.menuService.createMenu(MenuId.DebugCallStackContext, contextKeyService);
|
|
415
|
-
createAndFillInContextMenuActions(menu, { arg: getContextForContributedActions(element), shouldForwardArgs: true }, result, 'inline');
|
|
416
|
-
menu.dispose();
|
|
417
|
-
this.contextMenuService.showContextMenu({
|
|
418
|
-
getAnchor: () => e.anchor,
|
|
419
|
-
getActions: () => result.secondary,
|
|
420
|
-
getActionsContext: () => getContext(element)
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
CallStackView = ( __decorate([
|
|
425
|
-
( __param(1, IContextMenuService)),
|
|
426
|
-
( __param(2, IDebugService)),
|
|
427
|
-
( __param(3, IKeybindingService)),
|
|
428
|
-
( __param(4, IInstantiationService)),
|
|
429
|
-
( __param(5, IViewDescriptorService)),
|
|
430
|
-
( __param(6, IConfigurationService)),
|
|
431
|
-
( __param(7, IContextKeyService)),
|
|
432
|
-
( __param(8, IOpenerService)),
|
|
433
|
-
( __param(9, IThemeService)),
|
|
434
|
-
( __param(10, ITelemetryService)),
|
|
435
|
-
( __param(11, IMenuService))
|
|
436
|
-
], CallStackView));
|
|
437
|
-
function getSessionContextOverlay(session) {
|
|
438
|
-
return [
|
|
439
|
-
[CONTEXT_CALLSTACK_ITEM_TYPE.key, 'session'],
|
|
440
|
-
[CONTEXT_CALLSTACK_SESSION_IS_ATTACH.key, isSessionAttach(session)],
|
|
441
|
-
[CONTEXT_CALLSTACK_ITEM_STOPPED.key, session.state === 2 ],
|
|
442
|
-
[CONTEXT_CALLSTACK_SESSION_HAS_ONE_THREAD.key, session.getAllThreads().length === 1],
|
|
443
|
-
];
|
|
444
|
-
}
|
|
445
|
-
let SessionsRenderer = class SessionsRenderer {
|
|
446
|
-
static { SessionsRenderer_1 = this; }
|
|
447
|
-
static { this.ID = 'session'; }
|
|
448
|
-
constructor(instantiationService, contextKeyService, menuService) {
|
|
449
|
-
this.instantiationService = instantiationService;
|
|
450
|
-
this.contextKeyService = contextKeyService;
|
|
451
|
-
this.menuService = menuService;
|
|
452
|
-
}
|
|
453
|
-
get templateId() {
|
|
454
|
-
return SessionsRenderer_1.ID;
|
|
455
|
-
}
|
|
456
|
-
renderTemplate(container) {
|
|
457
|
-
const session = append(container, $('.session'));
|
|
458
|
-
append(session, $(ThemeIcon.asCSSSelector(callstackViewSession)));
|
|
459
|
-
const name = append(session, $('.name'));
|
|
460
|
-
const stateLabel = append(session, $('span.state.label.monaco-count-badge.long'));
|
|
461
|
-
const templateDisposable = ( new DisposableStore());
|
|
462
|
-
const label = templateDisposable.add(( new HighlightedLabel(name)));
|
|
463
|
-
const stopActionViewItemDisposables = templateDisposable.add(( new DisposableStore()));
|
|
464
|
-
const actionBar = templateDisposable.add(( new ActionBar(session, {
|
|
465
|
-
actionViewItemProvider: (action, options) => {
|
|
466
|
-
if ((action.id === STOP_ID || action.id === DISCONNECT_ID) && action instanceof MenuItemAction) {
|
|
467
|
-
stopActionViewItemDisposables.clear();
|
|
468
|
-
const item = this.instantiationService.invokeFunction(accessor => createDisconnectMenuItemAction(action, stopActionViewItemDisposables, accessor, options));
|
|
469
|
-
if (item) {
|
|
470
|
-
return item;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
if (action instanceof MenuItemAction) {
|
|
474
|
-
return this.instantiationService.createInstance(MenuEntryActionViewItem, action, { hoverDelegate: options.hoverDelegate });
|
|
475
|
-
}
|
|
476
|
-
else if (action instanceof SubmenuItemAction) {
|
|
477
|
-
return this.instantiationService.createInstance(SubmenuEntryActionViewItem, action, { hoverDelegate: options.hoverDelegate });
|
|
478
|
-
}
|
|
479
|
-
return undefined;
|
|
480
|
-
}
|
|
481
|
-
})));
|
|
482
|
-
const elementDisposable = templateDisposable.add(( new DisposableStore()));
|
|
483
|
-
return { session, name, stateLabel, label, actionBar, elementDisposable, templateDisposable };
|
|
484
|
-
}
|
|
485
|
-
renderElement(element, _, data) {
|
|
486
|
-
this.doRenderElement(element.element, createMatches(element.filterData), data);
|
|
487
|
-
}
|
|
488
|
-
renderCompressedElements(node, _index, templateData) {
|
|
489
|
-
const lastElement = node.element.elements[node.element.elements.length - 1];
|
|
490
|
-
const matches = createMatches(node.filterData);
|
|
491
|
-
this.doRenderElement(lastElement, matches, templateData);
|
|
492
|
-
}
|
|
493
|
-
doRenderElement(session, matches, data) {
|
|
494
|
-
const sessionHover = data.elementDisposable.add(setupCustomHover(getDefaultHoverDelegate('mouse'), data.session, ( localizeWithPath(
|
|
495
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
496
|
-
{ key: 'session', comment: ['Session is a noun'] },
|
|
497
|
-
"Session"
|
|
498
|
-
))));
|
|
499
|
-
data.label.set(session.getLabel(), matches);
|
|
500
|
-
const stoppedDetails = session.getStoppedDetails();
|
|
501
|
-
const thread = session.getAllThreads().find(t => t.stopped);
|
|
502
|
-
const contextKeyService = this.contextKeyService.createOverlay(getSessionContextOverlay(session));
|
|
503
|
-
const menu = data.elementDisposable.add(this.menuService.createMenu(MenuId.DebugCallStackContext, contextKeyService));
|
|
504
|
-
const setupActionBar = () => {
|
|
505
|
-
data.actionBar.clear();
|
|
506
|
-
const primary = [];
|
|
507
|
-
const secondary = [];
|
|
508
|
-
const result = { primary, secondary };
|
|
509
|
-
createAndFillInActionBarActions(menu, { arg: getContextForContributedActions(session), shouldForwardArgs: true }, result, 'inline');
|
|
510
|
-
data.actionBar.push(primary, { icon: true, label: false });
|
|
511
|
-
data.actionBar.context = getContext(session);
|
|
512
|
-
};
|
|
513
|
-
data.elementDisposable.add(menu.onDidChange(() => setupActionBar()));
|
|
514
|
-
setupActionBar();
|
|
515
|
-
data.stateLabel.style.display = '';
|
|
516
|
-
if (stoppedDetails) {
|
|
517
|
-
data.stateLabel.textContent = stoppedDescription(stoppedDetails);
|
|
518
|
-
sessionHover.update(`${session.getLabel()}: ${stoppedText(stoppedDetails)}`);
|
|
519
|
-
data.stateLabel.classList.toggle('exception', stoppedDetails.reason === 'exception');
|
|
520
|
-
}
|
|
521
|
-
else if (thread && thread.stoppedDetails) {
|
|
522
|
-
data.stateLabel.textContent = stoppedDescription(thread.stoppedDetails);
|
|
523
|
-
sessionHover.update(`${session.getLabel()}: ${stoppedText(thread.stoppedDetails)}`);
|
|
524
|
-
data.stateLabel.classList.toggle('exception', thread.stoppedDetails.reason === 'exception');
|
|
525
|
-
}
|
|
526
|
-
else {
|
|
527
|
-
data.stateLabel.textContent = ( localizeWithPath(
|
|
528
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
529
|
-
{ key: 'running', comment: ['indicates state'] },
|
|
530
|
-
"Running"
|
|
531
|
-
));
|
|
532
|
-
data.stateLabel.classList.remove('exception');
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
disposeTemplate(templateData) {
|
|
536
|
-
templateData.templateDisposable.dispose();
|
|
537
|
-
}
|
|
538
|
-
disposeElement(_element, _, templateData) {
|
|
539
|
-
templateData.elementDisposable.clear();
|
|
540
|
-
}
|
|
541
|
-
disposeCompressedElements(node, index, templateData, height) {
|
|
542
|
-
templateData.elementDisposable.clear();
|
|
543
|
-
}
|
|
544
|
-
};
|
|
545
|
-
SessionsRenderer = SessionsRenderer_1 = ( __decorate([
|
|
546
|
-
( __param(0, IInstantiationService)),
|
|
547
|
-
( __param(1, IContextKeyService)),
|
|
548
|
-
( __param(2, IMenuService))
|
|
549
|
-
], SessionsRenderer));
|
|
550
|
-
function getThreadContextOverlay(thread) {
|
|
551
|
-
return [
|
|
552
|
-
[CONTEXT_CALLSTACK_ITEM_TYPE.key, 'thread'],
|
|
553
|
-
[CONTEXT_CALLSTACK_ITEM_STOPPED.key, thread.stopped]
|
|
554
|
-
];
|
|
555
|
-
}
|
|
556
|
-
let ThreadsRenderer = class ThreadsRenderer {
|
|
557
|
-
static { ThreadsRenderer_1 = this; }
|
|
558
|
-
static { this.ID = 'thread'; }
|
|
559
|
-
constructor(contextKeyService, menuService) {
|
|
560
|
-
this.contextKeyService = contextKeyService;
|
|
561
|
-
this.menuService = menuService;
|
|
562
|
-
}
|
|
563
|
-
get templateId() {
|
|
564
|
-
return ThreadsRenderer_1.ID;
|
|
565
|
-
}
|
|
566
|
-
renderTemplate(container) {
|
|
567
|
-
const thread = append(container, $('.thread'));
|
|
568
|
-
const name = append(thread, $('.name'));
|
|
569
|
-
const stateLabel = append(thread, $('span.state.label.monaco-count-badge.long'));
|
|
570
|
-
const templateDisposable = ( new DisposableStore());
|
|
571
|
-
const label = templateDisposable.add(( new HighlightedLabel(name)));
|
|
572
|
-
const actionBar = templateDisposable.add(( new ActionBar(thread)));
|
|
573
|
-
const elementDisposable = templateDisposable.add(( new DisposableStore()));
|
|
574
|
-
return { thread, name, stateLabel, label, actionBar, elementDisposable, templateDisposable };
|
|
575
|
-
}
|
|
576
|
-
renderElement(element, _index, data) {
|
|
577
|
-
const thread = element.element;
|
|
578
|
-
data.elementDisposable.add(setupCustomHover(getDefaultHoverDelegate('mouse'), data.thread, thread.name));
|
|
579
|
-
data.label.set(thread.name, createMatches(element.filterData));
|
|
580
|
-
data.stateLabel.textContent = thread.stateLabel;
|
|
581
|
-
data.stateLabel.classList.toggle('exception', thread.stoppedDetails?.reason === 'exception');
|
|
582
|
-
const contextKeyService = this.contextKeyService.createOverlay(getThreadContextOverlay(thread));
|
|
583
|
-
const menu = data.elementDisposable.add(this.menuService.createMenu(MenuId.DebugCallStackContext, contextKeyService));
|
|
584
|
-
const setupActionBar = () => {
|
|
585
|
-
data.actionBar.clear();
|
|
586
|
-
const primary = [];
|
|
587
|
-
const secondary = [];
|
|
588
|
-
const result = { primary, secondary };
|
|
589
|
-
createAndFillInActionBarActions(menu, { arg: getContextForContributedActions(thread), shouldForwardArgs: true }, result, 'inline');
|
|
590
|
-
data.actionBar.push(primary, { icon: true, label: false });
|
|
591
|
-
data.actionBar.context = getContext(thread);
|
|
592
|
-
};
|
|
593
|
-
data.elementDisposable.add(menu.onDidChange(() => setupActionBar()));
|
|
594
|
-
setupActionBar();
|
|
595
|
-
}
|
|
596
|
-
renderCompressedElements(_node, _index, _templateData, _height) {
|
|
597
|
-
throw new Error('Method not implemented.');
|
|
598
|
-
}
|
|
599
|
-
disposeElement(_element, _index, templateData) {
|
|
600
|
-
templateData.elementDisposable.clear();
|
|
601
|
-
}
|
|
602
|
-
disposeTemplate(templateData) {
|
|
603
|
-
templateData.templateDisposable.dispose();
|
|
604
|
-
}
|
|
605
|
-
};
|
|
606
|
-
ThreadsRenderer = ThreadsRenderer_1 = ( __decorate([
|
|
607
|
-
( __param(0, IContextKeyService)),
|
|
608
|
-
( __param(1, IMenuService))
|
|
609
|
-
], ThreadsRenderer));
|
|
610
|
-
function getStackFrameContextOverlay(stackFrame) {
|
|
611
|
-
return [
|
|
612
|
-
[CONTEXT_CALLSTACK_ITEM_TYPE.key, 'stackFrame'],
|
|
613
|
-
[CONTEXT_STACK_FRAME_SUPPORTS_RESTART.key, stackFrame.canRestart]
|
|
614
|
-
];
|
|
615
|
-
}
|
|
616
|
-
let StackFramesRenderer = class StackFramesRenderer {
|
|
617
|
-
static { StackFramesRenderer_1 = this; }
|
|
618
|
-
static { this.ID = 'stackFrame'; }
|
|
619
|
-
constructor(labelService, notificationService) {
|
|
620
|
-
this.labelService = labelService;
|
|
621
|
-
this.notificationService = notificationService;
|
|
622
|
-
}
|
|
623
|
-
get templateId() {
|
|
624
|
-
return StackFramesRenderer_1.ID;
|
|
625
|
-
}
|
|
626
|
-
renderTemplate(container) {
|
|
627
|
-
const stackFrame = append(container, $('.stack-frame'));
|
|
628
|
-
const labelDiv = append(stackFrame, $('span.label.expression'));
|
|
629
|
-
const file = append(stackFrame, $('.file'));
|
|
630
|
-
const fileName = append(file, $('span.file-name'));
|
|
631
|
-
const wrapper = append(file, $('span.line-number-wrapper'));
|
|
632
|
-
const lineNumber = append(wrapper, $('span.line-number.monaco-count-badge'));
|
|
633
|
-
const templateDisposable = ( new DisposableStore());
|
|
634
|
-
const label = templateDisposable.add(( new HighlightedLabel(labelDiv)));
|
|
635
|
-
const actionBar = templateDisposable.add(( new ActionBar(stackFrame)));
|
|
636
|
-
return { file, fileName, label, lineNumber, stackFrame, actionBar, templateDisposable };
|
|
637
|
-
}
|
|
638
|
-
renderElement(element, index, data) {
|
|
639
|
-
const stackFrame = element.element;
|
|
640
|
-
data.stackFrame.classList.toggle('disabled', !stackFrame.source || !stackFrame.source.available || isDeemphasized(stackFrame));
|
|
641
|
-
data.stackFrame.classList.toggle('label', stackFrame.presentationHint === 'label');
|
|
642
|
-
data.stackFrame.classList.toggle('subtle', stackFrame.presentationHint === 'subtle');
|
|
643
|
-
const hasActions = !!stackFrame.thread.session.capabilities.supportsRestartFrame && stackFrame.presentationHint !== 'label' && stackFrame.presentationHint !== 'subtle' && stackFrame.canRestart;
|
|
644
|
-
data.stackFrame.classList.toggle('has-actions', hasActions);
|
|
645
|
-
let title = stackFrame.source.inMemory ? stackFrame.source.uri.path : this.labelService.getUriLabel(stackFrame.source.uri);
|
|
646
|
-
if (stackFrame.source.raw.origin) {
|
|
647
|
-
title += `\n${stackFrame.source.raw.origin}`;
|
|
648
|
-
}
|
|
649
|
-
data.templateDisposable.add(setupCustomHover(getDefaultHoverDelegate('mouse'), data.file, title));
|
|
650
|
-
data.label.set(stackFrame.name, createMatches(element.filterData), stackFrame.name);
|
|
651
|
-
data.fileName.textContent = getSpecificSourceName(stackFrame);
|
|
652
|
-
if (stackFrame.range.startLineNumber !== undefined) {
|
|
653
|
-
data.lineNumber.textContent = `${stackFrame.range.startLineNumber}`;
|
|
654
|
-
if (stackFrame.range.startColumn) {
|
|
655
|
-
data.lineNumber.textContent += `:${stackFrame.range.startColumn}`;
|
|
656
|
-
}
|
|
657
|
-
data.lineNumber.classList.remove('unavailable');
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
data.lineNumber.classList.add('unavailable');
|
|
661
|
-
}
|
|
662
|
-
data.actionBar.clear();
|
|
663
|
-
if (hasActions) {
|
|
664
|
-
const action = ( new Action('debug.callStack.restartFrame', ( localizeWithPath(
|
|
665
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
666
|
-
'restartFrame',
|
|
667
|
-
"Restart Frame"
|
|
668
|
-
)), ThemeIcon.asClassName(debugRestartFrame), true, async () => {
|
|
669
|
-
try {
|
|
670
|
-
await stackFrame.restart();
|
|
671
|
-
}
|
|
672
|
-
catch (e) {
|
|
673
|
-
this.notificationService.error(e);
|
|
674
|
-
}
|
|
675
|
-
}));
|
|
676
|
-
data.actionBar.push(action, { icon: true, label: false });
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
renderCompressedElements(node, index, templateData, height) {
|
|
680
|
-
throw new Error('Method not implemented.');
|
|
681
|
-
}
|
|
682
|
-
disposeTemplate(templateData) {
|
|
683
|
-
templateData.actionBar.dispose();
|
|
684
|
-
}
|
|
685
|
-
};
|
|
686
|
-
StackFramesRenderer = StackFramesRenderer_1 = ( __decorate([
|
|
687
|
-
( __param(0, ILabelService)),
|
|
688
|
-
( __param(1, INotificationService))
|
|
689
|
-
], StackFramesRenderer));
|
|
690
|
-
class ErrorsRenderer {
|
|
691
|
-
static { this.ID = 'error'; }
|
|
692
|
-
get templateId() {
|
|
693
|
-
return ErrorsRenderer.ID;
|
|
694
|
-
}
|
|
695
|
-
renderTemplate(container) {
|
|
696
|
-
const label = append(container, $('.error'));
|
|
697
|
-
return { label, templateDisposable: ( new DisposableStore()) };
|
|
698
|
-
}
|
|
699
|
-
renderElement(element, index, data) {
|
|
700
|
-
const error = element.element;
|
|
701
|
-
data.label.textContent = error;
|
|
702
|
-
data.templateDisposable.add(setupCustomHover(getDefaultHoverDelegate('mouse'), data.label, error));
|
|
703
|
-
}
|
|
704
|
-
renderCompressedElements(node, index, templateData, height) {
|
|
705
|
-
throw new Error('Method not implemented.');
|
|
706
|
-
}
|
|
707
|
-
disposeTemplate(templateData) {
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
class LoadMoreRenderer {
|
|
711
|
-
static { this.ID = 'loadMore'; }
|
|
712
|
-
static { this.LABEL = ( localizeWithPath(
|
|
713
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
714
|
-
'loadAllStackFrames',
|
|
715
|
-
"Load More Stack Frames"
|
|
716
|
-
)); }
|
|
717
|
-
constructor() { }
|
|
718
|
-
get templateId() {
|
|
719
|
-
return LoadMoreRenderer.ID;
|
|
720
|
-
}
|
|
721
|
-
renderTemplate(container) {
|
|
722
|
-
const label = append(container, $('.load-all'));
|
|
723
|
-
label.style.color = asCssVariable(textLinkForeground);
|
|
724
|
-
return { label };
|
|
725
|
-
}
|
|
726
|
-
renderElement(element, index, data) {
|
|
727
|
-
data.label.textContent = LoadMoreRenderer.LABEL;
|
|
728
|
-
}
|
|
729
|
-
renderCompressedElements(node, index, templateData, height) {
|
|
730
|
-
throw new Error('Method not implemented.');
|
|
731
|
-
}
|
|
732
|
-
disposeTemplate(templateData) {
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
class ShowMoreRenderer {
|
|
736
|
-
static { this.ID = 'showMore'; }
|
|
737
|
-
constructor() { }
|
|
738
|
-
get templateId() {
|
|
739
|
-
return ShowMoreRenderer.ID;
|
|
740
|
-
}
|
|
741
|
-
renderTemplate(container) {
|
|
742
|
-
const label = append(container, $('.show-more'));
|
|
743
|
-
label.style.color = asCssVariable(textLinkForeground);
|
|
744
|
-
return { label };
|
|
745
|
-
}
|
|
746
|
-
renderElement(element, index, data) {
|
|
747
|
-
const stackFrames = element.element;
|
|
748
|
-
if (stackFrames.every(sf => !!(sf.source && sf.source.origin && sf.source.origin === stackFrames[0].source.origin))) {
|
|
749
|
-
data.label.textContent = ( localizeWithPath(
|
|
750
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
751
|
-
'showMoreAndOrigin',
|
|
752
|
-
"Show {0} More: {1}",
|
|
753
|
-
stackFrames.length,
|
|
754
|
-
stackFrames[0].source.origin
|
|
755
|
-
));
|
|
756
|
-
}
|
|
757
|
-
else {
|
|
758
|
-
data.label.textContent = ( localizeWithPath(
|
|
759
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
760
|
-
'showMoreStackFrames',
|
|
761
|
-
"Show {0} More Stack Frames",
|
|
762
|
-
stackFrames.length
|
|
763
|
-
));
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
renderCompressedElements(node, index, templateData, height) {
|
|
767
|
-
throw new Error('Method not implemented.');
|
|
768
|
-
}
|
|
769
|
-
disposeTemplate(templateData) {
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
class CallStackDelegate {
|
|
773
|
-
getHeight(element) {
|
|
774
|
-
if (element instanceof StackFrame && element.presentationHint === 'label') {
|
|
775
|
-
return 16;
|
|
776
|
-
}
|
|
777
|
-
if (element instanceof ThreadAndSessionIds || element instanceof Array) {
|
|
778
|
-
return 16;
|
|
779
|
-
}
|
|
780
|
-
return 22;
|
|
781
|
-
}
|
|
782
|
-
getTemplateId(element) {
|
|
783
|
-
if (isDebugSession(element)) {
|
|
784
|
-
return SessionsRenderer.ID;
|
|
785
|
-
}
|
|
786
|
-
if (element instanceof Thread) {
|
|
787
|
-
return ThreadsRenderer.ID;
|
|
788
|
-
}
|
|
789
|
-
if (element instanceof StackFrame) {
|
|
790
|
-
return StackFramesRenderer.ID;
|
|
791
|
-
}
|
|
792
|
-
if (typeof element === 'string') {
|
|
793
|
-
return ErrorsRenderer.ID;
|
|
794
|
-
}
|
|
795
|
-
if (element instanceof ThreadAndSessionIds) {
|
|
796
|
-
return LoadMoreRenderer.ID;
|
|
797
|
-
}
|
|
798
|
-
return ShowMoreRenderer.ID;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
function stoppedText(stoppedDetails) {
|
|
802
|
-
return stoppedDetails.text ?? stoppedDescription(stoppedDetails);
|
|
803
|
-
}
|
|
804
|
-
function stoppedDescription(stoppedDetails) {
|
|
805
|
-
return stoppedDetails.description ||
|
|
806
|
-
(stoppedDetails.reason ? ( localizeWithPath(
|
|
807
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
808
|
-
{ key: 'pausedOn', comment: ['indicates reason for program being paused'] },
|
|
809
|
-
"Paused on {0}",
|
|
810
|
-
stoppedDetails.reason
|
|
811
|
-
)) : ( localizeWithPath('vs/workbench/contrib/debug/browser/callStackView', 'paused', "Paused")));
|
|
812
|
-
}
|
|
813
|
-
function isDebugModel(obj) {
|
|
814
|
-
return typeof obj.getSessions === 'function';
|
|
815
|
-
}
|
|
816
|
-
function isDebugSession(obj) {
|
|
817
|
-
return obj && typeof obj.getAllThreads === 'function';
|
|
818
|
-
}
|
|
819
|
-
function isDeemphasized(frame) {
|
|
820
|
-
return frame.source.presentationHint === 'deemphasize' || frame.presentationHint === 'deemphasize';
|
|
821
|
-
}
|
|
822
|
-
class CallStackDataSource {
|
|
823
|
-
constructor(debugService) {
|
|
824
|
-
this.debugService = debugService;
|
|
825
|
-
this.deemphasizedStackFramesToShow = [];
|
|
826
|
-
}
|
|
827
|
-
hasChildren(element) {
|
|
828
|
-
if (isDebugSession(element)) {
|
|
829
|
-
const threads = element.getAllThreads();
|
|
830
|
-
return (threads.length > 1) || (threads.length === 1 && threads[0].stopped) || !!(this.debugService.getModel().getSessions().find(s => s.parentSession === element));
|
|
831
|
-
}
|
|
832
|
-
return isDebugModel(element) || (element instanceof Thread && element.stopped);
|
|
833
|
-
}
|
|
834
|
-
async getChildren(element) {
|
|
835
|
-
if (isDebugModel(element)) {
|
|
836
|
-
const sessions = element.getSessions();
|
|
837
|
-
if (sessions.length === 0) {
|
|
838
|
-
return Promise.resolve([]);
|
|
839
|
-
}
|
|
840
|
-
if (sessions.length > 1 || this.debugService.getViewModel().isMultiSessionView()) {
|
|
841
|
-
return Promise.resolve(sessions.filter(s => !s.parentSession));
|
|
842
|
-
}
|
|
843
|
-
const threads = sessions[0].getAllThreads();
|
|
844
|
-
return threads.length === 1 ? this.getThreadChildren(threads[0]) : Promise.resolve(threads);
|
|
845
|
-
}
|
|
846
|
-
else if (isDebugSession(element)) {
|
|
847
|
-
const childSessions = this.debugService.getModel().getSessions().filter(s => s.parentSession === element);
|
|
848
|
-
const threads = element.getAllThreads();
|
|
849
|
-
if (threads.length === 1) {
|
|
850
|
-
const children = await this.getThreadChildren(threads[0]);
|
|
851
|
-
return children.concat(childSessions);
|
|
852
|
-
}
|
|
853
|
-
return Promise.resolve(threads.concat(childSessions));
|
|
854
|
-
}
|
|
855
|
-
else {
|
|
856
|
-
return this.getThreadChildren(element);
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
getThreadChildren(thread) {
|
|
860
|
-
return this.getThreadCallstack(thread).then(children => {
|
|
861
|
-
const result = [];
|
|
862
|
-
children.forEach((child, index) => {
|
|
863
|
-
if (child instanceof StackFrame && child.source && isDeemphasized(child)) {
|
|
864
|
-
if (this.deemphasizedStackFramesToShow.indexOf(child) === -1) {
|
|
865
|
-
if (result.length) {
|
|
866
|
-
const last = result[result.length - 1];
|
|
867
|
-
if (last instanceof Array) {
|
|
868
|
-
last.push(child);
|
|
869
|
-
return;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
const nextChild = index < children.length - 1 ? children[index + 1] : undefined;
|
|
873
|
-
if (nextChild instanceof StackFrame && nextChild.source && isDeemphasized(nextChild)) {
|
|
874
|
-
result.push([child]);
|
|
875
|
-
return;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
result.push(child);
|
|
880
|
-
});
|
|
881
|
-
return result;
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
|
-
async getThreadCallstack(thread) {
|
|
885
|
-
let callStack = thread.getCallStack();
|
|
886
|
-
if (!callStack || !callStack.length) {
|
|
887
|
-
await thread.fetchCallStack();
|
|
888
|
-
callStack = thread.getCallStack();
|
|
889
|
-
}
|
|
890
|
-
if (callStack.length === 1 && thread.session.capabilities.supportsDelayedStackTraceLoading && thread.stoppedDetails && thread.stoppedDetails.totalFrames && thread.stoppedDetails.totalFrames > 1) {
|
|
891
|
-
callStack = callStack.concat(thread.getStaleCallStack().slice(1));
|
|
892
|
-
}
|
|
893
|
-
if (thread.stoppedDetails && thread.stoppedDetails.framesErrorMessage) {
|
|
894
|
-
callStack = callStack.concat([thread.stoppedDetails.framesErrorMessage]);
|
|
895
|
-
}
|
|
896
|
-
if (!thread.reachedEndOfCallStack && thread.stoppedDetails) {
|
|
897
|
-
callStack = callStack.concat([( new ThreadAndSessionIds(thread.session.getId(), thread.threadId))]);
|
|
898
|
-
}
|
|
899
|
-
return callStack;
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
class CallStackAccessibilityProvider {
|
|
903
|
-
getWidgetAriaLabel() {
|
|
904
|
-
return ( localizeWithPath(
|
|
905
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
906
|
-
{ comment: ['Debug is a noun in this context, not a verb.'], key: 'callStackAriaLabel' },
|
|
907
|
-
"Debug Call Stack"
|
|
908
|
-
));
|
|
909
|
-
}
|
|
910
|
-
getWidgetRole() {
|
|
911
|
-
return 'treegrid';
|
|
912
|
-
}
|
|
913
|
-
getRole(_element) {
|
|
914
|
-
return 'row';
|
|
915
|
-
}
|
|
916
|
-
getAriaLabel(element) {
|
|
917
|
-
if (element instanceof Thread) {
|
|
918
|
-
return ( localizeWithPath(
|
|
919
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
920
|
-
{ key: 'threadAriaLabel', comment: ['Placeholders stand for the thread name and the thread state.For example "Thread 1" and "Stopped'] },
|
|
921
|
-
"Thread {0} {1}",
|
|
922
|
-
element.name,
|
|
923
|
-
element.stateLabel
|
|
924
|
-
));
|
|
925
|
-
}
|
|
926
|
-
if (element instanceof StackFrame) {
|
|
927
|
-
return ( localizeWithPath(
|
|
928
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
929
|
-
'stackFrameAriaLabel',
|
|
930
|
-
"Stack Frame {0}, line {1}, {2}",
|
|
931
|
-
element.name,
|
|
932
|
-
element.range.startLineNumber,
|
|
933
|
-
getSpecificSourceName(element)
|
|
934
|
-
));
|
|
935
|
-
}
|
|
936
|
-
if (isDebugSession(element)) {
|
|
937
|
-
const thread = element.getAllThreads().find(t => t.stopped);
|
|
938
|
-
const state = thread ? thread.stateLabel : ( localizeWithPath(
|
|
939
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
940
|
-
{ key: 'running', comment: ['indicates state'] },
|
|
941
|
-
"Running"
|
|
942
|
-
));
|
|
943
|
-
return ( localizeWithPath(
|
|
944
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
945
|
-
{ key: 'sessionLabel', comment: ['Placeholders stand for the session name and the session state. For example "Launch Program" and "Running"'] },
|
|
946
|
-
"Session {0} {1}",
|
|
947
|
-
element.getLabel(),
|
|
948
|
-
state
|
|
949
|
-
));
|
|
950
|
-
}
|
|
951
|
-
if (typeof element === 'string') {
|
|
952
|
-
return element;
|
|
953
|
-
}
|
|
954
|
-
if (element instanceof Array) {
|
|
955
|
-
return ( localizeWithPath(
|
|
956
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
957
|
-
'showMoreStackFrames',
|
|
958
|
-
"Show {0} More Stack Frames",
|
|
959
|
-
element.length
|
|
960
|
-
));
|
|
961
|
-
}
|
|
962
|
-
return LoadMoreRenderer.LABEL;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
class CallStackCompressionDelegate {
|
|
966
|
-
constructor(debugService) {
|
|
967
|
-
this.debugService = debugService;
|
|
968
|
-
}
|
|
969
|
-
isIncompressible(stat) {
|
|
970
|
-
if (isDebugSession(stat)) {
|
|
971
|
-
if (stat.compact) {
|
|
972
|
-
return false;
|
|
973
|
-
}
|
|
974
|
-
const sessions = this.debugService.getModel().getSessions();
|
|
975
|
-
if (( sessions.some(s => s.parentSession === stat && s.compact))) {
|
|
976
|
-
return false;
|
|
977
|
-
}
|
|
978
|
-
return true;
|
|
979
|
-
}
|
|
980
|
-
return true;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
registerAction2(class Collapse extends ViewAction {
|
|
984
|
-
constructor() {
|
|
985
|
-
super({
|
|
986
|
-
id: 'callStack.collapse',
|
|
987
|
-
viewId: CALLSTACK_VIEW_ID,
|
|
988
|
-
title: ( localizeWithPath(
|
|
989
|
-
'vs/workbench/contrib/debug/browser/callStackView',
|
|
990
|
-
'collapse',
|
|
991
|
-
"Collapse All"
|
|
992
|
-
)),
|
|
993
|
-
f1: false,
|
|
994
|
-
icon: Codicon.collapseAll,
|
|
995
|
-
precondition: ( CONTEXT_DEBUG_STATE.isEqualTo(getStateLabel(2 ))),
|
|
996
|
-
menu: {
|
|
997
|
-
id: MenuId.ViewTitle,
|
|
998
|
-
order: 10,
|
|
999
|
-
group: 'navigation',
|
|
1000
|
-
when: ( ContextKeyExpr.equals('view', CALLSTACK_VIEW_ID))
|
|
1001
|
-
}
|
|
1002
|
-
});
|
|
1003
|
-
}
|
|
1004
|
-
runInView(_accessor, view) {
|
|
1005
|
-
view.collapseAll();
|
|
1006
|
-
}
|
|
1007
|
-
});
|
|
1008
|
-
function registerCallStackInlineMenuItem(id, title, icon, when, order, precondition) {
|
|
1009
|
-
MenuRegistry.appendMenuItem(MenuId.DebugCallStackContext, {
|
|
1010
|
-
group: 'inline',
|
|
1011
|
-
order,
|
|
1012
|
-
when,
|
|
1013
|
-
command: { id, title, icon, precondition }
|
|
1014
|
-
});
|
|
1015
|
-
}
|
|
1016
|
-
const threadOrSessionWithOneThread = ( ContextKeyExpr.or(( CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread')), ( ContextKeyExpr.and(( CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session')), CONTEXT_CALLSTACK_SESSION_HAS_ONE_THREAD))));
|
|
1017
|
-
registerCallStackInlineMenuItem(PAUSE_ID, PAUSE_LABEL, debugPause, ( ContextKeyExpr.and(threadOrSessionWithOneThread, ( CONTEXT_CALLSTACK_ITEM_STOPPED.toNegated()))), 10, ( CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG.toNegated()));
|
|
1018
|
-
registerCallStackInlineMenuItem(CONTINUE_ID, CONTINUE_LABEL, debugContinue, ( ContextKeyExpr.and(threadOrSessionWithOneThread, CONTEXT_CALLSTACK_ITEM_STOPPED)), 10);
|
|
1019
|
-
registerCallStackInlineMenuItem(STEP_OVER_ID, STEP_OVER_LABEL, debugStepOver, threadOrSessionWithOneThread, 20, CONTEXT_CALLSTACK_ITEM_STOPPED);
|
|
1020
|
-
registerCallStackInlineMenuItem(STEP_INTO_ID, STEP_INTO_LABEL, debugStepInto, threadOrSessionWithOneThread, 30, CONTEXT_CALLSTACK_ITEM_STOPPED);
|
|
1021
|
-
registerCallStackInlineMenuItem(STEP_OUT_ID, STEP_OUT_LABEL, debugStepOut, threadOrSessionWithOneThread, 40, CONTEXT_CALLSTACK_ITEM_STOPPED);
|
|
1022
|
-
registerCallStackInlineMenuItem(RESTART_SESSION_ID, RESTART_LABEL, debugRestart, ( CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session')), 50);
|
|
1023
|
-
registerCallStackInlineMenuItem(STOP_ID, STOP_LABEL, debugStop, ( ContextKeyExpr.and(( CONTEXT_CALLSTACK_SESSION_IS_ATTACH.toNegated()), ( CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session')))), 60);
|
|
1024
|
-
registerCallStackInlineMenuItem(DISCONNECT_ID, DISCONNECT_LABEL, debugDisconnect, ( ContextKeyExpr.and(CONTEXT_CALLSTACK_SESSION_IS_ATTACH, ( CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session')))), 60);
|
|
1025
|
-
|
|
1026
|
-
export { CallStackView, getContext, getContextForContributedActions, getSpecificSourceName };
|