@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,636 +0,0 @@
|
|
|
1
|
-
import { getDomNodePagePosition } from 'vscode/vscode/vs/base/browser/dom';
|
|
2
|
-
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
3
|
-
import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
4
|
-
import { EditorAction, registerEditorAction } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
5
|
-
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
6
|
-
import { Position } from 'vscode/vscode/vs/editor/common/core/position';
|
|
7
|
-
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
8
|
-
import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
|
|
9
|
-
import { MessageController } from 'vscode/vscode/vs/editor/contrib/message/browser/messageController';
|
|
10
|
-
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
11
|
-
import { Action2, MenuId, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
12
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
13
|
-
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
14
|
-
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
15
|
-
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
16
|
-
import { PanelFocusContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
17
|
-
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
18
|
-
import { openBreakpointSource } from 'vscode/vscode/vs/workbench/contrib/debug/browser/breakpointsView';
|
|
19
|
-
import { DisassemblyView } from './disassemblyView.js';
|
|
20
|
-
import { CONTEXT_FOCUSED_STACK_FRAME_HAS_INSTRUCTION_POINTER_REFERENCE, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE, CONTEXT_DISASSEMBLE_REQUEST_SUPPORTED, CONTEXT_LANGUAGE_SUPPORTS_DISASSEMBLE_REQUEST, CONTEXT_CALLSTACK_ITEM_TYPE, CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DISASSEMBLY_VIEW_FOCUS, IDebugService, REPL_VIEW_ID, WATCH_VIEW_ID, CONTEXT_STEP_INTO_TARGETS_SUPPORTED, BREAKPOINT_EDITOR_CONTRIBUTION_ID, EDITOR_CONTRIBUTION_ID, CONTEXT_EXCEPTION_WIDGET_VISIBLE } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
21
|
-
import { getEvaluatableExpressionAtPosition } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugUtils';
|
|
22
|
-
import { DisassemblyViewInput } from 'vscode/vscode/vs/workbench/contrib/debug/common/disassemblyViewInput';
|
|
23
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
24
|
-
|
|
25
|
-
class ToggleBreakpointAction extends Action2 {
|
|
26
|
-
constructor() {
|
|
27
|
-
super({
|
|
28
|
-
id: 'editor.debug.action.toggleBreakpoint',
|
|
29
|
-
title: {
|
|
30
|
-
...( localize2WithPath(
|
|
31
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
32
|
-
'toggleBreakpointAction',
|
|
33
|
-
"Debug: Toggle Breakpoint"
|
|
34
|
-
)),
|
|
35
|
-
mnemonicTitle: ( localizeWithPath(
|
|
36
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
37
|
-
{ key: 'miToggleBreakpoint', comment: ['&& denotes a mnemonic'] },
|
|
38
|
-
"Toggle &&Breakpoint"
|
|
39
|
-
)),
|
|
40
|
-
},
|
|
41
|
-
precondition: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
42
|
-
keybinding: {
|
|
43
|
-
when: ( ContextKeyExpr.or(EditorContextKeys.editorTextFocus, CONTEXT_DISASSEMBLY_VIEW_FOCUS)),
|
|
44
|
-
primary: 67 ,
|
|
45
|
-
weight: 100
|
|
46
|
-
},
|
|
47
|
-
menu: {
|
|
48
|
-
id: MenuId.MenubarDebugMenu,
|
|
49
|
-
when: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
50
|
-
group: '4_new_breakpoint',
|
|
51
|
-
order: 1
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
async run(accessor) {
|
|
56
|
-
const editorService = accessor.get(IEditorService);
|
|
57
|
-
const debugService = accessor.get(IDebugService);
|
|
58
|
-
const activePane = editorService.activeEditorPane;
|
|
59
|
-
if (activePane instanceof DisassemblyView) {
|
|
60
|
-
const location = activePane.focusedAddressAndOffset;
|
|
61
|
-
if (location) {
|
|
62
|
-
const bps = debugService.getModel().getInstructionBreakpoints();
|
|
63
|
-
const toRemove = bps.find(bp => bp.address === location.address);
|
|
64
|
-
if (toRemove) {
|
|
65
|
-
debugService.removeInstructionBreakpoints(toRemove.instructionReference, toRemove.offset);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
debugService.addInstructionBreakpoint({ instructionReference: location.reference, offset: location.offset, address: location.address, canPersist: false });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const codeEditorService = accessor.get(ICodeEditorService);
|
|
74
|
-
const editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor();
|
|
75
|
-
if (editor?.hasModel()) {
|
|
76
|
-
const modelUri = editor.getModel().uri;
|
|
77
|
-
const canSet = debugService.canSetBreakpointsIn(editor.getModel());
|
|
78
|
-
const lineNumbers = [...( new Set(( editor.getSelections().map(s => s.getPosition().lineNumber))))];
|
|
79
|
-
await Promise.all(( lineNumbers.map(async (line) => {
|
|
80
|
-
const bps = debugService.getModel().getBreakpoints({ lineNumber: line, uri: modelUri });
|
|
81
|
-
if (bps.length) {
|
|
82
|
-
await Promise.all(( bps.map(bp => debugService.removeBreakpoints(bp.getId()))));
|
|
83
|
-
}
|
|
84
|
-
else if (canSet) {
|
|
85
|
-
await debugService.addBreakpoints(modelUri, [{ lineNumber: line }]);
|
|
86
|
-
}
|
|
87
|
-
})));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
class ConditionalBreakpointAction extends EditorAction {
|
|
92
|
-
constructor() {
|
|
93
|
-
super({
|
|
94
|
-
id: 'editor.debug.action.conditionalBreakpoint',
|
|
95
|
-
label: ( localizeWithPath(
|
|
96
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
97
|
-
'conditionalBreakpointEditorAction',
|
|
98
|
-
"Debug: Add Conditional Breakpoint..."
|
|
99
|
-
)),
|
|
100
|
-
alias: 'Debug: Add Conditional Breakpoint...',
|
|
101
|
-
precondition: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
102
|
-
menuOpts: {
|
|
103
|
-
menuId: MenuId.MenubarNewBreakpointMenu,
|
|
104
|
-
title: ( localizeWithPath(
|
|
105
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
106
|
-
{ key: 'miConditionalBreakpoint', comment: ['&& denotes a mnemonic'] },
|
|
107
|
-
"&&Conditional Breakpoint..."
|
|
108
|
-
)),
|
|
109
|
-
group: '1_breakpoints',
|
|
110
|
-
order: 1,
|
|
111
|
-
when: CONTEXT_DEBUGGERS_AVAILABLE
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
async run(accessor, editor) {
|
|
116
|
-
const debugService = accessor.get(IDebugService);
|
|
117
|
-
const position = editor.getPosition();
|
|
118
|
-
if (position && editor.hasModel() && debugService.canSetBreakpointsIn(editor.getModel())) {
|
|
119
|
-
editor.getContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID)?.showBreakpointWidget(position.lineNumber, undefined, 0 );
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
class LogPointAction extends EditorAction {
|
|
124
|
-
constructor() {
|
|
125
|
-
super({
|
|
126
|
-
id: 'editor.debug.action.addLogPoint',
|
|
127
|
-
label: ( localizeWithPath(
|
|
128
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
129
|
-
'logPointEditorAction',
|
|
130
|
-
"Debug: Add Logpoint..."
|
|
131
|
-
)),
|
|
132
|
-
precondition: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
133
|
-
alias: 'Debug: Add Logpoint...',
|
|
134
|
-
menuOpts: [
|
|
135
|
-
{
|
|
136
|
-
menuId: MenuId.MenubarNewBreakpointMenu,
|
|
137
|
-
title: ( localizeWithPath(
|
|
138
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
139
|
-
{ key: 'miLogPoint', comment: ['&& denotes a mnemonic'] },
|
|
140
|
-
"&&Logpoint..."
|
|
141
|
-
)),
|
|
142
|
-
group: '1_breakpoints',
|
|
143
|
-
order: 4,
|
|
144
|
-
when: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
145
|
-
}
|
|
146
|
-
]
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
async run(accessor, editor) {
|
|
150
|
-
const debugService = accessor.get(IDebugService);
|
|
151
|
-
const position = editor.getPosition();
|
|
152
|
-
if (position && editor.hasModel() && debugService.canSetBreakpointsIn(editor.getModel())) {
|
|
153
|
-
editor.getContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID)?.showBreakpointWidget(position.lineNumber, position.column, 2 );
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
class TriggerByBreakpointAction extends EditorAction {
|
|
158
|
-
constructor() {
|
|
159
|
-
super({
|
|
160
|
-
id: 'editor.debug.action.triggerByBreakpoint',
|
|
161
|
-
label: ( localizeWithPath(
|
|
162
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
163
|
-
'triggerByBreakpointEditorAction',
|
|
164
|
-
"Debug: Add Triggered Breakpoint..."
|
|
165
|
-
)),
|
|
166
|
-
precondition: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
167
|
-
alias: 'Debug: Triggered Breakpoint...',
|
|
168
|
-
menuOpts: [
|
|
169
|
-
{
|
|
170
|
-
menuId: MenuId.MenubarNewBreakpointMenu,
|
|
171
|
-
title: ( localizeWithPath(
|
|
172
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
173
|
-
{ key: 'miTriggerByBreakpoint', comment: ['&& denotes a mnemonic'] },
|
|
174
|
-
"&&Triggered Breakpoint..."
|
|
175
|
-
)),
|
|
176
|
-
group: '1_breakpoints',
|
|
177
|
-
order: 4,
|
|
178
|
-
when: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
179
|
-
}
|
|
180
|
-
]
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
async run(accessor, editor) {
|
|
184
|
-
const debugService = accessor.get(IDebugService);
|
|
185
|
-
const position = editor.getPosition();
|
|
186
|
-
if (position && editor.hasModel() && debugService.canSetBreakpointsIn(editor.getModel())) {
|
|
187
|
-
editor.getContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID)?.showBreakpointWidget(position.lineNumber, position.column, 3 );
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
class EditBreakpointAction extends EditorAction {
|
|
192
|
-
constructor() {
|
|
193
|
-
super({
|
|
194
|
-
id: 'editor.debug.action.editBreakpoint',
|
|
195
|
-
label: ( localizeWithPath(
|
|
196
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
197
|
-
'EditBreakpointEditorAction',
|
|
198
|
-
"Debug: Edit Breakpoint"
|
|
199
|
-
)),
|
|
200
|
-
alias: 'Debug: Edit Existing Breakpoint',
|
|
201
|
-
precondition: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
202
|
-
menuOpts: {
|
|
203
|
-
menuId: MenuId.MenubarNewBreakpointMenu,
|
|
204
|
-
title: ( localizeWithPath(
|
|
205
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
206
|
-
{ key: 'miEditBreakpoint', comment: ['&& denotes a mnemonic'] },
|
|
207
|
-
"&&Edit Breakpoint"
|
|
208
|
-
)),
|
|
209
|
-
group: '1_breakpoints',
|
|
210
|
-
order: 1,
|
|
211
|
-
when: CONTEXT_DEBUGGERS_AVAILABLE
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
async run(accessor, editor) {
|
|
216
|
-
const debugService = accessor.get(IDebugService);
|
|
217
|
-
const position = editor.getPosition();
|
|
218
|
-
const debugModel = debugService.getModel();
|
|
219
|
-
if (!(editor.hasModel() && position)) {
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
const lineBreakpoints = debugModel.getBreakpoints({ lineNumber: position.lineNumber });
|
|
223
|
-
if (lineBreakpoints.length === 0) {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
const breakpointDistances = ( lineBreakpoints.map(b => {
|
|
227
|
-
if (!b.column) {
|
|
228
|
-
return position.column;
|
|
229
|
-
}
|
|
230
|
-
return Math.abs(b.column - position.column);
|
|
231
|
-
}));
|
|
232
|
-
const closestBreakpointIndex = breakpointDistances.indexOf(Math.min(...breakpointDistances));
|
|
233
|
-
const closestBreakpoint = lineBreakpoints[closestBreakpointIndex];
|
|
234
|
-
editor.getContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID)?.showBreakpointWidget(closestBreakpoint.lineNumber, closestBreakpoint.column);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
class OpenDisassemblyViewAction extends Action2 {
|
|
238
|
-
static { this.ID = 'debug.action.openDisassemblyView'; }
|
|
239
|
-
constructor() {
|
|
240
|
-
super({
|
|
241
|
-
id: OpenDisassemblyViewAction.ID,
|
|
242
|
-
title: {
|
|
243
|
-
...( localize2WithPath(
|
|
244
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
245
|
-
'openDisassemblyView',
|
|
246
|
-
"Open Disassembly View"
|
|
247
|
-
)),
|
|
248
|
-
mnemonicTitle: ( localizeWithPath(
|
|
249
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
250
|
-
{ key: 'miDisassemblyView', comment: ['&& denotes a mnemonic'] },
|
|
251
|
-
"&&DisassemblyView"
|
|
252
|
-
)),
|
|
253
|
-
},
|
|
254
|
-
precondition: CONTEXT_FOCUSED_STACK_FRAME_HAS_INSTRUCTION_POINTER_REFERENCE,
|
|
255
|
-
menu: [
|
|
256
|
-
{
|
|
257
|
-
id: MenuId.EditorContext,
|
|
258
|
-
group: 'debug',
|
|
259
|
-
order: 5,
|
|
260
|
-
when: ( ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, ( PanelFocusContext.toNegated()), ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')), EditorContextKeys.editorTextFocus, CONTEXT_DISASSEMBLE_REQUEST_SUPPORTED, CONTEXT_LANGUAGE_SUPPORTS_DISASSEMBLE_REQUEST))
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
id: MenuId.DebugCallStackContext,
|
|
264
|
-
group: 'z_commands',
|
|
265
|
-
order: 50,
|
|
266
|
-
when: ( ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')), ( CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('stackFrame')), CONTEXT_DISASSEMBLE_REQUEST_SUPPORTED))
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
id: MenuId.CommandPalette,
|
|
270
|
-
when: ( ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')), CONTEXT_DISASSEMBLE_REQUEST_SUPPORTED))
|
|
271
|
-
}
|
|
272
|
-
]
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
run(accessor) {
|
|
276
|
-
const editorService = accessor.get(IEditorService);
|
|
277
|
-
editorService.openEditor(DisassemblyViewInput.instance, { pinned: true, revealIfOpened: true });
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
class ToggleDisassemblyViewSourceCodeAction extends Action2 {
|
|
281
|
-
static { this.ID = 'debug.action.toggleDisassemblyViewSourceCode'; }
|
|
282
|
-
static { this.configID = 'debug.disassemblyView.showSourceCode'; }
|
|
283
|
-
constructor() {
|
|
284
|
-
super({
|
|
285
|
-
id: ToggleDisassemblyViewSourceCodeAction.ID,
|
|
286
|
-
title: {
|
|
287
|
-
...( localize2WithPath(
|
|
288
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
289
|
-
'toggleDisassemblyViewSourceCode',
|
|
290
|
-
"Toggle Source Code in Disassembly View"
|
|
291
|
-
)),
|
|
292
|
-
mnemonicTitle: ( localizeWithPath(
|
|
293
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
294
|
-
{ key: 'mitogglesource', comment: ['&& denotes a mnemonic'] },
|
|
295
|
-
"&&ToggleSource"
|
|
296
|
-
)),
|
|
297
|
-
},
|
|
298
|
-
f1: true,
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
run(accessor, editor, ...args) {
|
|
302
|
-
const configService = accessor.get(IConfigurationService);
|
|
303
|
-
if (configService) {
|
|
304
|
-
const value = configService.getValue('debug').disassemblyView.showSourceCode;
|
|
305
|
-
configService.updateValue(ToggleDisassemblyViewSourceCodeAction.configID, !value);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
class RunToCursorAction extends EditorAction {
|
|
310
|
-
static { this.ID = 'editor.debug.action.runToCursor'; }
|
|
311
|
-
static { this.LABEL = ( localize2WithPath(
|
|
312
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
313
|
-
'runToCursor',
|
|
314
|
-
"Run to Cursor"
|
|
315
|
-
)); }
|
|
316
|
-
constructor() {
|
|
317
|
-
super({
|
|
318
|
-
id: RunToCursorAction.ID,
|
|
319
|
-
label: RunToCursorAction.LABEL.value,
|
|
320
|
-
alias: 'Debug: Run to Cursor',
|
|
321
|
-
precondition: ( ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, ( PanelFocusContext.toNegated()), ( ContextKeyExpr.or(EditorContextKeys.editorTextFocus, CONTEXT_DISASSEMBLY_VIEW_FOCUS)))),
|
|
322
|
-
contextMenuOpts: {
|
|
323
|
-
group: 'debug',
|
|
324
|
-
order: 2,
|
|
325
|
-
when: CONTEXT_IN_DEBUG_MODE
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
async run(accessor, editor) {
|
|
330
|
-
const position = editor.getPosition();
|
|
331
|
-
if (!(editor.hasModel() && position)) {
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
const uri = editor.getModel().uri;
|
|
335
|
-
const debugService = accessor.get(IDebugService);
|
|
336
|
-
const viewModel = debugService.getViewModel();
|
|
337
|
-
const uriIdentityService = accessor.get(IUriIdentityService);
|
|
338
|
-
let column = undefined;
|
|
339
|
-
const focusedStackFrame = viewModel.focusedStackFrame;
|
|
340
|
-
if (focusedStackFrame && uriIdentityService.extUri.isEqual(focusedStackFrame.source.uri, uri) && focusedStackFrame.range.startLineNumber === position.lineNumber) {
|
|
341
|
-
column = position.column;
|
|
342
|
-
}
|
|
343
|
-
await debugService.runTo(uri, position.lineNumber, column);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
class SelectionToReplAction extends EditorAction {
|
|
347
|
-
static { this.ID = 'editor.debug.action.selectionToRepl'; }
|
|
348
|
-
static { this.LABEL = ( localize2WithPath(
|
|
349
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
350
|
-
'evaluateInDebugConsole',
|
|
351
|
-
"Evaluate in Debug Console"
|
|
352
|
-
)); }
|
|
353
|
-
constructor() {
|
|
354
|
-
super({
|
|
355
|
-
id: SelectionToReplAction.ID,
|
|
356
|
-
label: SelectionToReplAction.LABEL.value,
|
|
357
|
-
alias: 'Debug: Evaluate in Console',
|
|
358
|
-
precondition: ( ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, EditorContextKeys.editorTextFocus)),
|
|
359
|
-
contextMenuOpts: {
|
|
360
|
-
group: 'debug',
|
|
361
|
-
order: 0
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
async run(accessor, editor) {
|
|
366
|
-
const debugService = accessor.get(IDebugService);
|
|
367
|
-
const viewsService = accessor.get(IViewsService);
|
|
368
|
-
const viewModel = debugService.getViewModel();
|
|
369
|
-
const session = viewModel.focusedSession;
|
|
370
|
-
if (!editor.hasModel() || !session) {
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
const selection = editor.getSelection();
|
|
374
|
-
let text;
|
|
375
|
-
if (selection.isEmpty()) {
|
|
376
|
-
text = editor.getModel().getLineContent(selection.selectionStartLineNumber).trim();
|
|
377
|
-
}
|
|
378
|
-
else {
|
|
379
|
-
text = editor.getModel().getValueInRange(selection);
|
|
380
|
-
}
|
|
381
|
-
await session.addReplExpression(viewModel.focusedStackFrame, text);
|
|
382
|
-
await viewsService.openView(REPL_VIEW_ID, false);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
class SelectionToWatchExpressionsAction extends EditorAction {
|
|
386
|
-
static { this.ID = 'editor.debug.action.selectionToWatch'; }
|
|
387
|
-
static { this.LABEL = ( localize2WithPath(
|
|
388
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
389
|
-
'addToWatch',
|
|
390
|
-
"Add to Watch"
|
|
391
|
-
)); }
|
|
392
|
-
constructor() {
|
|
393
|
-
super({
|
|
394
|
-
id: SelectionToWatchExpressionsAction.ID,
|
|
395
|
-
label: SelectionToWatchExpressionsAction.LABEL.value,
|
|
396
|
-
alias: 'Debug: Add to Watch',
|
|
397
|
-
precondition: ( ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, EditorContextKeys.editorTextFocus)),
|
|
398
|
-
contextMenuOpts: {
|
|
399
|
-
group: 'debug',
|
|
400
|
-
order: 1
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
async run(accessor, editor) {
|
|
405
|
-
const debugService = accessor.get(IDebugService);
|
|
406
|
-
const viewsService = accessor.get(IViewsService);
|
|
407
|
-
const languageFeaturesService = accessor.get(ILanguageFeaturesService);
|
|
408
|
-
if (!editor.hasModel()) {
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
let expression = undefined;
|
|
412
|
-
const model = editor.getModel();
|
|
413
|
-
const selection = editor.getSelection();
|
|
414
|
-
if (!selection.isEmpty()) {
|
|
415
|
-
expression = model.getValueInRange(selection);
|
|
416
|
-
}
|
|
417
|
-
else {
|
|
418
|
-
const position = editor.getPosition();
|
|
419
|
-
const evaluatableExpression = await getEvaluatableExpressionAtPosition(languageFeaturesService, model, position);
|
|
420
|
-
if (!evaluatableExpression) {
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
expression = evaluatableExpression.matchingExpression;
|
|
424
|
-
}
|
|
425
|
-
if (!expression) {
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
await viewsService.openView(WATCH_VIEW_ID);
|
|
429
|
-
debugService.addWatchExpression(expression);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
class ShowDebugHoverAction extends EditorAction {
|
|
433
|
-
constructor() {
|
|
434
|
-
super({
|
|
435
|
-
id: 'editor.debug.action.showDebugHover',
|
|
436
|
-
label: ( localizeWithPath(
|
|
437
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
438
|
-
'showDebugHover',
|
|
439
|
-
"Debug: Show Hover"
|
|
440
|
-
)),
|
|
441
|
-
alias: 'Debug: Show Hover',
|
|
442
|
-
precondition: CONTEXT_IN_DEBUG_MODE,
|
|
443
|
-
kbOpts: {
|
|
444
|
-
kbExpr: EditorContextKeys.editorTextFocus,
|
|
445
|
-
primary: KeyChord(2048 | 41 , 2048 | 39 ),
|
|
446
|
-
weight: 100
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
async run(accessor, editor) {
|
|
451
|
-
const position = editor.getPosition();
|
|
452
|
-
if (!position || !editor.hasModel()) {
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
return editor.getContribution(EDITOR_CONTRIBUTION_ID)?.showHover(position, true);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
const NO_TARGETS_MESSAGE = ( localizeWithPath(
|
|
459
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
460
|
-
'editor.debug.action.stepIntoTargets.notAvailable',
|
|
461
|
-
"Step targets are not available here"
|
|
462
|
-
));
|
|
463
|
-
class StepIntoTargetsAction extends EditorAction {
|
|
464
|
-
static { this.ID = 'editor.debug.action.stepIntoTargets'; }
|
|
465
|
-
static { this.LABEL = ( localizeWithPath(
|
|
466
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
467
|
-
{ key: 'stepIntoTargets', comment: ['Step Into Targets lets the user step into an exact function he or she is interested in.'] },
|
|
468
|
-
"Step Into Target"
|
|
469
|
-
)); }
|
|
470
|
-
constructor() {
|
|
471
|
-
super({
|
|
472
|
-
id: StepIntoTargetsAction.ID,
|
|
473
|
-
label: StepIntoTargetsAction.LABEL,
|
|
474
|
-
alias: 'Debug: Step Into Target',
|
|
475
|
-
precondition: ( ContextKeyExpr.and(CONTEXT_STEP_INTO_TARGETS_SUPPORTED, CONTEXT_IN_DEBUG_MODE, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')), EditorContextKeys.editorTextFocus)),
|
|
476
|
-
contextMenuOpts: {
|
|
477
|
-
group: 'debug',
|
|
478
|
-
order: 1.5
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
async run(accessor, editor) {
|
|
483
|
-
const debugService = accessor.get(IDebugService);
|
|
484
|
-
const contextMenuService = accessor.get(IContextMenuService);
|
|
485
|
-
const uriIdentityService = accessor.get(IUriIdentityService);
|
|
486
|
-
const session = debugService.getViewModel().focusedSession;
|
|
487
|
-
const frame = debugService.getViewModel().focusedStackFrame;
|
|
488
|
-
const selection = editor.getSelection();
|
|
489
|
-
const targetPosition = selection?.getPosition() || (frame && { lineNumber: frame.range.startLineNumber, column: frame.range.startColumn });
|
|
490
|
-
if (!session || !frame || !editor.hasModel() || !uriIdentityService.extUri.isEqual(editor.getModel().uri, frame.source.uri)) {
|
|
491
|
-
if (targetPosition) {
|
|
492
|
-
MessageController.get(editor)?.showMessage(NO_TARGETS_MESSAGE, targetPosition);
|
|
493
|
-
}
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
const targets = await session.stepInTargets(frame.frameId);
|
|
497
|
-
if (!targets?.length) {
|
|
498
|
-
MessageController.get(editor)?.showMessage(NO_TARGETS_MESSAGE, targetPosition);
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
if (selection) {
|
|
502
|
-
const positionalTargets = [];
|
|
503
|
-
for (const target of targets) {
|
|
504
|
-
if (target.line) {
|
|
505
|
-
positionalTargets.push({
|
|
506
|
-
start: ( new Position(target.line, target.column || 1)),
|
|
507
|
-
end: target.endLine ? ( new Position(target.endLine, target.endColumn || 1)) : undefined,
|
|
508
|
-
target
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
positionalTargets.sort((a, b) => b.start.lineNumber - a.start.lineNumber || b.start.column - a.start.column);
|
|
513
|
-
const needle = selection.getPosition();
|
|
514
|
-
const best = positionalTargets.find(t => t.end && needle.isBefore(t.end) && t.start.isBeforeOrEqual(needle)) || positionalTargets.find(t => t.end === undefined && t.start.isBeforeOrEqual(needle));
|
|
515
|
-
if (best) {
|
|
516
|
-
session.stepIn(frame.thread.threadId, best.target.id);
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
editor.revealLineInCenterIfOutsideViewport(frame.range.startLineNumber);
|
|
521
|
-
const cursorCoords = editor.getScrolledVisiblePosition(targetPosition);
|
|
522
|
-
const editorCoords = getDomNodePagePosition(editor.getDomNode());
|
|
523
|
-
const x = editorCoords.left + cursorCoords.left;
|
|
524
|
-
const y = editorCoords.top + cursorCoords.top + cursorCoords.height;
|
|
525
|
-
contextMenuService.showContextMenu({
|
|
526
|
-
getAnchor: () => ({ x, y }),
|
|
527
|
-
getActions: () => {
|
|
528
|
-
return ( targets.map(t => ( new Action(
|
|
529
|
-
`stepIntoTarget:${t.id}`,
|
|
530
|
-
t.label,
|
|
531
|
-
undefined,
|
|
532
|
-
true,
|
|
533
|
-
() => session.stepIn(frame.thread.threadId, t.id)
|
|
534
|
-
))));
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
class GoToBreakpointAction extends EditorAction {
|
|
540
|
-
constructor(isNext, opts) {
|
|
541
|
-
super(opts);
|
|
542
|
-
this.isNext = isNext;
|
|
543
|
-
}
|
|
544
|
-
async run(accessor, editor) {
|
|
545
|
-
const debugService = accessor.get(IDebugService);
|
|
546
|
-
const editorService = accessor.get(IEditorService);
|
|
547
|
-
const uriIdentityService = accessor.get(IUriIdentityService);
|
|
548
|
-
if (editor.hasModel()) {
|
|
549
|
-
const currentUri = editor.getModel().uri;
|
|
550
|
-
const currentLine = editor.getPosition().lineNumber;
|
|
551
|
-
const allEnabledBreakpoints = debugService.getModel().getBreakpoints({ enabledOnly: true });
|
|
552
|
-
let moveBreakpoint = this.isNext
|
|
553
|
-
? allEnabledBreakpoints.filter(bp => uriIdentityService.extUri.isEqual(bp.uri, currentUri) && bp.lineNumber > currentLine).shift()
|
|
554
|
-
: allEnabledBreakpoints.filter(bp => uriIdentityService.extUri.isEqual(bp.uri, currentUri) && bp.lineNumber < currentLine).pop();
|
|
555
|
-
if (!moveBreakpoint) {
|
|
556
|
-
moveBreakpoint =
|
|
557
|
-
this.isNext
|
|
558
|
-
? allEnabledBreakpoints.filter(bp => ( bp.uri.toString()) > ( currentUri.toString())).shift()
|
|
559
|
-
: allEnabledBreakpoints.filter(bp => ( bp.uri.toString()) < ( currentUri.toString())).pop();
|
|
560
|
-
}
|
|
561
|
-
if (!moveBreakpoint && allEnabledBreakpoints.length) {
|
|
562
|
-
moveBreakpoint = this.isNext ? allEnabledBreakpoints[0] : allEnabledBreakpoints[allEnabledBreakpoints.length - 1];
|
|
563
|
-
}
|
|
564
|
-
if (moveBreakpoint) {
|
|
565
|
-
return openBreakpointSource(moveBreakpoint, false, true, false, debugService, editorService);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
class GoToNextBreakpointAction extends GoToBreakpointAction {
|
|
571
|
-
constructor() {
|
|
572
|
-
super(true, {
|
|
573
|
-
id: 'editor.debug.action.goToNextBreakpoint',
|
|
574
|
-
label: ( localizeWithPath(
|
|
575
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
576
|
-
'goToNextBreakpoint',
|
|
577
|
-
"Debug: Go to Next Breakpoint"
|
|
578
|
-
)),
|
|
579
|
-
alias: 'Debug: Go to Next Breakpoint',
|
|
580
|
-
precondition: CONTEXT_DEBUGGERS_AVAILABLE
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
class GoToPreviousBreakpointAction extends GoToBreakpointAction {
|
|
585
|
-
constructor() {
|
|
586
|
-
super(false, {
|
|
587
|
-
id: 'editor.debug.action.goToPreviousBreakpoint',
|
|
588
|
-
label: ( localizeWithPath(
|
|
589
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
590
|
-
'goToPreviousBreakpoint',
|
|
591
|
-
"Debug: Go to Previous Breakpoint"
|
|
592
|
-
)),
|
|
593
|
-
alias: 'Debug: Go to Previous Breakpoint',
|
|
594
|
-
precondition: CONTEXT_DEBUGGERS_AVAILABLE
|
|
595
|
-
});
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
class CloseExceptionWidgetAction extends EditorAction {
|
|
599
|
-
constructor() {
|
|
600
|
-
super({
|
|
601
|
-
id: 'editor.debug.action.closeExceptionWidget',
|
|
602
|
-
label: ( localizeWithPath(
|
|
603
|
-
'vs/workbench/contrib/debug/browser/debugEditorActions',
|
|
604
|
-
'closeExceptionWidget',
|
|
605
|
-
"Close Exception Widget"
|
|
606
|
-
)),
|
|
607
|
-
alias: 'Close Exception Widget',
|
|
608
|
-
precondition: CONTEXT_EXCEPTION_WIDGET_VISIBLE,
|
|
609
|
-
kbOpts: {
|
|
610
|
-
primary: 9 ,
|
|
611
|
-
weight: 100
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
async run(_accessor, editor) {
|
|
616
|
-
const contribution = editor.getContribution(EDITOR_CONTRIBUTION_ID);
|
|
617
|
-
contribution?.closeExceptionWidget();
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
registerAction2(OpenDisassemblyViewAction);
|
|
621
|
-
registerAction2(ToggleDisassemblyViewSourceCodeAction);
|
|
622
|
-
registerAction2(ToggleBreakpointAction);
|
|
623
|
-
registerEditorAction(ConditionalBreakpointAction);
|
|
624
|
-
registerEditorAction(LogPointAction);
|
|
625
|
-
registerEditorAction(TriggerByBreakpointAction);
|
|
626
|
-
registerEditorAction(EditBreakpointAction);
|
|
627
|
-
registerEditorAction(RunToCursorAction);
|
|
628
|
-
registerEditorAction(StepIntoTargetsAction);
|
|
629
|
-
registerEditorAction(SelectionToReplAction);
|
|
630
|
-
registerEditorAction(SelectionToWatchExpressionsAction);
|
|
631
|
-
registerEditorAction(ShowDebugHoverAction);
|
|
632
|
-
registerEditorAction(GoToNextBreakpointAction);
|
|
633
|
-
registerEditorAction(GoToPreviousBreakpointAction);
|
|
634
|
-
registerEditorAction(CloseExceptionWidgetAction);
|
|
635
|
-
|
|
636
|
-
export { RunToCursorAction, SelectionToReplAction, SelectionToWatchExpressionsAction };
|