Path: blob/main/src/vs/workbench/contrib/debug/browser/debug.contribution.ts
3296 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';6768const debugCategory = nls.localize('debugCategory', "Debug");69registerColors();70registerSingleton(IDebugService, DebugService, InstantiationType.Delayed);71registerSingleton(IDebugVisualizerService, DebugVisualizerService, InstantiationType.Delayed);7273// Register Debug Workbench Contributions74Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugStatusContribution, LifecyclePhase.Eventually);75Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugProgressContribution, LifecyclePhase.Eventually);76if (isWeb) {77Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugTitleContribution, LifecyclePhase.Eventually);78}79Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugToolBar, LifecyclePhase.Restored);80Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugContentProvider, LifecyclePhase.Eventually);81Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(StatusBarColorProvider, LifecyclePhase.Eventually);82Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DisassemblyViewContribution, LifecyclePhase.Eventually);83Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugLifecycle, LifecyclePhase.Eventually);8485// Register Quick Access86Registry.as<IQuickAccessRegistry>(QuickAccessExtensions.Quickaccess).registerQuickAccessProvider({87ctor: StartDebugQuickAccessProvider,88prefix: DEBUG_QUICK_ACCESS_PREFIX,89contextKey: 'inLaunchConfigurationsPicker',90placeholder: nls.localize('startDebugPlaceholder', "Type the name of a launch configuration to run."),91helpEntries: [{92description: nls.localize('startDebuggingHelp', "Start Debugging"),93commandId: SELECT_AND_START_ID,94commandCenterOrder: 5095}]96});9798// Register quick access for debug console99Registry.as<IQuickAccessRegistry>(QuickAccessExtensions.Quickaccess).registerQuickAccessProvider({100ctor: DebugConsoleQuickAccess,101prefix: DEBUG_CONSOLE_QUICK_ACCESS_PREFIX,102contextKey: 'inDebugConsolePicker',103placeholder: nls.localize('tasksQuickAccessPlaceholder', "Type the name of a debug console to open."),104helpEntries: [{ description: nls.localize('tasksQuickAccessHelp', "Show All Debug Consoles"), commandId: SELECT_DEBUG_CONSOLE_ID }]105});106107registerEditorContribution('editor.contrib.callStack', CallStackEditorContribution, EditorContributionInstantiation.AfterFirstRender);108registerEditorContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID, BreakpointEditorContribution, EditorContributionInstantiation.AfterFirstRender);109registerEditorContribution(EDITOR_CONTRIBUTION_ID, DebugEditorContribution, EditorContributionInstantiation.BeforeFirstInteraction);110111const registerDebugCommandPaletteItem = (id: string, title: ICommandActionTitle, when?: ContextKeyExpression, precondition?: ContextKeyExpression) => {112MenuRegistry.appendMenuItem(MenuId.CommandPalette, {113when: ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, when),114group: debugCategory,115command: {116id,117title,118category: DEBUG_COMMAND_CATEGORY,119precondition120}121});122};123124registerDebugCommandPaletteItem(RESTART_SESSION_ID, RESTART_LABEL);125registerDebugCommandPaletteItem(TERMINATE_THREAD_ID, nls.localize2('terminateThread', "Terminate Thread"), CONTEXT_IN_DEBUG_MODE, CONTEXT_TERMINATE_THREADS_SUPPORTED);126registerDebugCommandPaletteItem(STEP_OVER_ID, STEP_OVER_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));127registerDebugCommandPaletteItem(STEP_INTO_ID, STEP_INTO_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));128registerDebugCommandPaletteItem(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')));129registerDebugCommandPaletteItem(STEP_OUT_ID, STEP_OUT_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));130registerDebugCommandPaletteItem(PAUSE_ID, PAUSE_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.and(CONTEXT_DEBUG_STATE.isEqualTo('running'), CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG.toNegated()));131registerDebugCommandPaletteItem(DISCONNECT_ID, DISCONNECT_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.or(CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED));132registerDebugCommandPaletteItem(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)));133registerDebugCommandPaletteItem(STOP_ID, STOP_LABEL, CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.or(CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated(), CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED));134registerDebugCommandPaletteItem(CONTINUE_ID, CONTINUE_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));135registerDebugCommandPaletteItem(JUMP_TO_CURSOR_ID, nls.localize2('jumpToCursor', "Jump to Cursor"), CONTEXT_JUMP_TO_CURSOR_SUPPORTED);136registerDebugCommandPaletteItem(JUMP_TO_CURSOR_ID, nls.localize2('SetNextStatement', "Set Next Statement"), CONTEXT_JUMP_TO_CURSOR_SUPPORTED);137registerDebugCommandPaletteItem(RunToCursorAction.ID, RunToCursorAction.LABEL, CONTEXT_DEBUGGERS_AVAILABLE);138registerDebugCommandPaletteItem(SelectionToReplAction.ID, SelectionToReplAction.LABEL, CONTEXT_IN_DEBUG_MODE);139registerDebugCommandPaletteItem(SelectionToWatchExpressionsAction.ID, SelectionToWatchExpressionsAction.LABEL);140registerDebugCommandPaletteItem(TOGGLE_INLINE_BREAKPOINT_ID, nls.localize2('inlineBreakpoint', "Inline Breakpoint"));141registerDebugCommandPaletteItem(DEBUG_START_COMMAND_ID, DEBUG_START_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));142registerDebugCommandPaletteItem(DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));143registerDebugCommandPaletteItem(SELECT_AND_START_ID, SELECT_AND_START_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));144registerDebugCommandPaletteItem(NEXT_DEBUG_CONSOLE_ID, NEXT_DEBUG_CONSOLE_LABEL);145registerDebugCommandPaletteItem(PREV_DEBUG_CONSOLE_ID, PREV_DEBUG_CONSOLE_LABEL);146registerDebugCommandPaletteItem(SHOW_LOADED_SCRIPTS_ID, OPEN_LOADED_SCRIPTS_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_LOADED_SCRIPTS_SUPPORTED);147registerDebugCommandPaletteItem(SELECT_DEBUG_CONSOLE_ID, SELECT_DEBUG_CONSOLE_LABEL);148registerDebugCommandPaletteItem(SELECT_DEBUG_SESSION_ID, SELECT_DEBUG_SESSION_LABEL);149registerDebugCommandPaletteItem(CALLSTACK_TOP_ID, CALLSTACK_TOP_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));150registerDebugCommandPaletteItem(CALLSTACK_BOTTOM_ID, CALLSTACK_BOTTOM_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));151registerDebugCommandPaletteItem(CALLSTACK_UP_ID, CALLSTACK_UP_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));152registerDebugCommandPaletteItem(CALLSTACK_DOWN_ID, CALLSTACK_DOWN_LABEL, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));153154// Debug callstack context menu155const registerDebugViewMenuItem = (menuId: MenuId, id: string, title: string | ICommandActionTitle, order: number, when?: ContextKeyExpression, precondition?: ContextKeyExpression, group = 'navigation', icon?: Icon) => {156MenuRegistry.appendMenuItem(menuId, {157group,158when,159order,160icon,161command: {162id,163title,164icon,165precondition166}167});168};169registerDebugViewMenuItem(MenuId.DebugCallStackContext, RESTART_SESSION_ID, RESTART_LABEL, 10, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), undefined, '3_modification');170registerDebugViewMenuItem(MenuId.DebugCallStackContext, DISCONNECT_ID, DISCONNECT_LABEL, 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), undefined, '3_modification');171registerDebugViewMenuItem(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');172registerDebugViewMenuItem(MenuId.DebugCallStackContext, STOP_ID, STOP_LABEL, 30, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('session'), undefined, '3_modification');173registerDebugViewMenuItem(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())));174registerDebugViewMenuItem(MenuId.DebugCallStackContext, CONTINUE_ID, CONTINUE_LABEL, 10, ContextKeyExpr.and(CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped')));175registerDebugViewMenuItem(MenuId.DebugCallStackContext, STEP_OVER_ID, STEP_OVER_LABEL, 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped'));176registerDebugViewMenuItem(MenuId.DebugCallStackContext, STEP_INTO_ID, STEP_INTO_LABEL, 30, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped'));177registerDebugViewMenuItem(MenuId.DebugCallStackContext, STEP_OUT_ID, STEP_OUT_LABEL, 40, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_DEBUG_STATE.isEqualTo('stopped'));178registerDebugViewMenuItem(MenuId.DebugCallStackContext, TERMINATE_THREAD_ID, nls.localize('terminateThread', "Terminate Thread"), 10, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('thread'), CONTEXT_TERMINATE_THREADS_SUPPORTED, 'termination');179registerDebugViewMenuItem(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);180registerDebugViewMenuItem(MenuId.DebugCallStackContext, COPY_STACK_TRACE_ID, nls.localize('copyStackTrace', "Copy Call Stack"), 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('stackFrame'), undefined, '3_modification');181182registerDebugViewMenuItem(MenuId.DebugVariablesContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 15, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_IN_DEBUG_MODE, 'inline', icons.debugInspectMemory);183registerDebugViewMenuItem(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');184registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_VALUE_ID, COPY_VALUE_LABEL, 10, undefined, undefined, '5_cutcopypaste');185registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');186registerDebugViewMenuItem(MenuId.DebugVariablesContext, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');187registerDebugViewMenuItem(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');188registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');189registerDebugViewMenuItem(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');190191registerDebugViewMenuItem(MenuId.DebugHoverContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 15, CONTEXT_CAN_VIEW_MEMORY, CONTEXT_IN_DEBUG_MODE, 'inline', icons.debugInspectMemory);192registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_VALUE_ID, COPY_VALUE_LABEL, 10, undefined, undefined, '5_cutcopypaste');193registerDebugViewMenuItem(MenuId.DebugHoverContext, COPY_EVALUATE_PATH_ID, COPY_EVALUATE_PATH_LABEL, 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');194registerDebugViewMenuItem(MenuId.DebugHoverContext, ADD_TO_WATCH_ID, ADD_TO_WATCH_LABEL, 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');195registerDebugViewMenuItem(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');196registerDebugViewMenuItem(MenuId.DebugHoverContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');197registerDebugViewMenuItem(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');198199registerDebugViewMenuItem(MenuId.DebugWatchContext, ADD_WATCH_ID, ADD_WATCH_LABEL, 10, undefined, undefined, '3_modification');200registerDebugViewMenuItem(MenuId.DebugWatchContext, EDIT_EXPRESSION_COMMAND_ID, nls.localize('editWatchExpression', "Edit Expression"), 20, CONTEXT_WATCH_ITEM_TYPE.isEqualTo('expression'), undefined, '3_modification');201registerDebugViewMenuItem(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');202registerDebugViewMenuItem(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');203registerDebugViewMenuItem(MenuId.DebugWatchContext, VIEW_MEMORY_ID, nls.localize('viewMemory', "View Binary Data"), 10, CONTEXT_CAN_VIEW_MEMORY, undefined, 'inline', icons.debugInspectMemory);204registerDebugViewMenuItem(MenuId.DebugWatchContext, REMOVE_EXPRESSION_COMMAND_ID, nls.localize('removeWatchExpression', "Remove Expression"), 20, CONTEXT_WATCH_ITEM_TYPE.isEqualTo('expression'), undefined, 'inline', icons.watchExpressionRemove);205registerDebugViewMenuItem(MenuId.DebugWatchContext, REMOVE_WATCH_EXPRESSIONS_COMMAND_ID, REMOVE_WATCH_EXPRESSIONS_LABEL, 20, undefined, undefined, 'z_commands');206registerDebugViewMenuItem(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');207registerDebugViewMenuItem(MenuId.DebugWatchContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break on Value Change"), 210, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');208registerDebugViewMenuItem(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');209210registerDebugViewMenuItem(MenuId.NotebookVariablesContext, COPY_NOTEBOOK_VARIABLE_VALUE_ID, COPY_NOTEBOOK_VARIABLE_VALUE_LABEL, 20, CONTEXT_VARIABLE_VALUE);211212KeybindingsRegistry.registerKeybindingRule({213id: COPY_VALUE_ID,214weight: KeybindingWeight.WorkbenchContrib,215when: ContextKeyExpr.and(216CONTEXT_EXPRESSION_SELECTED.negate(),217ContextKeyExpr.or(218FocusedViewContext.isEqualTo(WATCH_VIEW_ID),219FocusedViewContext.isEqualTo(VARIABLES_VIEW_ID),220),221),222primary: KeyMod.CtrlCmd | KeyCode.KeyC223});224225// Touch Bar226if (isMacintosh) {227228const registerTouchBarEntry = (id: string, title: string | ICommandActionTitle, order: number, when: ContextKeyExpression | undefined, iconUri: URI) => {229MenuRegistry.appendMenuItem(MenuId.TouchBarContext, {230command: {231id,232title,233icon: { dark: iconUri }234},235when: ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, when),236group: '9_debug',237order238});239};240241registerTouchBarEntry(DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, 0, CONTEXT_IN_DEBUG_MODE.toNegated(), FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/continue-tb.png'));242registerTouchBarEntry(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'));243registerTouchBarEntry(CONTINUE_ID, CONTINUE_LABEL, 0, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/continue-tb.png'));244registerTouchBarEntry(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'));245registerTouchBarEntry(STEP_OVER_ID, STEP_OVER_LABEL, 2, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stepover-tb.png'));246registerTouchBarEntry(STEP_INTO_ID, STEP_INTO_LABEL, 3, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stepinto-tb.png'));247registerTouchBarEntry(STEP_OUT_ID, STEP_OUT_LABEL, 4, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stepout-tb.png'));248registerTouchBarEntry(RESTART_SESSION_ID, RESTART_LABEL, 5, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/restart-tb.png'));249registerTouchBarEntry(STOP_ID, STOP_LABEL, 6, CONTEXT_IN_DEBUG_MODE, FileAccess.asFileUri('vs/workbench/contrib/debug/browser/media/stop-tb.png'));250}251252// Editor Title Menu's "Run/Debug" dropdown item253254MenuRegistry.appendMenuItem(MenuId.EditorTitle, { submenu: MenuId.EditorTitleRun, rememberDefaultAction: true, title: nls.localize2('run', "Run or Debug..."), icon: icons.debugRun, group: 'navigation', order: -1 });255256// Debug menu257258MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {259submenu: MenuId.MenubarDebugMenu,260title: {261...nls.localize2('runMenu', "Run"),262mnemonicTitle: nls.localize({ key: 'mRun', comment: ['&& denotes a mnemonic'] }, "&&Run")263},264order: 6265});266267MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {268group: '1_debug',269command: {270id: DEBUG_START_COMMAND_ID,271title: nls.localize({ key: 'miStartDebugging', comment: ['&& denotes a mnemonic'] }, "&&Start Debugging")272},273order: 1,274when: CONTEXT_DEBUGGERS_AVAILABLE275});276277MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {278group: '1_debug',279command: {280id: DEBUG_RUN_COMMAND_ID,281title: nls.localize({ key: 'miRun', comment: ['&& denotes a mnemonic'] }, "Run &&Without Debugging")282},283order: 2,284when: CONTEXT_DEBUGGERS_AVAILABLE285});286287MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {288group: '1_debug',289command: {290id: STOP_ID,291title: nls.localize({ key: 'miStopDebugging', comment: ['&& denotes a mnemonic'] }, "&&Stop Debugging"),292precondition: CONTEXT_IN_DEBUG_MODE293},294order: 3,295when: CONTEXT_DEBUGGERS_AVAILABLE296});297298MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {299group: '1_debug',300command: {301id: RESTART_SESSION_ID,302title: nls.localize({ key: 'miRestart Debugging', comment: ['&& denotes a mnemonic'] }, "&&Restart Debugging"),303precondition: CONTEXT_IN_DEBUG_MODE304},305order: 4,306when: CONTEXT_DEBUGGERS_AVAILABLE307});308309// Configuration310311MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {312group: '2_configuration',313command: {314id: ADD_CONFIGURATION_ID,315title: nls.localize({ key: 'miAddConfiguration', comment: ['&& denotes a mnemonic'] }, "A&&dd Configuration...")316},317order: 2,318when: CONTEXT_DEBUGGERS_AVAILABLE319});320321// Step Commands322MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {323group: '3_step',324command: {325id: STEP_OVER_ID,326title: nls.localize({ key: 'miStepOver', comment: ['&& denotes a mnemonic'] }, "Step &&Over"),327precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')328},329order: 1,330when: CONTEXT_DEBUGGERS_AVAILABLE331});332333MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {334group: '3_step',335command: {336id: STEP_INTO_ID,337title: nls.localize({ key: 'miStepInto', comment: ['&& denotes a mnemonic'] }, "Step &&Into"),338precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')339},340order: 2,341when: CONTEXT_DEBUGGERS_AVAILABLE342});343344MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {345group: '3_step',346command: {347id: STEP_OUT_ID,348title: nls.localize({ key: 'miStepOut', comment: ['&& denotes a mnemonic'] }, "Step O&&ut"),349precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')350},351order: 3,352when: CONTEXT_DEBUGGERS_AVAILABLE353});354355MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {356group: '3_step',357command: {358id: CONTINUE_ID,359title: nls.localize({ key: 'miContinue', comment: ['&& denotes a mnemonic'] }, "&&Continue"),360precondition: CONTEXT_DEBUG_STATE.isEqualTo('stopped')361},362order: 4,363when: CONTEXT_DEBUGGERS_AVAILABLE364});365366// New Breakpoints367368MenuRegistry.appendMenuItem(MenuId.MenubarNewBreakpointMenu, {369group: '1_breakpoints',370command: {371id: TOGGLE_INLINE_BREAKPOINT_ID,372title: nls.localize({ key: 'miInlineBreakpoint', comment: ['&& denotes a mnemonic'] }, "Inline Breakp&&oint")373},374order: 2,375when: CONTEXT_DEBUGGERS_AVAILABLE376});377378MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {379group: '4_new_breakpoint',380title: nls.localize({ key: 'miNewBreakpoint', comment: ['&& denotes a mnemonic'] }, "&&New Breakpoint"),381submenu: MenuId.MenubarNewBreakpointMenu,382order: 2,383when: CONTEXT_DEBUGGERS_AVAILABLE384});385386// Disassembly387388MenuRegistry.appendMenuItem(MenuId.DebugDisassemblyContext, {389group: '1_edit',390command: {391id: COPY_ADDRESS_ID,392title: COPY_ADDRESS_LABEL,393},394order: 2,395when: CONTEXT_DEBUGGERS_AVAILABLE396});397398MenuRegistry.appendMenuItem(MenuId.DebugDisassemblyContext, {399group: '3_breakpoints',400command: {401id: TOGGLE_BREAKPOINT_ID,402title: nls.localize({ key: 'miToggleBreakpoint', comment: ['&& denotes a mnemonic'] }, "Toggle Breakpoint"),403},404order: 2,405when: CONTEXT_DEBUGGERS_AVAILABLE406});407408// Breakpoint actions are registered from breakpointsView.ts409410// Install Debuggers411MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {412group: 'z_install',413command: {414id: 'debug.installAdditionalDebuggers',415title: nls.localize({ key: 'miInstallAdditionalDebuggers', comment: ['&& denotes a mnemonic'] }, "&&Install Additional Debuggers...")416},417order: 1418});419420// register repl panel421422const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({423id: DEBUG_PANEL_ID,424title: nls.localize2({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"),425icon: icons.debugConsoleViewIcon,426ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [DEBUG_PANEL_ID, { mergeViewWithContainerWhenSingleView: true }]),427storageId: DEBUG_PANEL_ID,428hideIfEmpty: true,429order: 2,430}, ViewContainerLocation.Panel, { doNotRegisterOpenCommand: true });431432Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{433id: REPL_VIEW_ID,434name: nls.localize2({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"),435containerIcon: icons.debugConsoleViewIcon,436canToggleVisibility: true,437canMoveView: true,438when: CONTEXT_DEBUGGERS_AVAILABLE,439ctorDescriptor: new SyncDescriptor(Repl),440openCommandActionDescriptor: {441id: 'workbench.debug.action.toggleRepl',442mnemonicTitle: nls.localize({ key: 'miToggleDebugConsole', comment: ['&& denotes a mnemonic'] }, "De&&bug Console"),443keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyY },444order: 2445}446}], VIEW_CONTAINER);447448449const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({450id: VIEWLET_ID,451title: nls.localize2('run and debug', "Run and Debug"),452openCommandActionDescriptor: {453id: VIEWLET_ID,454mnemonicTitle: nls.localize({ key: 'miViewRun', comment: ['&& denotes a mnemonic'] }, "&&Run"),455keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyD },456order: 3457},458ctorDescriptor: new SyncDescriptor(DebugViewPaneContainer),459icon: icons.runViewIcon,460alwaysUseContainerInfo: true,461order: 3,462}, ViewContainerLocation.Sidebar);463464// Register default debug views465const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry);466viewsRegistry.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);467viewsRegistry.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);468viewsRegistry.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);469viewsRegistry.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);470viewsRegistry.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);471viewsRegistry.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);472473// Register disassembly view474475Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane).registerEditorPane(476EditorPaneDescriptor.create(DisassemblyView, DISASSEMBLY_VIEW_ID, nls.localize('disassembly', "Disassembly")),477[new SyncDescriptor(DisassemblyViewInput)]478);479480// Register configuration481const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);482configurationRegistry.registerConfiguration({483id: 'debug',484order: 20,485title: nls.localize('debugConfigurationTitle', "Debug"),486type: 'object',487properties: {488'debug.showVariableTypes': {489type: 'boolean',490description: nls.localize({ comment: ['This is the description for a setting'], key: 'showVariableTypes' }, "Show variable type in variable pane during debug session"),491default: false492},493'debug.allowBreakpointsEverywhere': {494type: 'boolean',495description: nls.localize({ comment: ['This is the description for a setting'], key: 'allowBreakpointsEverywhere' }, "Allow setting breakpoints in any file."),496default: false497},498'debug.gutterMiddleClickAction': {499type: 'string',500enum: ['logpoint', 'conditionalBreakpoint', 'triggeredBreakpoint', 'none'],501description: 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.'),502enumDescriptions: [503nls.localize('debug.gutterMiddleClickAction.logpoint', "Add Logpoint."),504nls.localize('debug.gutterMiddleClickAction.conditionalBreakpoint', "Add Conditional Breakpoint."),505nls.localize('debug.gutterMiddleClickAction.triggeredBreakpoint', "Add Triggered Breakpoint."),506nls.localize('debug.gutterMiddleClickAction.none', "Don't perform any action."),507],508default: 'logpoint',509},510'debug.openExplorerOnEnd': {511type: 'boolean',512description: nls.localize({ comment: ['This is the description for a setting'], key: 'openExplorerOnEnd' }, "Automatically open the explorer view at the end of a debug session."),513default: false514},515'debug.closeReadonlyTabsOnEnd': {516type: 'boolean',517description: 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"),518default: false519},520'debug.inlineValues': {521type: 'string',522'enum': ['on', 'off', 'auto'],523description: nls.localize({ comment: ['This is the description for a setting'], key: 'inlineValues' }, "Show variable values inline in editor while debugging."),524'enumDescriptions': [525nls.localize('inlineValues.on', "Always show variable values inline in editor while debugging."),526nls.localize('inlineValues.off', "Never show variable values inline in editor while debugging."),527nls.localize('inlineValues.focusNoScroll', "Show variable values inline in editor while debugging when the language supports inline value locations."),528],529default: 'auto'530},531'debug.toolBarLocation': {532enum: ['floating', 'docked', 'commandCenter', 'hidden'],533markdownDescription: 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#`'),534default: 'floating',535markdownEnumDescriptions: [536nls.localize('debugToolBar.floating', "Show debug toolbar in all views."),537nls.localize('debugToolBar.docked', "Show debug toolbar only in debug views."),538nls.localize('debugToolBar.commandCenter', "`(Experimental)` Show debug toolbar in the command center."),539nls.localize('debugToolBar.hidden', "Do not show debug toolbar."),540]541},542'debug.showInStatusBar': {543enum: ['never', 'always', 'onFirstSessionStart'],544enumDescriptions: [nls.localize('never', "Never show debug in Status bar"), nls.localize('always', "Always show debug in Status bar"), nls.localize('onFirstSessionStart', "Show debug in Status bar only after debug was started for the first time")],545description: nls.localize({ comment: ['This is the description for a setting'], key: 'showInStatusBar' }, "Controls when the debug Status bar should be visible."),546default: 'onFirstSessionStart'547},548'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA,549'debug.console.closeOnEnd': {550type: 'boolean',551description: nls.localize('debug.console.closeOnEnd', "Controls if the Debug Console should be automatically closed when the debug session ends."),552default: false553},554'debug.terminal.clearBeforeReusing': {555type: 'boolean',556description: 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."),557default: false558},559'debug.openDebug': {560enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'],561default: 'openOnDebugBreak',562description: nls.localize('openDebug', "Controls when the debug view should open.")563},564'debug.showSubSessionsInToolBar': {565type: 'boolean',566description: 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."),567default: false568},569'debug.console.fontSize': {570type: 'number',571description: nls.localize('debug.console.fontSize', "Controls the font size in pixels in the Debug Console."),572default: isMacintosh ? 12 : 14,573},574'debug.console.fontFamily': {575type: 'string',576description: nls.localize('debug.console.fontFamily', "Controls the font family in the Debug Console."),577default: 'default'578},579'debug.console.lineHeight': {580type: 'number',581description: 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."),582default: 0583},584'debug.console.wordWrap': {585type: 'boolean',586description: nls.localize('debug.console.wordWrap', "Controls if the lines should wrap in the Debug Console."),587default: true588},589'debug.console.historySuggestions': {590type: 'boolean',591description: nls.localize('debug.console.historySuggestions', "Controls if the Debug Console should suggest previously typed input."),592default: true593},594'debug.console.collapseIdenticalLines': {595type: 'boolean',596description: nls.localize('debug.console.collapseIdenticalLines', "Controls if the Debug Console should collapse identical lines and show a number of occurrences with a badge."),597default: true598},599'debug.console.acceptSuggestionOnEnter': {600enum: ['off', 'on'],601description: 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."),602default: 'off'603},604'debug.console.maximumLines': {605type: 'number',606description: nls.localize('debug.console.maximumLines', "Controls the maximum number of lines in the Debug Console."),607default: 10000608},609'launch': {610type: 'object',611description: 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."),612default: { configurations: [], compounds: [] },613$ref: launchSchemaId,614disallowConfigurationDefault: true615},616'debug.focusWindowOnBreak': {617type: 'boolean',618description: nls.localize('debug.focusWindowOnBreak', "Controls whether the workbench window should be focused when the debugger breaks."),619default: true620},621'debug.focusEditorOnBreak': {622type: 'boolean',623description: nls.localize('debug.focusEditorOnBreak', "Controls whether the editor should be focused when the debugger breaks."),624default: true625},626'debug.onTaskErrors': {627enum: ['debugAnyway', 'showErrors', 'prompt', 'abort'],628enumDescriptions: [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.")],629description: nls.localize('debug.onTaskErrors', "Controls what to do when errors are encountered after running a preLaunchTask."),630default: 'prompt'631},632'debug.showBreakpointsInOverviewRuler': {633type: 'boolean',634description: nls.localize({ comment: ['This is the description for a setting'], key: 'showBreakpointsInOverviewRuler' }, "Controls whether breakpoints should be shown in the overview ruler."),635default: false636},637'debug.showInlineBreakpointCandidates': {638type: 'boolean',639description: 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."),640default: true641},642'debug.saveBeforeStart': {643description: nls.localize('debug.saveBeforeStart', "Controls what editors to save before starting a debug session."),644enum: ['allEditorsInActiveGroup', 'nonUntitledEditorsInActiveGroup', 'none'],645enumDescriptions: [646nls.localize('debug.saveBeforeStart.allEditorsInActiveGroup', "Save all editors in the active group before starting a debug session."),647nls.localize('debug.saveBeforeStart.nonUntitledEditorsInActiveGroup', "Save all editors in the active group except untitled ones before starting a debug session."),648nls.localize('debug.saveBeforeStart.none', "Don't save any editors before starting a debug session."),649],650default: 'allEditorsInActiveGroup',651scope: ConfigurationScope.LANGUAGE_OVERRIDABLE652},653'debug.confirmOnExit': {654description: nls.localize('debug.confirmOnExit', "Controls whether to confirm when the window closes if there are active debug sessions."),655type: 'string',656enum: ['never', 'always'],657enumDescriptions: [658nls.localize('debug.confirmOnExit.never', "Never confirm."),659nls.localize('debug.confirmOnExit.always', "Always confirm if there are debug sessions."),660],661default: 'never'662},663'debug.disassemblyView.showSourceCode': {664type: 'boolean',665default: true,666description: nls.localize('debug.disassemblyView.showSourceCode', "Show Source Code in Disassembly View.")667},668'debug.autoExpandLazyVariables': {669type: 'string',670enum: ['auto', 'on', 'off'],671default: 'auto',672enumDescriptions: [673nls.localize('debug.autoExpandLazyVariables.auto', "When in screen reader optimized mode, automatically expand lazy variables."),674nls.localize('debug.autoExpandLazyVariables.on', "Always automatically expand lazy variables."),675nls.localize('debug.autoExpandLazyVariables.off', "Never automatically expand lazy variables.")676],677description: nls.localize('debug.autoExpandLazyVariables', "Controls whether variables that are lazily resolved, such as getters, are automatically resolved and expanded by the debugger.")678},679'debug.enableStatusBarColor': {680type: 'boolean',681description: nls.localize('debug.enableStatusBarColor', "Color of the Status bar when debugger is active."),682default: true683},684'debug.hideLauncherWhileDebugging': {685type: 'boolean',686markdownDescription: 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#`'),687default: false688},689'debug.hideSlowPreLaunchWarning': {690type: 'boolean',691markdownDescription: nls.localize('debug.hideSlowPreLaunchWarning', "Hide the warning shown when a `preLaunchTask` has been running for a while."),692default: false693}694}695});696697AccessibleViewRegistry.register(new ReplAccessibleView());698AccessibleViewRegistry.register(new ReplAccessibilityHelp());699AccessibleViewRegistry.register(new RunAndDebugAccessibilityHelp());700registerWorkbenchContribution2(ReplAccessibilityAnnouncer.ID, ReplAccessibilityAnnouncer, WorkbenchPhase.AfterRestored);701registerWorkbenchContribution2(DebugWatchAccessibilityAnnouncer.ID, DebugWatchAccessibilityAnnouncer, WorkbenchPhase.AfterRestored);702703704