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