Skip to content

Commit

Permalink
enable 'Restart Frame' only for participating debug adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
weinand committed Jul 12, 2016
1 parent 217e0b5 commit 50a0945
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export class CallStackController extends BaseDebugController {

export class CallStackActionProvider implements renderer.IActionProvider {

constructor( @IInstantiationService private instantiationService: IInstantiationService) {
constructor( @IInstantiationService private instantiationService: IInstantiationService, @debug.IDebugService private debugService: debug.IDebugService) {
// noop
}

Expand Down Expand Up @@ -310,7 +310,10 @@ export class CallStackActionProvider implements renderer.IActionProvider {
actions.push(this.instantiationService.createInstance(debugactions.PauseAction, debugactions.PauseAction.ID, debugactions.PauseAction.LABEL));
}
} else if (element instanceof model.StackFrame) {
actions.push(this.instantiationService.createInstance(debugactions.RestartFrameAction, debugactions.RestartFrameAction.ID, debugactions.RestartFrameAction.LABEL));
const caps = this.debugService.getActiveSession().configuration.capabilities;
if (typeof caps.supportsRestartFrame === 'boolean' && caps.supportsRestartFrame) {
actions.push(this.instantiationService.createInstance(debugactions.RestartFrameAction, debugactions.RestartFrameAction.ID, debugactions.RestartFrameAction.LABEL));
}
}

return TPromise.as(actions);
Expand Down

0 comments on commit 50a0945

Please sign in to comment.