提交 536d7831 编写于 作者: I isidor

debug: surface reverse continue action

fixes #13705
上级 ffb70920
......@@ -220,29 +220,6 @@ export class StepOutAction extends AbstractDebugAction {
}
}
export class StepBackAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepBack';
static LABEL = nls.localize('stepBackDebug', "Step Back");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action step-back', debugService, keybindingService, 50);
}
public run(thread: debug.IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread.stepBack();
}
protected isEnabled(state: debug.State): boolean {
const process = this.debugService.getViewModel().focusedProcess;
return super.isEnabled(state) && state === debug.State.Stopped &&
process && process.session.configuration.capabilities.supportsStepBack;
}
}
export class StopAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stop';
static LABEL = nls.localize('stopDebug', "Stop");
......@@ -755,3 +732,50 @@ export class FocusProcessAction extends AbstractDebugAction {
});
}
}
// Actions used by the chakra debugger
export class StepBackAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepBack';
static LABEL = nls.localize('stepBackDebug', "Step Back");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action step-back', debugService, keybindingService, 50);
}
public run(thread: debug.IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread ? thread.stepBack() : TPromise.as(null);
}
protected isEnabled(state: debug.State): boolean {
const process = this.debugService.getViewModel().focusedProcess;
return super.isEnabled(state) && state === debug.State.Stopped &&
process && process.session.configuration.capabilities.supportsStepBack;
}
}
export class ReverseContinueAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.reverseContinue';
static LABEL = nls.localize('reverseContinue', "Reverse");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action reverse-continue', debugService, keybindingService, 60);
}
public run(thread: debug.IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread ? thread.reverseContinue() : TPromise.as(null);
}
protected isEnabled(state: debug.State): boolean {
const process = this.debugService.getViewModel().focusedProcess;
return super.isEnabled(state) && state === debug.State.Stopped &&
process && process.session.configuration.capabilities.supportsStepBack;
}
}
......@@ -18,7 +18,7 @@ import { ActionBar, ActionsOrientation } from 'vs/base/browser/ui/actionbar/acti
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import * as debug from 'vs/workbench/parts/debug/common/debug';
import { AbstractDebugAction, PauseAction, ContinueAction, StepBackAction, StopAction, DisconnectAction, StepOverAction, StepIntoAction, StepOutAction, RestartAction, FocusProcessAction } from 'vs/workbench/parts/debug/browser/debugActions';
import { AbstractDebugAction, PauseAction, ContinueAction, StepBackAction, ReverseContinueAction, StopAction, DisconnectAction, StepOverAction, StepIntoAction, StepOutAction, RestartAction, FocusProcessAction } from 'vs/workbench/parts/debug/browser/debugActions';
import { FocusProcessActionItem } from 'vs/workbench/parts/debug/browser/debugActionItems';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
......@@ -201,6 +201,7 @@ export class DebugActionsWidget implements IWorkbenchContribution {
this.allActions.push(this.instantiationService.createInstance(StepOutAction, StepOutAction.ID, StepOutAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(RestartAction, RestartAction.ID, RestartAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(StepBackAction, StepBackAction.ID, StepBackAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(ReverseContinueAction, ReverseContinueAction.ID, ReverseContinueAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(FocusProcessAction, FocusProcessAction.ID, FocusProcessAction.LABEL));
this.allActions.forEach(a => {
this.toDispose.push(a);
......@@ -221,6 +222,9 @@ export class DebugActionsWidget implements IWorkbenchContribution {
if (a.id === StepBackAction.ID) {
return process && process.session.configuration.capabilities.supportsStepBack;
}
if (a.id === ReverseContinueAction.ID) {
return process && process.session.configuration.capabilities.supportsStepBack;
}
if (a.id === DisconnectAction.ID) {
return attached;
}
......
......@@ -96,11 +96,13 @@
background: url('step-out.svg') center center no-repeat;
}
.monaco-workbench .debug-action.step-back {
.monaco-workbench .debug-action.step-back,
.monaco-workbench .debug-action.reverse-continue {
transform: scaleX(-1);
}
.monaco-workbench .debug-action.continue,
.monaco-workbench .debug-action.reverse-continue,
.monaco-workbench .debug-action.start {
background: url('continue.svg') center center no-repeat;
}
......@@ -319,15 +321,12 @@
background: url('step-out-inverse.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .debug-action.step-back,
.hc-black .monaco-workbench .debug-action.step-back {
transform: scaleX(-1);
}
.vs-dark .monaco-workbench .debug-action.continue,
.vs-dark .monaco-workbench .debug-action.reverse-continue,
.vs-dark .monaco-workbench .debug-action.start,
.hc-black .monaco-workbench .debug-action.continue,
.hc-black .monaco-workbench .debug-action.start {
.hc-black .monaco-workbench .debug-action.start,
.hc-black .monaco-workbench .debug-action.reverse-continue {
background: url('continue-inverse.svg') center center no-repeat;
}
......
......@@ -27,7 +27,7 @@ import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { DebugEditorModelManager } from 'vs/workbench/parts/debug/browser/debugEditorModelManager';
import {
StepOverAction, ClearReplAction, FocusReplAction, StepIntoAction, StepOutAction, StartAction, StepBackAction, RestartAction, ContinueAction, StopAction, DisconnectAction, PauseAction, AddFunctionBreakpointAction,
StepOverAction, ClearReplAction, FocusReplAction, StepIntoAction, StepOutAction, StartAction, RestartAction, ContinueAction, StopAction, DisconnectAction, PauseAction, AddFunctionBreakpointAction,
ConfigureAction, DisableAllBreakpointsAction, EnableAllBreakpointsAction, RemoveAllBreakpointsAction, RunAction, ReapplyBreakpointsAction
} from 'vs/workbench/parts/debug/browser/debugActions';
import debugwidget = require('vs/workbench/parts/debug/browser/debugActionsWidget');
......@@ -117,7 +117,6 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(
registry.registerWorkbenchAction(new SyncActionDescriptor(StepOverAction, StepOverAction.ID, StepOverAction.LABEL, { primary: KeyCode.F10 }, debug.CONTEXT_IN_DEBUG_MODE), 'Debug: Step Over', debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(StepIntoAction, StepIntoAction.ID, StepIntoAction.LABEL, { primary: KeyCode.F11 }, debug.CONTEXT_IN_DEBUG_MODE, KeybindingsRegistry.WEIGHT.workbenchContrib(1)), 'Debug: Step Into', debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(StepOutAction, StepOutAction.ID, StepOutAction.LABEL, { primary: KeyMod.Shift | KeyCode.F11 }, debug.CONTEXT_IN_DEBUG_MODE), 'Debug: Step Out', debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(StepBackAction, StepBackAction.ID, StepBackAction.LABEL, { primary: KeyMod.Shift | KeyCode.F10 }, debug.CONTEXT_IN_DEBUG_MODE), 'Debug: Step Back', debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(RestartAction, RestartAction.ID, RestartAction.LABEL, { primary: KeyMod.Shift | KeyMod.CtrlCmd | KeyCode.F5 }, debug.CONTEXT_IN_DEBUG_MODE), 'Debug: Restart', debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(StopAction, StopAction.ID, StopAction.LABEL, { primary: KeyMod.Shift | KeyCode.F5 }, debug.CONTEXT_IN_DEBUG_MODE), 'Debug: Stop', debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(DisconnectAction, DisconnectAction.ID, DisconnectAction.LABEL), 'Debug: Disconnect', debugCategory);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册