Path: blob/main/src/vs/workbench/contrib/debug/browser/debug.contribution.ts
5237 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';6import { FileAccess } from '../../../../base/common/network.js';7import { isMacintosh, isWeb } from '../../../../base/common/platform.js';8import { URI } from '../../../../base/common/uri.js';9import { EditorContributionInstantiation, registerEditorContribution } from '../../../../editor/browser/editorExtensions.js';10import * as nls from '../../../../nls.js';11import { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js';12import { ICommandActionTitle, Icon } from '../../../../platform/action/common/action.js';13import { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js';14import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js';15import { ContextKeyExpr, ContextKeyExpression } from '../../../../platform/contextkey/common/contextkey.js';16import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js';17import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';18import { KeybindingWeight, KeybindingsRegistry } from '../../../../platform/keybinding/common/keybindingsRegistry.js';19import { IQuickAccessRegistry, Extensions as QuickAccessExtensions } from '../../../../platform/quickinput/common/quickAccess.js';20import { Registry } from '../../../../platform/registry/common/platform.js';21import { EditorPaneDescriptor, IEditorPaneRegistry } from '../../../browser/editor.js';22import { ViewPaneContainer } from '../../../browser/parts/views/viewPaneContainer.js';23import { FocusedViewContext } from '../../../common/contextkeys.js';24import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, WorkbenchPhase, registerWorkbenchContribution2 } from '../../../common/contributions.js';25import { EditorExtensions } from '../../../common/editor.js';26import { IViewContainersRegistry, IViewsRegistry, ViewContainer, ViewContainerLocation, Extensions as ViewExtensions } from '../../../common/views.js';27import { launchSchemaId } from '../../../services/configuration/common/configuration.js';28import { LifecyclePhase } from '../../../services/lifecycle/common/lifecycle.js';29import { COPY_NOTEBOOK_VARIABLE_VALUE_ID, COPY_NOTEBOOK_VARIABLE_VALUE_LABEL } from '../../notebook/browser/contrib/notebookVariables/notebookVariableCommands.js';30import { 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';31import { DebugWatchAccessibilityAnnouncer } from '../common/debugAccessibilityAnnouncer.js';32import { DebugContentProvider } from '../common/debugContentProvider.js';33import { DebugLifecycle } from '../common/debugLifecycle.js';34import { DebugVisualizerService, IDebugVisualizerService } from '../common/debugVisualizers.js';35import { DisassemblyViewInput } from '../common/disassemblyViewInput.js';36import { ReplAccessibilityAnnouncer } from '../common/replAccessibilityAnnouncer.js';37import { BreakpointEditorContribution } from './breakpointEditorContribution.js';38import { BreakpointsView } from './breakpointsView.js';39import { CallStackEditorContribution } from './callStackEditorContribution.js';40import { CallStackView } from './callStackView.js';41import { registerColors } from './debugColors.js';42import { 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';43import { DebugConsoleQuickAccess } from './debugConsoleQuickAccess.js';44import { RunToCursorAction, SelectionToReplAction, SelectionToWatchExpressionsAction } from './debugEditorActions.js';45import { DebugEditorContribution } from './debugEditorContribution.js';46import * as icons from './debugIcons.js';47import { DebugProgressContribution } from './debugProgress.js';48import { StartDebugQuickAccessProvider } from './debugQuickAccess.js';49import { DebugService } from './debugService.js';50import './debugSettingMigration.js';51import { DebugStatusContribution } from './debugStatus.js';52import { DebugTitleContribution } from './debugTitle.js';53import { DebugToolBar } from './debugToolBar.js';54import { DebugViewPaneContainer } from './debugViewlet.js';55import { DisassemblyView, DisassemblyViewContribution } from './disassemblyView.js';56import { LoadedScriptsView } from './loadedScriptsView.js';57import './media/debug.contribution.css';58import './media/debugHover.css';59import { Repl } from './repl.js';60import { ReplAccessibilityHelp } from './replAccessibilityHelp.js';61import { ReplAccessibleView } from './replAccessibleView.js';62import { RunAndDebugAccessibilityHelp } from './runAndDebugAccessibilityHelp.js';63import { StatusBarColorProvider } from './statusbarColorProvider.js';64import { SET_VARIABLE_ID, VIEW_MEMORY_ID, VariablesView } from './variablesView.js';65import { ADD_WATCH_ID, ADD_WATCH_LABEL, REMOVE_WATCH_EXPRESSIONS_COMMAND_ID, REMOVE_WATCH_EXPRESSIONS_LABEL, WatchExpressionsView } from './watchExpressionsView.js';66import { WelcomeView } from './welcomeView.js';67import { DebugChatContextContribution } from './debugChatIntegration.js';6869const debugCategory = nls.localize('debugCategory', "Debug");70registerColors();71registerSingleton(IDebugService, DebugService, InstantiationType.Delayed);72registerSingleton(IDebugVisualizerService, DebugVisualizerService, InstantiationType.Delayed);7374// Register Debug Workbench Contributions75Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugStatusContribution, LifecyclePhase.Eventually);76Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugProgressContribution, LifecyclePhase.Eventually);77if (isWeb) {78Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugTitleContribution, LifecyclePhase.Eventually);79}80Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugToolBar, LifecyclePhase.Restored);81Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugContentProvider, LifecyclePhase.Eventually);82Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(StatusBarColorProvider, LifecyclePhase.Eventually);83Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DisassemblyViewContribution, LifecyclePhase.Eventually);84Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugLifecycle, LifecyclePhase.Eventually);85registerWorkbenchContribution2(DebugChatContextContribution.ID, DebugChatContextContribution, WorkbenchPhase.AfterRestored);8687// Register Quick Access88Registry.as<IQuickAccessRegistry>(QuickAccessExtensions.Quickaccess).registerQuickAccessProvider({89ctor: StartDebugQuickAccessProvider,90prefix: DEBUG_QUICK_ACCESS_PREFIX,91contextKey: 'inLaunchConfigurationsPicker',92placeholder: nls.localize('startDebugPlaceholder', "Type the name of a launch configuration to run."),93helpEntries: [{94description: nls.localize('startDebuggingHelp', "Start Debugging"),95commandId: SELECT_AND_START_ID,96commandCenterOrder: 5097}]98});99100// Register quick access for debug console101Registry.as<IQuickAccessRegistry>(QuickAccessExtensions.Quickaccess).registerQuickAccessProvider({102ctor: DebugConsoleQuickAccess,103prefix: DEBUG_CONSOLE_QUICK_ACCESS_PREFIX,104contextKey: 'inDebugConsolePicker',105placeholder: nls.localize('tasksQuickAccessPlaceholder', "Type the name of a debug console to open."),106helpEntries: [{ description: nls.localize('tasksQuickAccessHelp', "Show All Debug Consoles"), commandId: SELECT_DEBUG_CONSOLE_ID }]107});108109registerEditorContribution('editor.contrib.callStack', CallStackEditorContribution, EditorContributionInstantiation.AfterFirstRender);110registerEditorContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID, BreakpointEditorContribution, EditorContributionInstantiation.AfterFirstRender);111registerEditorContribution(EDITOR_CONTRIBUTION_ID, DebugEditorContribution, EditorContributionInstantiation.BeforeFirstInteraction);112113const registerDebugCommandPaletteItem = (id: string, title: ICommandActionTitle, when?: ContextKeyExpression, precondition?: ContextKeyExpression) => {114MenuRegistry.appendMenuItem(MenuId.CommandPalette, {115when: ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, when),116group: debugCategory,117command: {118id,119title,120category: DEBUG_COMMAND_CATEGORY,121precondition122}123});124};125126registerDebugCommandPaletteItem(RESTART_SESSION_ID, RESTART_LABEL);127registerDebugCommandPaletteItem(TERMINATE_THREAD_ID, nls.localize2('terminateThread', "Terminate Thread"), CONTEXT_IN_DEBUG_MODE, CONTEXT_TERMINATE_THREADS_SUPPORTED);128registerDebugCommandPaletteItem(STEP_OVER_ID, STEP_OVER_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));129registerDebugCommandPaletteItem(STEP_INTO_ID, STEP_INTO_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));130registerDebugCommandPaletteItem(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')));131registerDebugCommandPaletteItem(STEP_OUT_ID, STEP_OUT_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));132registerDebugCommandPaletteItem(PAUSE_ID, PAUSE_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.and(CONTEXT_DEBUG_STATE.isEqualTo('running'), CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG.toNegated()));133registerDebugCommandPaletteItem(DISCONNECT_ID, DISCONNECT_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.or(CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED));134registerDebugCommandPaletteItem(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)));135registerDebugCommandPaletteItem(STOP_ID, STOP_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.or(CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated(), CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED));136registerDebugCommandPaletteItem(CONTINUE_ID, CONTINUE_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));137registerDebugCommandPaletteItem(JUMP_TO_CURSOR_ID, nls.localize2('jumpToCursor', "Jump to Cursor"), CONTEXT_JUMP_TO_CURSOR_SUPPORTED);138registerDebugCommandPaletteItem(JUMP_TO_CURSOR_ID, nls.localize2('SetNextStatement', "Set Next Statement"), CONTEXT_JUMP_TO_CURSOR_SUPPORTED);139registerDebugCommandPaletteItem(RunToCursorAction.ID, RunToCursorAction.LABEL, CONTEXT_DEBUGGERS_AVAILABLE);140registerDebugCommandPaletteItem(SelectionToReplAction.ID, SelectionToReplAction.LABEL, CONTEXT_IN_DEBUG_MODE);141registerDebugCommandPaletteItem(SelectionToWatchExpressionsAction.ID, SelectionToWatchExpressionsAction.LABEL);142registerDebugCommandPaletteItem(TOGGLE_INLINE_BREAKPOINT_ID, nls.localize2('inlineBreakpoint', "Inline Breakpoint"));143registerDebugCommandPaletteItem(DEBUG_START_COMMAND_ID, DEBUG_START_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));144registerDebugCommandPaletteItem(DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));145registerDebugCommandPaletteItem(SELECT_AND_START_ID, SELECT_AND_START_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));146registerDebugCommandPaletteItem(NEXT_DEBUG_CONSOLE_ID, NEXT_DEBUG_CONSOLE_LABEL);147registerDebugCommandPaletteItem(PREV_DEBUG_CONSOLE_ID, PREV_DEBUG_CONSOLE_LABEL);148registerDebugCommandPaletteItem(SHOW_LOADED_SCRIPTS_ID, OPEN_LOADED_SCRIPTS_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_LOADED_SCRIPTS_SUPPORTED);149registerDebugCommandPaletteItem(SELECT_DEBUG_CONSOLE_ID, SELECT_DEBUG_CONSOLE_LABEL);150registerDebugCommandPaletteItem(SELECT_DEBUG_SESSION_ID, SELECT_DEBUG_SESSION_LABEL);151registerDebugCommandPaletteItem(CALLSTACK_TOP_ID, CALLSTACK_TOP_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));152registerDebugCommandPaletteItem(CALLSTACK_BOTTOM_ID, CALLSTACK_BOTTOM_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));153registerDebugCommandPaletteItem(CALLSTACK_UP_ID, CALLSTACK_UP_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));154registerDebugCommandPaletteItem(CALLSTACK_DOWN_ID, CALLSTACK_DOWN_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));155156// Debug callstack context menu157const registerDebugViewMenuItem = (menuId: MenuId, id: string, title: string | ICommandActionTitle, order: number, when?: ContextKeyExpression, precondition?: ContextKeyExpression, group = 'navigation', icon?: Icon) => {158MenuRegistry.appendMenuItem(menuId, {159group,160when,161order,162icon,163command: {164id,165title,166icon,167precondition168}169});170};171registerDebugViewMenuItem(MenuId.DebugCallStackContext, RESTART_SESSION_ID, RESTART_LABEL, 10, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), undefined, '3_modification');172registerDebugViewMenuItem(MenuId.DebugCallStackContext, DISCONNECT_ID, DISCONNECT_LABEL, 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), undefined, '3_modification');173registerDebugViewMenuItem(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');174registerDebugViewMenuItem(MenuId.DebugCallStackContext, STOP_ID, STOP_LABEL, 30, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), undefined, '3_modification');175registerDebugViewMenuItem(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())));176registerDebugViewMenuItem(MenuId.DebugCallStackContext, CONTINUE_ID, CONTINUE_LABEL, 10, ContextKeyExpr.and(CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped')));177registerDebugViewMenuItem(MenuId.DebugCallStackContext, STEP_OVER_ID, STEP_OVER_LABEL, 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped'));178registerDebugViewMenuItem(MenuId.DebugCallStackContext, STEP_INTO_ID, STEP_INTO_LABEL, 30, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped'));179registerDebugViewMenuItem(MenuId.DebugCallStackContext, STEP_OUT_ID, STEP_OUT_LABEL, 40, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped'));180registerDebugViewMenuItem(MenuId.DebugCallStackContext, TERMINATE_THREAD_ID, nls.localize('terminateThread', "Terminate Thread"), 10, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_TERMINATE_THREADS_SUPPORTED, 'termination');181registerDebugViewMenuItem(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);182registerDebugViewMenuItem(MenuId.DebugCallStackContext, COPY_STACK_TRACE_ID, nls.localize('copyStackTrace', "Copy Call Stack"), 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('stackFrame'), undefined, '3_modification');183184registerDebugViewMenuItem(MenuId.DebugVariablesContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 15, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_IN_DEBUG_MODE, 'inline', icons.debugInspectMemory);185registerDebugViewMenuItem(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');186registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_VALUE_ID, COPY_VALUE_LABEL, 10, undefined, undefined, '5_cutcopypaste');187registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');188registerDebugViewMenuItem(MenuId.DebugVariablesContext, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');189registerDebugViewMenuItem(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');190registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');191registerDebugViewMenuItem(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');192193registerDebugViewMenuItem(MenuId.DebugHoverContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 15, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_IN_DEBUG_MODE, 'inline', icons.debugInspectMemory);194registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_VALUE_ID, COPY_VALUE_LABEL, 10, undefined, undefined, '5_cutcopypaste');195registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');196registerDebugViewMenuItem(MenuId.DebugHoverContext, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');197registerDebugViewMenuItem(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');198registerDebugViewMenuItem(MenuId.DebugHoverContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');199registerDebugViewMenuItem(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');200201registerDebugViewMenuItem(MenuId.DebugWatchContext, ADD_WATCH_ID, ADD_WATCH_LABEL, 10, undefined, undefined, '3_modification');202registerDebugViewMenuItem(MenuId.DebugWatchContext, EDIT_EXPRESSION_COMMAND_ID, nls.localize('editWatchExpression', "Edit Expression"), 20, CONTEXT_WATCH_ITEM_TYPE.isEqualTo('expression'), undefined, '3_modification');203registerDebugViewMenuItem(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');204registerDebugViewMenuItem(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');205registerDebugViewMenuItem(MenuId.DebugWatchContext, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, 50, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, CONTEXT_IN_DEBUG_MODE, '3_modification');206registerDebugViewMenuItem(MenuId.DebugWatchContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 10, CONTEXT_CAN_VIEW_MEMORY, undefined, 'inline', icons.debugInspectMemory);207registerDebugViewMenuItem(MenuId.DebugWatchContext, REMOVE_EXPRESSION_COMMAND_ID, nls.localize('removeWatchExpression', "Remove Expression"), 20, CONTEXT_WATCH_ITEM_TYPE.isEqualTo('expression'), undefined, 'inline', icons.watchExpressionRemove);208registerDebugViewMenuItem(MenuId.DebugWatchContext, REMOVE_WATCH_EXPRESSIONS_COMMAND_ID, REMOVE_WATCH_EXPRESSIONS_LABEL, 20, undefined, undefined, 'z_commands');209registerDebugViewMenuItem(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');210registerDebugViewMenuItem(MenuId.DebugWatchContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');211registerDebugViewMenuItem(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');212213registerDebugViewMenuItem(MenuId.NotebookVariablesContext, COPY_NOTEBOOK_VARIABLE_VALUE_ID, COPY_NOTEBOOK_VARIABLE_VALUE_LABEL, 20, CONTEXT_VARIABLE_VALUE);214215KeybindingsRegistry.registerKeybindingRule({216id: COPY_VALUE_ID,217weight: KeybindingWeight.WorkbenchContrib,218when: ContextKeyExpr.and(219CONTEXT_EXPRESSION_SELECTED.negate(),220ContextKeyExpr.or(221FocusedViewContext.isEqualTo(WATCH_VIEW_ID),222FocusedViewContext.isEqualTo(VARIABLES_VIEW_ID),223),224),225primary: KeyMod.CtrlCmd | KeyCode.KeyC226});227228// Touch Bar229if (isMacintosh) {230231const registerTouchBarEntry = (id: string, title: string | ICommandActionTitle, order: number, when: ContextKeyExpression | undefined, iconUri: URI) => {232MenuRegistry.appendMenuItem(MenuId.TouchBarContext, {233command: {234id,235title,236icon: { dark: iconUri }237},238when: ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, when),239group: '9_debug',240order241});242};243244registerTouchBarEntry(DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, 0, CONTEXT_IN_DEBUG_MODE.toNegated(), FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/continue-tb.png'));245registerTouchBarEntry(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'));246registerTouchBarEntry(CONTINUE_ID, CONTINUE_LABEL, 0, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/continue-tb.png'));247registerTouchBarEntry(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'));248registerTouchBarEntry(STEP_OVER_ID, STEP_OVER_LABEL, 2, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stepover-tb.png'));249registerTouchBarEntry(STEP_INTO_ID, STEP_INTO_LABEL, 3, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stepinto-tb.png'));250registerTouchBarEntry(STEP_OUT_ID, STEP_OUT_LABEL, 4, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stepout-tb.png'));251registerTouchBarEntry(RESTART_SESSION_ID, RESTART_LABEL, 5, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/restart-tb.png'));252registerTouchBarEntry(STOP_ID, STOP_LABEL, 6, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stop-tb.png'));253}254255// Editor Title Menu's "Run/Debug" dropdown item256257MenuRegistry.appendMenuItem(MenuId.EditorTitle, { submenu: MenuId.EditorTitleRun, isSplitButton: { togglePrimaryAction: true }, title: nls.localize2('run', "Run or Debug..."), icon: icons.debugRun, group: 'navigation', order: -1 });258259// Debug menu260261MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {262submenu: MenuId.MenubarDebugMenu,263title: {264...nls.localize2('runMenu', "Run"),265mnemonicTitle: nls.localize({ key: 'mRun', comment: ['&& denotes a mnemonic'] }, "&&Run")266},267order: 6268});269270MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {271group: '1_debug',272command: {273id: DEBUG_START_COMMAND_ID,274title: nls.localize({ key: 'miStartDebugging', comment: ['&& denotes a mnemonic'] }, "&&Start Debugging")275},276order: 1,277when: CONTEXT_DEBUGGERS_AVAILABLE278});279280MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {281group: '1_debug',282command: {283id: DEBUG_RUN_COMMAND_ID,284title: nls.localize({ key: 'miRun', comment: ['&& denotes a mnemonic'] }, "Run &&Without Debugging")285},286order: 2,287when: CONTEXT_DEBUGGERS_AVAILABLE288});289290MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {291group: '1_debug',292command: {293id: STOP_ID,294title: nls.localize({ key: 'miStopDebugging', comment: ['&& denotes a mnemonic'] }, "&&Stop Debugging"),295precondition: CONTEXT_IN_DEBUG_MODE296},297order: 3,298when: CONTEXT_DEBUGGERS_AVAILABLE299});300301MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {302group: '1_debug',303command: {304id: RESTART_SESSION_ID,305title: nls.localize({ key: 'miRestart Debugging', comment: ['&& denotes a mnemonic'] }, "&&Restart Debugging"),306precondition: CONTEXT_IN_DEBUG_MODE307},308order: 4,309when: CONTEXT_DEBUGGERS_AVAILABLE310});311312// Configuration313314MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {315group: '2_configuration',316command: {317id: ADD_CONFIGURATION_ID,318title: nls.localize({ key: 'miAddConfiguration', comment: ['&& denotes a mnemonic'] }, "A&&dd Configuration...")319},320order: 2,321when: CONTEXT_DEBUGGERS_AVAILABLE322});323324// Step Commands325MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {326group: '3_step',327command: {328id: STEP_OVER_ID,329title: nls.localize({ key: 'miStepOver', comment: ['&& denotes a mnemonic'] }, "Step &&Over"),330precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')331},332order: 1,333when: CONTEXT_DEBUGGERS_AVAILABLE334});335336MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {337group: '3_step',338command: {339id: STEP_INTO_ID,340title: nls.localize({ key: 'miStepInto', comment: ['&& denotes a mnemonic'] }, "Step &&Into"),341precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')342},343order: 2,344when: CONTEXT_DEBUGGERS_AVAILABLE345});346347MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {348group: '3_step',349command: {350id: STEP_OUT_ID,351title: nls.localize({ key: 'miStepOut', comment: ['&& denotes a mnemonic'] }, "Step O&&ut"),352precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')353},354order: 3,355when: CONTEXT_DEBUGGERS_AVAILABLE356});357358MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {359group: '3_step',360command: {361id: CONTINUE_ID,362title: nls.localize({ key: 'miContinue', comment: ['&& denotes a mnemonic'] }, "&&Continue"),363precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')364},365order: 4,366when: CONTEXT_DEBUGGERS_AVAILABLE367});368369// New Breakpoints370371MenuRegistry.appendMenuItem(MenuId.MenubarNewBreakpointMenu, {372group: '1_breakpoints',373command: {374id: TOGGLE_INLINE_BREAKPOINT_ID,375title: nls.localize({ key: 'miInlineBreakpoint', comment: ['&& denotes a mnemonic'] }, "Inline Breakp&&oint")376},377order: 2,378when: CONTEXT_DEBUGGERS_AVAILABLE379});380381MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {382group: '4_new_breakpoint',383title: nls.localize({ key: 'miNewBreakpoint', comment: ['&& denotes a mnemonic'] }, "&&New Breakpoint"),384submenu: MenuId.MenubarNewBreakpointMenu,385order: 2,386when: CONTEXT_DEBUGGERS_AVAILABLE387});388389// Disassembly390391MenuRegistry.appendMenuItem(MenuId.DebugDisassemblyContext, {392group: '1_edit',393command: {394id: COPY_ADDRESS_ID,395title: COPY_ADDRESS_LABEL,396},397order: 2,398when: CONTEXT_DEBUGGERS_AVAILABLE399});400401MenuRegistry.appendMenuItem(MenuId.DebugDisassemblyContext, {402group: '3_breakpoints',403command: {404id: TOGGLE_BREAKPOINT_ID,405title: nls.localize({ key: 'miToggleBreakpoint', comment: ['&& denotes a mnemonic'] }, "Toggle Breakpoint"),406},407order: 2,408when: CONTEXT_DEBUGGERS_AVAILABLE409});410411// Breakpoint actions are registered from breakpointsView.ts412413// Install Debuggers414MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {415group: 'z_install',416command: {417id: 'debug.installAdditionalDebuggers',418title: nls.localize({ key: 'miInstallAdditionalDebuggers', comment: ['&& denotes a mnemonic'] }, "&&Install Additional Debuggers...")419},420order: 1421});422423// register repl panel424425const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({426id: DEBUG_PANEL_ID,427title: nls.localize2({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"),428icon: icons.debugConsoleViewIcon,429ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [DEBUG_PANEL_ID, { mergeViewWithContainerWhenSingleView: true }]),430storageId: DEBUG_PANEL_ID,431hideIfEmpty: true,432order: 2,433}, ViewContainerLocation.Panel, { doNotRegisterOpenCommand: true });434435Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{436id: REPL_VIEW_ID,437name: nls.localize2({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"),438containerIcon: icons.debugConsoleViewIcon,439canToggleVisibility: true,440canMoveView: true,441when: CONTEXT_DEBUGGERS_AVAILABLE,442ctorDescriptor: new SyncDescriptor(Repl),443openCommandActionDescriptor: {444id: 'workbench.debug.action.toggleRepl',445mnemonicTitle: nls.localize({ key: 'miToggleDebugConsole', comment: ['&& denotes a mnemonic'] }, "De&&bug Console"),446keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyY },447order: 2448}449}], VIEW_CONTAINER);450451452const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({453id: VIEWLET_ID,454title: nls.localize2('run and debug', "Run and Debug"),455openCommandActionDescriptor: {456id: VIEWLET_ID,457mnemonicTitle: nls.localize({ key: 'miViewRun', comment: ['&& denotes a mnemonic'] }, "&&Run"),458keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyD },459order: 3460},461ctorDescriptor: new SyncDescriptor(DebugViewPaneContainer),462icon: icons.runViewIcon,463alwaysUseContainerInfo: true,464order: 3,465}, ViewContainerLocation.Sidebar);466467// Register default debug views468const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry);469viewsRegistry.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);470viewsRegistry.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);471viewsRegistry.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);472viewsRegistry.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);473viewsRegistry.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);474viewsRegistry.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);475476// Register disassembly view477478Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane).registerEditorPane(479EditorPaneDescriptor.create(DisassemblyView, DISASSEMBLY_VIEW_ID, nls.localize('disassembly', "Disassembly")),480[new SyncDescriptor(DisassemblyViewInput)]481);482483// Register configuration484const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);485configurationRegistry.registerConfiguration({486id: 'debug',487order: 20,488title: nls.localize('debugConfigurationTitle', "Debug"),489type: 'object',490properties: {491'debug.showVariableTypes': {492type: 'boolean',493description: nls.localize({ comment: ['This is the description for a setting'], key: 'showVariableTypes' }, "Show variable type in variable pane during debug session"),494default: false495},496'debug.allowBreakpointsEverywhere': {497type: 'boolean',498description: nls.localize({ comment: ['This is the description for a setting'], key: 'allowBreakpointsEverywhere' }, "Allow setting breakpoints in any file."),499default: false500},501'debug.gutterMiddleClickAction': {502type: 'string',503enum: ['logpoint', 'conditionalBreakpoint', 'triggeredBreakpoint', 'none'],504description: 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.'),505enumDescriptions: [506nls.localize('debug.gutterMiddleClickAction.logpoint', "Add Logpoint."),507nls.localize('debug.gutterMiddleClickAction.conditionalBreakpoint', "Add Conditional Breakpoint."),508nls.localize('debug.gutterMiddleClickAction.triggeredBreakpoint', "Add Triggered Breakpoint."),509nls.localize('debug.gutterMiddleClickAction.none', "Don't perform any action."),510],511default: 'logpoint',512},513'debug.openExplorerOnEnd': {514type: 'boolean',515description: nls.localize({ comment: ['This is the description for a setting'], key: 'openExplorerOnEnd' }, "Automatically open the explorer view at the end of a debug session."),516default: false517},518'debug.closeReadonlyTabsOnEnd': {519type: 'boolean',520description: 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"),521default: false522},523'debug.inlineValues': {524type: 'string',525'enum': ['on', 'off', 'auto'],526description: nls.localize({ comment: ['This is the description for a setting'], key: 'inlineValues' }, "Show variable values inline in editor while debugging."),527'enumDescriptions': [528nls.localize('inlineValues.on', "Always show variable values inline in editor while debugging."),529nls.localize('inlineValues.off', "Never show variable values inline in editor while debugging."),530nls.localize('inlineValues.focusNoScroll', "Show variable values inline in editor while debugging when the language supports inline value locations."),531],532default: 'auto'533},534'debug.toolBarLocation': {535enum: ['floating', 'docked', 'commandCenter', 'hidden'],536markdownDescription: 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#`'),537default: 'floating',538markdownEnumDescriptions: [539nls.localize('debugToolBar.floating', "Show debug toolbar in all views."),540nls.localize('debugToolBar.docked', "Show debug toolbar only in debug views."),541nls.localize('debugToolBar.commandCenter', "`(Experimental)` Show debug toolbar in the command center."),542nls.localize('debugToolBar.hidden', "Do not show debug toolbar."),543]544},545'debug.showInStatusBar': {546enum: ['never', 'always', 'onFirstSessionStart'],547enumDescriptions: [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")],548description: nls.localize({ comment: ['This is the description for a setting'], key: 'showInStatusBar' }, "Controls when the debug status bar item should be visible."),549default: 'onFirstSessionStart'550},551'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA,552'debug.console.closeOnEnd': {553type: 'boolean',554description: nls.localize('debug.console.closeOnEnd', "Controls if the Debug Console should be automatically closed when the debug session ends."),555default: false556},557'debug.terminal.clearBeforeReusing': {558type: 'boolean',559description: 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."),560default: false561},562'debug.openDebug': {563enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'],564default: 'openOnDebugBreak',565description: nls.localize('openDebug', "Controls when the debug view should open.")566},567'debug.showSubSessionsInToolBar': {568type: 'boolean',569description: 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."),570default: false571},572'debug.console.fontSize': {573type: 'number',574description: nls.localize('debug.console.fontSize', "Controls the font size in pixels in the Debug Console."),575default: isMacintosh ? 12 : 14,576},577'debug.console.fontFamily': {578type: 'string',579description: nls.localize('debug.console.fontFamily', "Controls the font family in the Debug Console."),580default: 'default'581},582'debug.console.lineHeight': {583type: 'number',584description: 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."),585default: 0586},587'debug.console.wordWrap': {588type: 'boolean',589description: nls.localize('debug.console.wordWrap', "Controls if the lines should wrap in the Debug Console."),590default: true591},592'debug.console.historySuggestions': {593type: 'boolean',594description: nls.localize('debug.console.historySuggestions', "Controls if the Debug Console should suggest previously typed input."),595default: true596},597'debug.console.collapseIdenticalLines': {598type: 'boolean',599description: nls.localize('debug.console.collapseIdenticalLines', "Controls if the Debug Console should collapse identical lines and show a number of occurrences with a badge."),600default: true601},602'debug.console.acceptSuggestionOnEnter': {603enum: ['off', 'on'],604description: 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."),605default: 'off'606},607'debug.console.maximumLines': {608type: 'number',609description: nls.localize('debug.console.maximumLines', "Controls the maximum number of lines in the Debug Console."),610default: 10000611},612'launch': {613type: 'object',614description: 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."),615default: { configurations: [], compounds: [] },616$ref: launchSchemaId,617disallowConfigurationDefault: true618},619'debug.focusWindowOnBreak': {620type: 'boolean',621description: nls.localize('debug.focusWindowOnBreak', "Controls whether the workbench window should be focused when the debugger breaks."),622default: true623},624'debug.focusEditorOnBreak': {625type: 'boolean',626description: nls.localize('debug.focusEditorOnBreak', "Controls whether the editor should be focused when the debugger breaks."),627default: true628},629'debug.onTaskErrors': {630enum: ['debugAnyway', 'showErrors', 'prompt', 'abort'],631enumDescriptions: [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.")],632description: nls.localize('debug.onTaskErrors', "Controls what to do when errors are encountered after running a preLaunchTask."),633default: 'prompt'634},635'debug.showBreakpointsInOverviewRuler': {636type: 'boolean',637description: nls.localize({ comment: ['This is the description for a setting'], key: 'showBreakpointsInOverviewRuler' }, "Controls whether breakpoints should be shown in the overview ruler."),638default: false639},640'debug.breakpointsView.presentation': {641type: 'string',642description: nls.localize('debug.breakpointsView.presentation', "Controls whether breakpoints are displayed in a tree view grouped by file, or as a flat list."),643enum: ['tree', 'list'],644default: 'list'645},646'debug.showInlineBreakpointCandidates': {647type: 'boolean',648description: 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."),649default: true650},651'debug.saveBeforeStart': {652description: nls.localize('debug.saveBeforeStart', "Controls what editors to save before starting a debug session."),653enum: ['allEditorsInActiveGroup', 'nonUntitledEditorsInActiveGroup', 'none'],654enumDescriptions: [655nls.localize('debug.saveBeforeStart.allEditorsInActiveGroup', "Save all editors in the active group before starting a debug session."),656nls.localize('debug.saveBeforeStart.nonUntitledEditorsInActiveGroup', "Save all editors in the active group except untitled ones before starting a debug session."),657nls.localize('debug.saveBeforeStart.none', "Don't save any editors before starting a debug session."),658],659default: 'allEditorsInActiveGroup',660scope: ConfigurationScope.LANGUAGE_OVERRIDABLE661},662'debug.confirmOnExit': {663description: nls.localize('debug.confirmOnExit', "Controls whether to confirm when the window closes if there are active debug sessions."),664type: 'string',665enum: ['never', 'always'],666enumDescriptions: [667nls.localize('debug.confirmOnExit.never', "Never confirm."),668nls.localize('debug.confirmOnExit.always', "Always confirm if there are debug sessions."),669],670default: 'never'671},672'debug.disassemblyView.showSourceCode': {673type: 'boolean',674default: true,675description: nls.localize('debug.disassemblyView.showSourceCode', "Show Source Code in Disassembly View.")676},677'debug.autoExpandLazyVariables': {678type: 'string',679enum: ['auto', 'on', 'off'],680default: 'auto',681enumDescriptions: [682nls.localize('debug.autoExpandLazyVariables.auto', "When in screen reader optimized mode, automatically expand lazy variables."),683nls.localize('debug.autoExpandLazyVariables.on', "Always automatically expand lazy variables."),684nls.localize('debug.autoExpandLazyVariables.off', "Never automatically expand lazy variables.")685],686description: nls.localize('debug.autoExpandLazyVariables', "Controls whether variables that are lazily resolved, such as getters, are automatically resolved and expanded by the debugger.")687},688'debug.enableStatusBarColor': {689type: 'boolean',690description: nls.localize('debug.enableStatusBarColor', "Color of the status bar when the debugger is active."),691default: true692},693'debug.hideLauncherWhileDebugging': {694type: 'boolean',695markdownDescription: 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#`'),696default: false697},698'debug.hideSlowPreLaunchWarning': {699type: 'boolean',700markdownDescription: nls.localize('debug.hideSlowPreLaunchWarning', "Hide the warning shown when a `preLaunchTask` has been running for a while."),701default: false702}703}704});705706AccessibleViewRegistry.register(new ReplAccessibleView());707AccessibleViewRegistry.register(new ReplAccessibilityHelp());708AccessibleViewRegistry.register(new RunAndDebugAccessibilityHelp());709registerWorkbenchContribution2(ReplAccessibilityAnnouncer.ID, ReplAccessibilityAnnouncer, WorkbenchPhase.AfterRestored);710registerWorkbenchContribution2(DebugWatchAccessibilityAnnouncer.ID, DebugWatchAccessibilityAnnouncer, WorkbenchPhase.AfterRestored);711712713