From a7409d137758b0ab985a67c9e641897a30a130cd Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 19 Jul 2016 15:58:23 +0200 Subject: [PATCH] debug: remove context menu action 'add to watch' --- .../parts/debug/browser/debugActions.ts | 25 ------------------- .../electron-browser/debug.contribution.ts | 1 - 2 files changed, 26 deletions(-) diff --git a/src/vs/workbench/parts/debug/browser/debugActions.ts b/src/vs/workbench/parts/debug/browser/debugActions.ts index 5aa07793260..4ff4e3a9b99 100644 --- a/src/vs/workbench/parts/debug/browser/debugActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugActions.ts @@ -21,7 +21,6 @@ import model = require('vs/workbench/parts/debug/common/debugModel'); import { BreakpointWidget } from 'vs/workbench/parts/debug/browser/breakpointWidget'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; -import { IViewletService } from 'vs/workbench/services/viewlet/common/viewletService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import IDebugService = debug.IDebugService; @@ -653,30 +652,6 @@ export class AddWatchExpressionAction extends AbstractDebugAction { } } -export class SelectionToWatchExpressionsAction extends EditorAction { - static ID = 'editor.debug.action.selectionToWatch'; - - constructor(descriptor: editorCommon.IEditorActionDescriptorData, editor: editorCommon.ICommonCodeEditor, @IDebugService private debugService: IDebugService, @IViewletService private viewletService: IViewletService) { - super(descriptor, editor, Behaviour.TextFocus); - } - - public run(): TPromise { - const text = this.editor.getModel().getValueInRange(this.editor.getSelection()); - return this.viewletService.openViewlet(debug.VIEWLET_ID).then(() => this.debugService.addWatchExpression(text)); - } - - public getGroupId(): string { - return '5_debug/3_selection_to_watch'; - } - - public shouldShowInContextMenu(): boolean { - const selection = this.editor.getSelection(); - const text = this.editor.getModel().getValueInRange(selection); - - return !!selection && !selection.isEmpty() && this.debugService.getConfigurationManager().configurationName && text && /\S/.test(text); - } -} - export class SelectionToReplAction extends EditorAction { static ID = 'editor.debug.action.selectionToRepl'; diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts index c7df42b841e..612bcd6bedd 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts @@ -60,7 +60,6 @@ CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(dbgactions. }, 'Debug: Show Hover')); CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(dbgactions.EditorConditionalBreakpointAction, dbgactions.EditorConditionalBreakpointAction.ID, nls.localize('conditionalBreakpointEditorAction', "Debug: Conditional Breakpoint"), void 0, 'Debug: Conditional Breakpoint')); CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(dbgactions.SelectionToReplAction, dbgactions.SelectionToReplAction.ID, nls.localize('debugEvaluate', "Debug: Evaluate"), void 0, 'Debug: Evaluate')); -CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(dbgactions.SelectionToWatchExpressionsAction, dbgactions.SelectionToWatchExpressionsAction.ID, nls.localize('addToWatch', "Debug: Add to Watch"), void 0, 'Debug: Add to Watch')); CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(dbgactions.RunToCursorAction, dbgactions.RunToCursorAction.ID, nls.localize('runToCursor', "Debug: Run to Cursor"), void 0, 'Debug: Run to Cursor')); // register viewlet -- GitLab