Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/debug/browser/debug.contribution.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';
7
import { FileAccess } from '../../../../base/common/network.js';
8
import { isMacintosh, isWeb } from '../../../../base/common/platform.js';
9
import { URI } from '../../../../base/common/uri.js';
10
import { EditorContributionInstantiation, registerEditorContribution } from '../../../../editor/browser/editorExtensions.js';
11
import * as nls from '../../../../nls.js';
12
import { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js';
13
import { ICommandActionTitle, Icon } from '../../../../platform/action/common/action.js';
14
import { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js';
15
import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js';
16
import { ContextKeyExpr, ContextKeyExpression } from '../../../../platform/contextkey/common/contextkey.js';
17
import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js';
18
import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
19
import { KeybindingWeight, KeybindingsRegistry } from '../../../../platform/keybinding/common/keybindingsRegistry.js';
20
import { IQuickAccessRegistry, Extensions as QuickAccessExtensions } from '../../../../platform/quickinput/common/quickAccess.js';
21
import { Registry } from '../../../../platform/registry/common/platform.js';
22
import { EditorPaneDescriptor, IEditorPaneRegistry } from '../../../browser/editor.js';
23
import { ViewPaneContainer } from '../../../browser/parts/views/viewPaneContainer.js';
24
import { FocusedViewContext } from '../../../common/contextkeys.js';
25
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, WorkbenchPhase, registerWorkbenchContribution2 } from '../../../common/contributions.js';
26
import { EditorExtensions } from '../../../common/editor.js';
27
import { IViewContainersRegistry, IViewsRegistry, ViewContainer, ViewContainerLocation, Extensions as ViewExtensions } from '../../../common/views.js';
28
import { launchSchemaId } from '../../../services/configuration/common/configuration.js';
29
import { LifecyclePhase } from '../../../services/lifecycle/common/lifecycle.js';
30
import { COPY_NOTEBOOK_VARIABLE_VALUE_ID, COPY_NOTEBOOK_VARIABLE_VALUE_LABEL } from '../../notebook/browser/contrib/notebookVariables/notebookVariableCommands.js';
31
import { BREAKPOINTS_VIEW_ID, BREAKPOINT_EDITOR_CONTRIBUTION_ID, CALLSTACK_VIEW_ID, CONTEXT_BREAKPOINTS_EXIST, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED, CONTEXT_CALLSTACK_ITEM_TYPE, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE, CONTEXT_DEBUG_UX, CONTEXT_EXPRESSION_SELECTED, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG, CONTEXT_HAS_DEBUGGED, CONTEXT_IN_DEBUG_MODE, CONTEXT_JUMP_TO_CURSOR_SUPPORTED, CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_RESTART_FRAME_SUPPORTED, CONTEXT_SET_EXPRESSION_SUPPORTED, CONTEXT_SET_VARIABLE_SUPPORTED, CONTEXT_STACK_FRAME_SUPPORTS_RESTART, CONTEXT_STEP_INTO_TARGETS_SUPPORTED, CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED, CONTEXT_TERMINATE_THREADS_SUPPORTED, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, CONTEXT_VARIABLE_IS_READONLY, CONTEXT_VARIABLE_VALUE, CONTEXT_WATCH_ITEM_TYPE, DEBUG_PANEL_ID, DISASSEMBLY_VIEW_ID, EDITOR_CONTRIBUTION_ID, IDebugService, INTERNAL_CONSOLE_OPTIONS_SCHEMA, LOADED_SCRIPTS_VIEW_ID, REPL_VIEW_ID, State, VARIABLES_VIEW_ID, VIEWLET_ID, WATCH_VIEW_ID, getStateLabel } from '../common/debug.js';
32
import { DebugWatchAccessibilityAnnouncer } from '../common/debugAccessibilityAnnouncer.js';
33
import { DebugContentProvider } from '../common/debugContentProvider.js';
34
import { DebugLifecycle } from '../common/debugLifecycle.js';
35
import { DebugVisualizerService, IDebugVisualizerService } from '../common/debugVisualizers.js';
36
import { DisassemblyViewInput } from '../common/disassemblyViewInput.js';
37
import { ReplAccessibilityAnnouncer } from '../common/replAccessibilityAnnouncer.js';
38
import { BreakpointEditorContribution } from './breakpointEditorContribution.js';
39
import { BreakpointsView } from './breakpointsView.js';
40
import { CallStackEditorContribution } from './callStackEditorContribution.js';
41
import { CallStackView } from './callStackView.js';
42
import { registerColors } from './debugColors.js';
43
import { ADD_CONFIGURATION_ID, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, CALLSTACK_BOTTOM_ID, CALLSTACK_BOTTOM_LABEL, CALLSTACK_DOWN_ID, CALLSTACK_DOWN_LABEL, CALLSTACK_TOP_ID, CALLSTACK_TOP_LABEL, CALLSTACK_UP_ID, CALLSTACK_UP_LABEL, CONTINUE_ID, CONTINUE_LABEL, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, COPY_STACK_TRACE_ID, COPY_VALUE_ID, COPY_VALUE_LABEL, DEBUG_COMMAND_CATEGORY, DEBUG_CONSOLE_QUICK_ACCESS_PREFIX, DEBUG_QUICK_ACCESS_PREFIX, DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, DEBUG_START_COMMAND_ID, DEBUG_START_LABEL, DISCONNECT_AND_SUSPEND_ID, DISCONNECT_AND_SUSPEND_LABEL, DISCONNECT_ID, DISCONNECT_LABEL, EDIT_EXPRESSION_COMMAND_ID, JUMP_TO_CURSOR_ID, NEXT_DEBUG_CONSOLE_ID, NEXT_DEBUG_CONSOLE_LABEL, OPEN_LOADED_SCRIPTS_LABEL, PAUSE_ID, PAUSE_LABEL, PREV_DEBUG_CONSOLE_ID, PREV_DEBUG_CONSOLE_LABEL, REMOVE_EXPRESSION_COMMAND_ID, RESTART_FRAME_ID, RESTART_LABEL, RESTART_SESSION_ID, SELECT_AND_START_ID, SELECT_AND_START_LABEL, SELECT_DEBUG_CONSOLE_ID, SELECT_DEBUG_CONSOLE_LABEL, SELECT_DEBUG_SESSION_ID, SELECT_DEBUG_SESSION_LABEL, SET_EXPRESSION_COMMAND_ID, SHOW_LOADED_SCRIPTS_ID, STEP_INTO_ID, STEP_INTO_LABEL, STEP_INTO_TARGET_ID, STEP_INTO_TARGET_LABEL, STEP_OUT_ID, STEP_OUT_LABEL, STEP_OVER_ID, STEP_OVER_LABEL, STOP_ID, STOP_LABEL, TERMINATE_THREAD_ID, TOGGLE_INLINE_BREAKPOINT_ID, COPY_ADDRESS_ID, COPY_ADDRESS_LABEL, TOGGLE_BREAKPOINT_ID, BREAK_WHEN_VALUE_CHANGES_ID, BREAK_WHEN_VALUE_IS_ACCESSED_ID, BREAK_WHEN_VALUE_IS_READ_ID } from './debugCommands.js';
44
import { DebugConsoleQuickAccess } from './debugConsoleQuickAccess.js';
45
import { RunToCursorAction, SelectionToReplAction, SelectionToWatchExpressionsAction } from './debugEditorActions.js';
46
import { DebugEditorContribution } from './debugEditorContribution.js';
47
import * as icons from './debugIcons.js';
48
import { DebugProgressContribution } from './debugProgress.js';
49
import { StartDebugQuickAccessProvider } from './debugQuickAccess.js';
50
import { DebugService } from './debugService.js';
51
import './debugSettingMigration.js';
52
import { DebugStatusContribution } from './debugStatus.js';
53
import { DebugTitleContribution } from './debugTitle.js';
54
import { DebugToolBar } from './debugToolBar.js';
55
import { DebugViewPaneContainer } from './debugViewlet.js';
56
import { DisassemblyView, DisassemblyViewContribution } from './disassemblyView.js';
57
import { LoadedScriptsView } from './loadedScriptsView.js';
58
import './media/debug.contribution.css';
59
import './media/debugHover.css';
60
import { Repl } from './repl.js';
61
import { ReplAccessibilityHelp } from './replAccessibilityHelp.js';
62
import { ReplAccessibleView } from './replAccessibleView.js';
63
import { RunAndDebugAccessibilityHelp } from './runAndDebugAccessibilityHelp.js';
64
import { StatusBarColorProvider } from './statusbarColorProvider.js';
65
import { SET_VARIABLE_ID, VIEW_MEMORY_ID, VariablesView } from './variablesView.js';
66
import { ADD_WATCH_ID, ADD_WATCH_LABEL, REMOVE_WATCH_EXPRESSIONS_COMMAND_ID, REMOVE_WATCH_EXPRESSIONS_LABEL, WatchExpressionsView } from './watchExpressionsView.js';
67
import { WelcomeView } from './welcomeView.js';
68
69
const debugCategory = nls.localize('debugCategory', "Debug");
70
registerColors();
71
registerSingleton(IDebugService, DebugService, InstantiationType.Delayed);
72
registerSingleton(IDebugVisualizerService, DebugVisualizerService, InstantiationType.Delayed);
73
74
// Register Debug Workbench Contributions
75
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugStatusContribution, LifecyclePhase.Eventually);
76
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugProgressContribution, LifecyclePhase.Eventually);
77
if (isWeb) {
78
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugTitleContribution, LifecyclePhase.Eventually);
79
}
80
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugToolBar, LifecyclePhase.Restored);
81
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugContentProvider, LifecyclePhase.Eventually);
82
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(StatusBarColorProvider, LifecyclePhase.Eventually);
83
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DisassemblyViewContribution, LifecyclePhase.Eventually);
84
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugLifecycle, LifecyclePhase.Eventually);
85
86
// Register Quick Access
87
Registry.as<IQuickAccessRegistry>(QuickAccessExtensions.Quickaccess).registerQuickAccessProvider({
88
ctor: StartDebugQuickAccessProvider,
89
prefix: DEBUG_QUICK_ACCESS_PREFIX,
90
contextKey: 'inLaunchConfigurationsPicker',
91
placeholder: nls.localize('startDebugPlaceholder', "Type the name of a launch configuration to run."),
92
helpEntries: [{
93
description: nls.localize('startDebuggingHelp', "Start Debugging"),
94
commandId: SELECT_AND_START_ID,
95
commandCenterOrder: 50
96
}]
97
});
98
99
// Register quick access for debug console
100
Registry.as<IQuickAccessRegistry>(QuickAccessExtensions.Quickaccess).registerQuickAccessProvider({
101
ctor: DebugConsoleQuickAccess,
102
prefix: DEBUG_CONSOLE_QUICK_ACCESS_PREFIX,
103
contextKey: 'inDebugConsolePicker',
104
placeholder: nls.localize('tasksQuickAccessPlaceholder', "Type the name of a debug console to open."),
105
helpEntries: [{ description: nls.localize('tasksQuickAccessHelp', "Show All Debug Consoles"), commandId: SELECT_DEBUG_CONSOLE_ID }]
106
});
107
108
registerEditorContribution('editor.contrib.callStack', CallStackEditorContribution, EditorContributionInstantiation.AfterFirstRender);
109
registerEditorContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID, BreakpointEditorContribution, EditorContributionInstantiation.AfterFirstRender);
110
registerEditorContribution(EDITOR_CONTRIBUTION_ID, DebugEditorContribution, EditorContributionInstantiation.BeforeFirstInteraction);
111
112
const registerDebugCommandPaletteItem = (id: string, title: ICommandActionTitle, when?: ContextKeyExpression, precondition?: ContextKeyExpression) => {
113
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
114
when: ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, when),
115
group: debugCategory,
116
command: {
117
id,
118
title,
119
category: DEBUG_COMMAND_CATEGORY,
120
precondition
121
}
122
});
123
};
124
125
registerDebugCommandPaletteItem(RESTART_SESSION_ID, RESTART_LABEL);
126
registerDebugCommandPaletteItem(TERMINATE_THREAD_ID, nls.localize2('terminateThread', "Terminate Thread"), CONTEXT_IN_DEBUG_MODE, CONTEXT_TERMINATE_THREADS_SUPPORTED);
127
registerDebugCommandPaletteItem(STEP_OVER_ID, STEP_OVER_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
128
registerDebugCommandPaletteItem(STEP_INTO_ID, STEP_INTO_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
129
registerDebugCommandPaletteItem(STEP_INTO_TARGET_ID, STEP_INTO_TARGET_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.and(CONTEXT_STEP_INTO_TARGETS_SUPPORTED, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
130
registerDebugCommandPaletteItem(STEP_OUT_ID, STEP_OUT_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
131
registerDebugCommandPaletteItem(PAUSE_ID, PAUSE_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.and(CONTEXT_DEBUG_STATE.isEqualTo('running'), CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG.toNegated()));
132
registerDebugCommandPaletteItem(DISCONNECT_ID, DISCONNECT_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.or(CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED));
133
registerDebugCommandPaletteItem(DISCONNECT_AND_SUSPEND_ID, DISCONNECT_AND_SUSPEND_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.or(CONTEXT_FOCUSED_SESSION_IS_ATTACH, ContextKeyExpr.and(CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)));
134
registerDebugCommandPaletteItem(STOP_ID, STOP_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.or(CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated(), CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED));
135
registerDebugCommandPaletteItem(CONTINUE_ID, CONTINUE_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
136
registerDebugCommandPaletteItem(JUMP_TO_CURSOR_ID, nls.localize2('jumpToCursor', "Jump to Cursor"), CONTEXT_JUMP_TO_CURSOR_SUPPORTED);
137
registerDebugCommandPaletteItem(JUMP_TO_CURSOR_ID, nls.localize2('SetNextStatement', "Set Next Statement"), CONTEXT_JUMP_TO_CURSOR_SUPPORTED);
138
registerDebugCommandPaletteItem(RunToCursorAction.ID, RunToCursorAction.LABEL, CONTEXT_DEBUGGERS_AVAILABLE);
139
registerDebugCommandPaletteItem(SelectionToReplAction.ID, SelectionToReplAction.LABEL, CONTEXT_IN_DEBUG_MODE);
140
registerDebugCommandPaletteItem(SelectionToWatchExpressionsAction.ID, SelectionToWatchExpressionsAction.LABEL);
141
registerDebugCommandPaletteItem(TOGGLE_INLINE_BREAKPOINT_ID, nls.localize2('inlineBreakpoint', "Inline Breakpoint"));
142
registerDebugCommandPaletteItem(DEBUG_START_COMMAND_ID, DEBUG_START_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));
143
registerDebugCommandPaletteItem(DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));
144
registerDebugCommandPaletteItem(SELECT_AND_START_ID, SELECT_AND_START_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));
145
registerDebugCommandPaletteItem(NEXT_DEBUG_CONSOLE_ID, NEXT_DEBUG_CONSOLE_LABEL);
146
registerDebugCommandPaletteItem(PREV_DEBUG_CONSOLE_ID, PREV_DEBUG_CONSOLE_LABEL);
147
registerDebugCommandPaletteItem(SHOW_LOADED_SCRIPTS_ID, OPEN_LOADED_SCRIPTS_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_LOADED_SCRIPTS_SUPPORTED);
148
registerDebugCommandPaletteItem(SELECT_DEBUG_CONSOLE_ID, SELECT_DEBUG_CONSOLE_LABEL);
149
registerDebugCommandPaletteItem(SELECT_DEBUG_SESSION_ID, SELECT_DEBUG_SESSION_LABEL);
150
registerDebugCommandPaletteItem(CALLSTACK_TOP_ID, CALLSTACK_TOP_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
151
registerDebugCommandPaletteItem(CALLSTACK_BOTTOM_ID, CALLSTACK_BOTTOM_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
152
registerDebugCommandPaletteItem(CALLSTACK_UP_ID, CALLSTACK_UP_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
153
registerDebugCommandPaletteItem(CALLSTACK_DOWN_ID, CALLSTACK_DOWN_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
154
155
// Debug callstack context menu
156
const registerDebugViewMenuItem = (menuId: MenuId, id: string, title: string | ICommandActionTitle, order: number, when?: ContextKeyExpression, precondition?: ContextKeyExpression, group = 'navigation', icon?: Icon) => {
157
MenuRegistry.appendMenuItem(menuId, {
158
group,
159
when,
160
order,
161
icon,
162
command: {
163
id,
164
title,
165
icon,
166
precondition
167
}
168
});
169
};
170
registerDebugViewMenuItem(MenuId.DebugCallStackContext, RESTART_SESSION_ID, RESTART_LABEL, 10, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), undefined, '3_modification');
171
registerDebugViewMenuItem(MenuId.DebugCallStackContext, DISCONNECT_ID, DISCONNECT_LABEL, 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), undefined, '3_modification');
172
registerDebugViewMenuItem(MenuId.DebugCallStackContext, DISCONNECT_AND_SUSPEND_ID, DISCONNECT_AND_SUSPEND_LABEL, 21, ContextKeyExpr.and(CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED), undefined, '3_modification');
173
registerDebugViewMenuItem(MenuId.DebugCallStackContext, STOP_ID, STOP_LABEL, 30, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), undefined, '3_modification');
174
registerDebugViewMenuItem(MenuId.DebugCallStackContext, PAUSE_ID, PAUSE_LABEL, 10, ContextKeyExpr.and(CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), ContextKeyExpr.and(CONTEXT_DEBUG_STATE.isEqualTo('running'), CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG.toNegated())));
175
registerDebugViewMenuItem(MenuId.DebugCallStackContext, CONTINUE_ID, CONTINUE_LABEL, 10, ContextKeyExpr.and(CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
176
registerDebugViewMenuItem(MenuId.DebugCallStackContext, STEP_OVER_ID, STEP_OVER_LABEL, 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
177
registerDebugViewMenuItem(MenuId.DebugCallStackContext, STEP_INTO_ID, STEP_INTO_LABEL, 30, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
178
registerDebugViewMenuItem(MenuId.DebugCallStackContext, STEP_OUT_ID, STEP_OUT_LABEL, 40, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
179
registerDebugViewMenuItem(MenuId.DebugCallStackContext, TERMINATE_THREAD_ID, nls.localize('terminateThread', "Terminate Thread"), 10, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_TERMINATE_THREADS_SUPPORTED, 'termination');
180
registerDebugViewMenuItem(MenuId.DebugCallStackContext, RESTART_FRAME_ID, nls.localize('restartFrame', "Restart Frame"), 10, ContextKeyExpr.and(CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('stackFrame'), CONTEXT_RESTART_FRAME_SUPPORTED), CONTEXT_STACK_FRAME_SUPPORTS_RESTART);
181
registerDebugViewMenuItem(MenuId.DebugCallStackContext, COPY_STACK_TRACE_ID, nls.localize('copyStackTrace', "Copy Call Stack"), 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('stackFrame'), undefined, '3_modification');
182
183
registerDebugViewMenuItem(MenuId.DebugVariablesContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 15, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_IN_DEBUG_MODE, 'inline', icons.debugInspectMemory);
184
registerDebugViewMenuItem(MenuId.DebugVariablesContext, SET_VARIABLE_ID, nls.localize('setValue', "Set Value"), 10, ContextKeyExpr.or(CONTEXT_SET_VARIABLE_SUPPORTED, ContextKeyExpr.and(CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, CONTEXT_SET_EXPRESSION_SUPPORTED)), CONTEXT_VARIABLE_IS_READONLY.toNegated(), '3_modification');
185
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_VALUE_ID, COPY_VALUE_LABEL, 10, undefined, undefined, '5_cutcopypaste');
186
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');
187
registerDebugViewMenuItem(MenuId.DebugVariablesContext, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');
188
registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_IS_READ_ID, nls.localize('breakWhenValueIsRead', "Break on Value Read"), 200, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED, undefined, 'z_commands');
189
registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');
190
registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_IS_ACCESSED_ID, nls.localize('breakWhenValueIsAccessed', "Break on Value Access"), 220, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, undefined, 'z_commands');
191
192
registerDebugViewMenuItem(MenuId.DebugHoverContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 15, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_IN_DEBUG_MODE, 'inline', icons.debugInspectMemory);
193
registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_VALUE_ID, COPY_VALUE_LABEL, 10, undefined, undefined, '5_cutcopypaste');
194
registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');
195
registerDebugViewMenuItem(MenuId.DebugHoverContext, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');
196
registerDebugViewMenuItem(MenuId.DebugHoverContext, BREAK_WHEN_VALUE_IS_READ_ID, nls.localize('breakWhenValueIsRead', "Break on Value Read"), 200, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED, undefined, 'z_commands');
197
registerDebugViewMenuItem(MenuId.DebugHoverContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');
198
registerDebugViewMenuItem(MenuId.DebugHoverContext, BREAK_WHEN_VALUE_IS_ACCESSED_ID, nls.localize('breakWhenValueIsAccessed', "Break on Value Access"), 220, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, undefined, 'z_commands');
199
200
registerDebugViewMenuItem(MenuId.DebugWatchContext, ADD_WATCH_ID, ADD_WATCH_LABEL, 10, undefined, undefined, '3_modification');
201
registerDebugViewMenuItem(MenuId.DebugWatchContext, EDIT_EXPRESSION_COMMAND_ID, nls.localize('editWatchExpression', "Edit Expression"), 20, CONTEXT_WATCH_ITEM_TYPE.isEqualTo('expression'), undefined, '3_modification');
202
registerDebugViewMenuItem(MenuId.DebugWatchContext, SET_EXPRESSION_COMMAND_ID, nls.localize('setValue', "Set Value"), 30, ContextKeyExpr.or(ContextKeyExpr.and(CONTEXT_WATCH_ITEM_TYPE.isEqualTo('expression'), CONTEXT_SET_EXPRESSION_SUPPORTED), ContextKeyExpr.and(CONTEXT_WATCH_ITEM_TYPE.isEqualTo('variable'), CONTEXT_SET_VARIABLE_SUPPORTED)), CONTEXT_VARIABLE_IS_READONLY.toNegated(), '3_modification');
203
registerDebugViewMenuItem(MenuId.DebugWatchContext, COPY_VALUE_ID, nls.localize('copyValue', "Copy Value"), 40, ContextKeyExpr.or(CONTEXT_WATCH_ITEM_TYPE.isEqualTo('expression'), CONTEXT_WATCH_ITEM_TYPE.isEqualTo('variable')), CONTEXT_IN_DEBUG_MODE, '3_modification');
204
registerDebugViewMenuItem(MenuId.DebugWatchContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 10, CONTEXT_CAN_VIEW_MEMORY, undefined, 'inline', icons.debugInspectMemory);
205
registerDebugViewMenuItem(MenuId.DebugWatchContext, REMOVE_EXPRESSION_COMMAND_ID, nls.localize('removeWatchExpression', "Remove Expression"), 20, CONTEXT_WATCH_ITEM_TYPE.isEqualTo('expression'), undefined, 'inline', icons.watchExpressionRemove);
206
registerDebugViewMenuItem(MenuId.DebugWatchContext, REMOVE_WATCH_EXPRESSIONS_COMMAND_ID, REMOVE_WATCH_EXPRESSIONS_LABEL, 20, undefined, undefined, 'z_commands');
207
registerDebugViewMenuItem(MenuId.DebugWatchContext, BREAK_WHEN_VALUE_IS_READ_ID, nls.localize('breakWhenValueIsRead', "Break on Value Read"), 200, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED, undefined, 'z_commands');
208
registerDebugViewMenuItem(MenuId.DebugWatchContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');
209
registerDebugViewMenuItem(MenuId.DebugWatchContext, BREAK_WHEN_VALUE_IS_ACCESSED_ID, nls.localize('breakWhenValueIsAccessed', "Break on Value Access"), 220, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, undefined, 'z_commands');
210
211
registerDebugViewMenuItem(MenuId.NotebookVariablesContext, COPY_NOTEBOOK_VARIABLE_VALUE_ID, COPY_NOTEBOOK_VARIABLE_VALUE_LABEL, 20, CONTEXT_VARIABLE_VALUE);
212
213
KeybindingsRegistry.registerKeybindingRule({
214
id: COPY_VALUE_ID,
215
weight: KeybindingWeight.WorkbenchContrib,
216
when: ContextKeyExpr.and(
217
CONTEXT_EXPRESSION_SELECTED.negate(),
218
ContextKeyExpr.or(
219
FocusedViewContext.isEqualTo(WATCH_VIEW_ID),
220
FocusedViewContext.isEqualTo(VARIABLES_VIEW_ID),
221
),
222
),
223
primary: KeyMod.CtrlCmd | KeyCode.KeyC
224
});
225
226
// Touch Bar
227
if (isMacintosh) {
228
229
const registerTouchBarEntry = (id: string, title: string | ICommandActionTitle, order: number, when: ContextKeyExpression | undefined, iconUri: URI) => {
230
MenuRegistry.appendMenuItem(MenuId.TouchBarContext, {
231
command: {
232
id,
233
title,
234
icon: { dark: iconUri }
235
},
236
when: ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, when),
237
group: '9_debug',
238
order
239
});
240
};
241
242
registerTouchBarEntry(DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, 0, CONTEXT_IN_DEBUG_MODE.toNegated(), FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/continue-tb.png'));
243
registerTouchBarEntry(DEBUG_START_COMMAND_ID, DEBUG_START_LABEL, 1, CONTEXT_IN_DEBUG_MODE.toNegated(), FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/run-with-debugging-tb.png'));
244
registerTouchBarEntry(CONTINUE_ID, CONTINUE_LABEL, 0, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/continue-tb.png'));
245
registerTouchBarEntry(PAUSE_ID, PAUSE_LABEL, 1, ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.and(CONTEXT_DEBUG_STATE.isEqualTo('running'), CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG.toNegated())), FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/pause-tb.png'));
246
registerTouchBarEntry(STEP_OVER_ID, STEP_OVER_LABEL, 2, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stepover-tb.png'));
247
registerTouchBarEntry(STEP_INTO_ID, STEP_INTO_LABEL, 3, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stepinto-tb.png'));
248
registerTouchBarEntry(STEP_OUT_ID, STEP_OUT_LABEL, 4, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stepout-tb.png'));
249
registerTouchBarEntry(RESTART_SESSION_ID, RESTART_LABEL, 5, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/restart-tb.png'));
250
registerTouchBarEntry(STOP_ID, STOP_LABEL, 6, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stop-tb.png'));
251
}
252
253
// Editor Title Menu's "Run/Debug" dropdown item
254
255
MenuRegistry.appendMenuItem(MenuId.EditorTitle, { submenu: MenuId.EditorTitleRun, rememberDefaultAction: true, title: nls.localize2('run', "Run or Debug..."), icon: icons.debugRun, group: 'navigation', order: -1 });
256
257
// Debug menu
258
259
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
260
submenu: MenuId.MenubarDebugMenu,
261
title: {
262
...nls.localize2('runMenu', "Run"),
263
mnemonicTitle: nls.localize({ key: 'mRun', comment: ['&& denotes a mnemonic'] }, "&&Run")
264
},
265
order: 6
266
});
267
268
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
269
group: '1_debug',
270
command: {
271
id: DEBUG_START_COMMAND_ID,
272
title: nls.localize({ key: 'miStartDebugging', comment: ['&& denotes a mnemonic'] }, "&&Start Debugging")
273
},
274
order: 1,
275
when: CONTEXT_DEBUGGERS_AVAILABLE
276
});
277
278
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
279
group: '1_debug',
280
command: {
281
id: DEBUG_RUN_COMMAND_ID,
282
title: nls.localize({ key: 'miRun', comment: ['&& denotes a mnemonic'] }, "Run &&Without Debugging")
283
},
284
order: 2,
285
when: CONTEXT_DEBUGGERS_AVAILABLE
286
});
287
288
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
289
group: '1_debug',
290
command: {
291
id: STOP_ID,
292
title: nls.localize({ key: 'miStopDebugging', comment: ['&& denotes a mnemonic'] }, "&&Stop Debugging"),
293
precondition: CONTEXT_IN_DEBUG_MODE
294
},
295
order: 3,
296
when: CONTEXT_DEBUGGERS_AVAILABLE
297
});
298
299
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
300
group: '1_debug',
301
command: {
302
id: RESTART_SESSION_ID,
303
title: nls.localize({ key: 'miRestart Debugging', comment: ['&& denotes a mnemonic'] }, "&&Restart Debugging"),
304
precondition: CONTEXT_IN_DEBUG_MODE
305
},
306
order: 4,
307
when: CONTEXT_DEBUGGERS_AVAILABLE
308
});
309
310
// Configuration
311
312
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
313
group: '2_configuration',
314
command: {
315
id: ADD_CONFIGURATION_ID,
316
title: nls.localize({ key: 'miAddConfiguration', comment: ['&& denotes a mnemonic'] }, "A&&dd Configuration...")
317
},
318
order: 2,
319
when: CONTEXT_DEBUGGERS_AVAILABLE
320
});
321
322
// Step Commands
323
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
324
group: '3_step',
325
command: {
326
id: STEP_OVER_ID,
327
title: nls.localize({ key: 'miStepOver', comment: ['&& denotes a mnemonic'] }, "Step &&Over"),
328
precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')
329
},
330
order: 1,
331
when: CONTEXT_DEBUGGERS_AVAILABLE
332
});
333
334
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
335
group: '3_step',
336
command: {
337
id: STEP_INTO_ID,
338
title: nls.localize({ key: 'miStepInto', comment: ['&& denotes a mnemonic'] }, "Step &&Into"),
339
precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')
340
},
341
order: 2,
342
when: CONTEXT_DEBUGGERS_AVAILABLE
343
});
344
345
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
346
group: '3_step',
347
command: {
348
id: STEP_OUT_ID,
349
title: nls.localize({ key: 'miStepOut', comment: ['&& denotes a mnemonic'] }, "Step O&&ut"),
350
precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')
351
},
352
order: 3,
353
when: CONTEXT_DEBUGGERS_AVAILABLE
354
});
355
356
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
357
group: '3_step',
358
command: {
359
id: CONTINUE_ID,
360
title: nls.localize({ key: 'miContinue', comment: ['&& denotes a mnemonic'] }, "&&Continue"),
361
precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')
362
},
363
order: 4,
364
when: CONTEXT_DEBUGGERS_AVAILABLE
365
});
366
367
// New Breakpoints
368
369
MenuRegistry.appendMenuItem(MenuId.MenubarNewBreakpointMenu, {
370
group: '1_breakpoints',
371
command: {
372
id: TOGGLE_INLINE_BREAKPOINT_ID,
373
title: nls.localize({ key: 'miInlineBreakpoint', comment: ['&& denotes a mnemonic'] }, "Inline Breakp&&oint")
374
},
375
order: 2,
376
when: CONTEXT_DEBUGGERS_AVAILABLE
377
});
378
379
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
380
group: '4_new_breakpoint',
381
title: nls.localize({ key: 'miNewBreakpoint', comment: ['&& denotes a mnemonic'] }, "&&New Breakpoint"),
382
submenu: MenuId.MenubarNewBreakpointMenu,
383
order: 2,
384
when: CONTEXT_DEBUGGERS_AVAILABLE
385
});
386
387
// Disassembly
388
389
MenuRegistry.appendMenuItem(MenuId.DebugDisassemblyContext, {
390
group: '1_edit',
391
command: {
392
id: COPY_ADDRESS_ID,
393
title: COPY_ADDRESS_LABEL,
394
},
395
order: 2,
396
when: CONTEXT_DEBUGGERS_AVAILABLE
397
});
398
399
MenuRegistry.appendMenuItem(MenuId.DebugDisassemblyContext, {
400
group: '3_breakpoints',
401
command: {
402
id: TOGGLE_BREAKPOINT_ID,
403
title: nls.localize({ key: 'miToggleBreakpoint', comment: ['&& denotes a mnemonic'] }, "Toggle Breakpoint"),
404
},
405
order: 2,
406
when: CONTEXT_DEBUGGERS_AVAILABLE
407
});
408
409
// Breakpoint actions are registered from breakpointsView.ts
410
411
// Install Debuggers
412
MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {
413
group: 'z_install',
414
command: {
415
id: 'debug.installAdditionalDebuggers',
416
title: nls.localize({ key: 'miInstallAdditionalDebuggers', comment: ['&& denotes a mnemonic'] }, "&&Install Additional Debuggers...")
417
},
418
order: 1
419
});
420
421
// register repl panel
422
423
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
424
id: DEBUG_PANEL_ID,
425
title: nls.localize2({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"),
426
icon: icons.debugConsoleViewIcon,
427
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [DEBUG_PANEL_ID, { mergeViewWithContainerWhenSingleView: true }]),
428
storageId: DEBUG_PANEL_ID,
429
hideIfEmpty: true,
430
order: 2,
431
}, ViewContainerLocation.Panel, { doNotRegisterOpenCommand: true });
432
433
Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{
434
id: REPL_VIEW_ID,
435
name: nls.localize2({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"),
436
containerIcon: icons.debugConsoleViewIcon,
437
canToggleVisibility: true,
438
canMoveView: true,
439
when: CONTEXT_DEBUGGERS_AVAILABLE,
440
ctorDescriptor: new SyncDescriptor(Repl),
441
openCommandActionDescriptor: {
442
id: 'workbench.debug.action.toggleRepl',
443
mnemonicTitle: nls.localize({ key: 'miToggleDebugConsole', comment: ['&& denotes a mnemonic'] }, "De&&bug Console"),
444
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyY },
445
order: 2
446
}
447
}], VIEW_CONTAINER);
448
449
450
const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
451
id: VIEWLET_ID,
452
title: nls.localize2('run and debug', "Run and Debug"),
453
openCommandActionDescriptor: {
454
id: VIEWLET_ID,
455
mnemonicTitle: nls.localize({ key: 'miViewRun', comment: ['&& denotes a mnemonic'] }, "&&Run"),
456
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyD },
457
order: 3
458
},
459
ctorDescriptor: new SyncDescriptor(DebugViewPaneContainer),
460
icon: icons.runViewIcon,
461
alwaysUseContainerInfo: true,
462
order: 3,
463
}, ViewContainerLocation.Sidebar);
464
465
// Register default debug views
466
const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry);
467
viewsRegistry.registerViews([{ id: VARIABLES_VIEW_ID, name: nls.localize2('variables', "Variables"), containerIcon: icons.variablesViewIcon, ctorDescriptor: new SyncDescriptor(VariablesView), order: 10, weight: 40, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusVariablesView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
468
viewsRegistry.registerViews([{ id: WATCH_VIEW_ID, name: nls.localize2('watch', "Watch"), containerIcon: icons.watchViewIcon, ctorDescriptor: new SyncDescriptor(WatchExpressionsView), order: 20, weight: 10, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusWatchView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
469
viewsRegistry.registerViews([{ id: CALLSTACK_VIEW_ID, name: nls.localize2('callStack', "Call Stack"), containerIcon: icons.callStackViewIcon, ctorDescriptor: new SyncDescriptor(CallStackView), order: 30, weight: 30, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusCallStackView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
470
viewsRegistry.registerViews([{ id: BREAKPOINTS_VIEW_ID, name: nls.localize2('breakpoints', "Breakpoints"), containerIcon: icons.breakpointsViewIcon, ctorDescriptor: new SyncDescriptor(BreakpointsView), order: 40, weight: 20, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: ContextKeyExpr.or(CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DEBUG_UX.isEqualTo('default'), CONTEXT_HAS_DEBUGGED) }], viewContainer);
471
viewsRegistry.registerViews([{ id: WelcomeView.ID, name: WelcomeView.LABEL, containerIcon: icons.runViewIcon, ctorDescriptor: new SyncDescriptor(WelcomeView), order: 1, weight: 40, canToggleVisibility: true, when: CONTEXT_DEBUG_UX.isEqualTo('simple') }], viewContainer);
472
viewsRegistry.registerViews([{ id: LOADED_SCRIPTS_VIEW_ID, name: nls.localize2('loadedScripts', "Loaded Scripts"), containerIcon: icons.loadedScriptsViewIcon, ctorDescriptor: new SyncDescriptor(LoadedScriptsView), order: 35, weight: 5, canToggleVisibility: true, canMoveView: true, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
473
474
// Register disassembly view
475
476
Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane).registerEditorPane(
477
EditorPaneDescriptor.create(DisassemblyView, DISASSEMBLY_VIEW_ID, nls.localize('disassembly', "Disassembly")),
478
[new SyncDescriptor(DisassemblyViewInput)]
479
);
480
481
// Register configuration
482
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
483
configurationRegistry.registerConfiguration({
484
id: 'debug',
485
order: 20,
486
title: nls.localize('debugConfigurationTitle', "Debug"),
487
type: 'object',
488
properties: {
489
'debug.showVariableTypes': {
490
type: 'boolean',
491
description: nls.localize({ comment: ['This is the description for a setting'], key: 'showVariableTypes' }, "Show variable type in variable pane during debug session"),
492
default: false
493
},
494
'debug.allowBreakpointsEverywhere': {
495
type: 'boolean',
496
description: nls.localize({ comment: ['This is the description for a setting'], key: 'allowBreakpointsEverywhere' }, "Allow setting breakpoints in any file."),
497
default: false
498
},
499
'debug.gutterMiddleClickAction': {
500
type: 'string',
501
enum: ['logpoint', 'conditionalBreakpoint', 'triggeredBreakpoint', 'none'],
502
description: nls.localize({ comment: ['This is the description for a setting'], key: 'gutterMiddleClickAction' }, 'Controls the action to perform when clicking the editor gutter with the middle mouse button.'),
503
enumDescriptions: [
504
nls.localize('debug.gutterMiddleClickAction.logpoint', "Add Logpoint."),
505
nls.localize('debug.gutterMiddleClickAction.conditionalBreakpoint', "Add Conditional Breakpoint."),
506
nls.localize('debug.gutterMiddleClickAction.triggeredBreakpoint', "Add Triggered Breakpoint."),
507
nls.localize('debug.gutterMiddleClickAction.none', "Don't perform any action."),
508
],
509
default: 'logpoint',
510
},
511
'debug.openExplorerOnEnd': {
512
type: 'boolean',
513
description: nls.localize({ comment: ['This is the description for a setting'], key: 'openExplorerOnEnd' }, "Automatically open the explorer view at the end of a debug session."),
514
default: false
515
},
516
'debug.closeReadonlyTabsOnEnd': {
517
type: 'boolean',
518
description: nls.localize({ comment: ['This is the description for a setting'], key: 'closeReadonlyTabsOnEnd' }, "At the end of a debug session, all the read-only tabs associated with that session will be closed"),
519
default: false
520
},
521
'debug.inlineValues': {
522
type: 'string',
523
'enum': ['on', 'off', 'auto'],
524
description: nls.localize({ comment: ['This is the description for a setting'], key: 'inlineValues' }, "Show variable values inline in editor while debugging."),
525
'enumDescriptions': [
526
nls.localize('inlineValues.on', "Always show variable values inline in editor while debugging."),
527
nls.localize('inlineValues.off', "Never show variable values inline in editor while debugging."),
528
nls.localize('inlineValues.focusNoScroll', "Show variable values inline in editor while debugging when the language supports inline value locations."),
529
],
530
default: 'auto'
531
},
532
'debug.toolBarLocation': {
533
enum: ['floating', 'docked', 'commandCenter', 'hidden'],
534
markdownDescription: nls.localize({ comment: ['This is the description for a setting'], key: 'toolBarLocation' }, "Controls the location of the debug toolbar. Either `floating` in all views, `docked` in the debug view, `commandCenter` (requires {0}), or `hidden`.", '`#window.commandCenter#`'),
535
default: 'floating',
536
markdownEnumDescriptions: [
537
nls.localize('debugToolBar.floating', "Show debug toolbar in all views."),
538
nls.localize('debugToolBar.docked', "Show debug toolbar only in debug views."),
539
nls.localize('debugToolBar.commandCenter', "`(Experimental)` Show debug toolbar in the command center."),
540
nls.localize('debugToolBar.hidden', "Do not show debug toolbar."),
541
]
542
},
543
'debug.showInStatusBar': {
544
enum: ['never', 'always', 'onFirstSessionStart'],
545
enumDescriptions: [nls.localize('never', "Never show debug in Status bar"), nls.localize('always', "Always show debug in Status bar"), nls.localize('onFirstSessionStart', "Show debug in Status bar only after debug was started for the first time")],
546
description: nls.localize({ comment: ['This is the description for a setting'], key: 'showInStatusBar' }, "Controls when the debug Status bar should be visible."),
547
default: 'onFirstSessionStart'
548
},
549
'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA,
550
'debug.console.closeOnEnd': {
551
type: 'boolean',
552
description: nls.localize('debug.console.closeOnEnd', "Controls if the Debug Console should be automatically closed when the debug session ends."),
553
default: false
554
},
555
'debug.terminal.clearBeforeReusing': {
556
type: 'boolean',
557
description: nls.localize({ comment: ['This is the description for a setting'], key: 'debug.terminal.clearBeforeReusing' }, "Before starting a new debug session in an integrated or external terminal, clear the terminal."),
558
default: false
559
},
560
'debug.openDebug': {
561
enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'],
562
default: 'openOnDebugBreak',
563
description: nls.localize('openDebug', "Controls when the debug view should open.")
564
},
565
'debug.showSubSessionsInToolBar': {
566
type: 'boolean',
567
description: nls.localize({ comment: ['This is the description for a setting'], key: 'showSubSessionsInToolBar' }, "Controls whether the debug sub-sessions are shown in the debug tool bar. When this setting is false the stop command on a sub-session will also stop the parent session."),
568
default: false
569
},
570
'debug.console.fontSize': {
571
type: 'number',
572
description: nls.localize('debug.console.fontSize', "Controls the font size in pixels in the Debug Console."),
573
default: isMacintosh ? 12 : 14,
574
},
575
'debug.console.fontFamily': {
576
type: 'string',
577
description: nls.localize('debug.console.fontFamily', "Controls the font family in the Debug Console."),
578
default: 'default'
579
},
580
'debug.console.lineHeight': {
581
type: 'number',
582
description: nls.localize('debug.console.lineHeight', "Controls the line height in pixels in the Debug Console. Use 0 to compute the line height from the font size."),
583
default: 0
584
},
585
'debug.console.wordWrap': {
586
type: 'boolean',
587
description: nls.localize('debug.console.wordWrap', "Controls if the lines should wrap in the Debug Console."),
588
default: true
589
},
590
'debug.console.historySuggestions': {
591
type: 'boolean',
592
description: nls.localize('debug.console.historySuggestions', "Controls if the Debug Console should suggest previously typed input."),
593
default: true
594
},
595
'debug.console.collapseIdenticalLines': {
596
type: 'boolean',
597
description: nls.localize('debug.console.collapseIdenticalLines', "Controls if the Debug Console should collapse identical lines and show a number of occurrences with a badge."),
598
default: true
599
},
600
'debug.console.acceptSuggestionOnEnter': {
601
enum: ['off', 'on'],
602
description: nls.localize('debug.console.acceptSuggestionOnEnter', "Controls whether suggestions should be accepted on Enter in the Debug Console. Enter is also used to evaluate whatever is typed in the Debug Console."),
603
default: 'off'
604
},
605
'debug.console.maximumLines': {
606
type: 'number',
607
description: nls.localize('debug.console.maximumLines', "Controls the maximum number of lines in the Debug Console."),
608
default: 10000
609
},
610
'launch': {
611
type: 'object',
612
description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces."),
613
default: { configurations: [], compounds: [] },
614
$ref: launchSchemaId,
615
disallowConfigurationDefault: true
616
},
617
'debug.focusWindowOnBreak': {
618
type: 'boolean',
619
description: nls.localize('debug.focusWindowOnBreak', "Controls whether the workbench window should be focused when the debugger breaks."),
620
default: true
621
},
622
'debug.focusEditorOnBreak': {
623
type: 'boolean',
624
description: nls.localize('debug.focusEditorOnBreak', "Controls whether the editor should be focused when the debugger breaks."),
625
default: true
626
},
627
'debug.onTaskErrors': {
628
enum: ['debugAnyway', 'showErrors', 'prompt', 'abort'],
629
enumDescriptions: [nls.localize('debugAnyway', "Ignore task errors and start debugging."), nls.localize('showErrors', "Show the Problems view and do not start debugging."), nls.localize('prompt', "Prompt user."), nls.localize('cancel', "Cancel debugging.")],
630
description: nls.localize('debug.onTaskErrors', "Controls what to do when errors are encountered after running a preLaunchTask."),
631
default: 'prompt'
632
},
633
'debug.showBreakpointsInOverviewRuler': {
634
type: 'boolean',
635
description: nls.localize({ comment: ['This is the description for a setting'], key: 'showBreakpointsInOverviewRuler' }, "Controls whether breakpoints should be shown in the overview ruler."),
636
default: false
637
},
638
'debug.showInlineBreakpointCandidates': {
639
type: 'boolean',
640
description: nls.localize({ comment: ['This is the description for a setting'], key: 'showInlineBreakpointCandidates' }, "Controls whether inline breakpoints candidate decorations should be shown in the editor while debugging."),
641
default: true
642
},
643
'debug.saveBeforeStart': {
644
description: nls.localize('debug.saveBeforeStart', "Controls what editors to save before starting a debug session."),
645
enum: ['allEditorsInActiveGroup', 'nonUntitledEditorsInActiveGroup', 'none'],
646
enumDescriptions: [
647
nls.localize('debug.saveBeforeStart.allEditorsInActiveGroup', "Save all editors in the active group before starting a debug session."),
648
nls.localize('debug.saveBeforeStart.nonUntitledEditorsInActiveGroup', "Save all editors in the active group except untitled ones before starting a debug session."),
649
nls.localize('debug.saveBeforeStart.none', "Don't save any editors before starting a debug session."),
650
],
651
default: 'allEditorsInActiveGroup',
652
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE
653
},
654
'debug.confirmOnExit': {
655
description: nls.localize('debug.confirmOnExit', "Controls whether to confirm when the window closes if there are active debug sessions."),
656
type: 'string',
657
enum: ['never', 'always'],
658
enumDescriptions: [
659
nls.localize('debug.confirmOnExit.never', "Never confirm."),
660
nls.localize('debug.confirmOnExit.always', "Always confirm if there are debug sessions."),
661
],
662
default: 'never'
663
},
664
'debug.disassemblyView.showSourceCode': {
665
type: 'boolean',
666
default: true,
667
description: nls.localize('debug.disassemblyView.showSourceCode', "Show Source Code in Disassembly View.")
668
},
669
'debug.autoExpandLazyVariables': {
670
type: 'string',
671
enum: ['auto', 'on', 'off'],
672
default: 'auto',
673
enumDescriptions: [
674
nls.localize('debug.autoExpandLazyVariables.auto', "When in screen reader optimized mode, automatically expand lazy variables."),
675
nls.localize('debug.autoExpandLazyVariables.on', "Always automatically expand lazy variables."),
676
nls.localize('debug.autoExpandLazyVariables.off', "Never automatically expand lazy variables.")
677
],
678
description: nls.localize('debug.autoExpandLazyVariables', "Controls whether variables that are lazily resolved, such as getters, are automatically resolved and expanded by the debugger.")
679
},
680
'debug.enableStatusBarColor': {
681
type: 'boolean',
682
description: nls.localize('debug.enableStatusBarColor', "Color of the Status bar when debugger is active."),
683
default: true
684
},
685
'debug.hideLauncherWhileDebugging': {
686
type: 'boolean',
687
markdownDescription: nls.localize({ comment: ['This is the description for a setting'], key: 'debug.hideLauncherWhileDebugging' }, "Hide 'Start Debugging' control in title bar of 'Run and Debug' view while debugging is active. Only relevant when {0} is not `docked`.", '`#debug.toolBarLocation#`'),
688
default: false
689
},
690
'debug.hideSlowPreLaunchWarning': {
691
type: 'boolean',
692
markdownDescription: nls.localize('debug.hideSlowPreLaunchWarning', "Hide the warning shown when a `preLaunchTask` has been running for a while."),
693
default: false
694
}
695
}
696
});
697
698
AccessibleViewRegistry.register(new ReplAccessibleView());
699
AccessibleViewRegistry.register(new ReplAccessibilityHelp());
700
AccessibleViewRegistry.register(new RunAndDebugAccessibilityHelp());
701
registerWorkbenchContribution2(ReplAccessibilityAnnouncer.ID, ReplAccessibilityAnnouncer, WorkbenchPhase.AfterRestored);
702
registerWorkbenchContribution2(DebugWatchAccessibilityAnnouncer.ID, DebugWatchAccessibilityAnnouncer, WorkbenchPhase.AfterRestored);
703
704