Skip to content

Commit

Permalink
debug: add context menu copy action to repl
Browse files Browse the repository at this point in the history
fixes #3974
  • Loading branch information
isidorn committed Mar 30, 2016
1 parent ff5911c commit e261525
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/vs/workbench/parts/debug/browser/replViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ export class ReplExpressionsActionProvider implements renderer.IActionProvider {
actions.push(this.instantiationService.createInstance(debugactions.AddToWatchExpressionsAction, debugactions.AddToWatchExpressionsAction.ID, debugactions.AddToWatchExpressionsAction.LABEL, element));
actions.push(new actionbar.Separator());
}
actions.push(new debugactions.CopyAction(debugactions.CopyAction.ID, debugactions.CopyAction.LABEL));
actions.push(this.instantiationService.createInstance(debugactions.ClearReplAction, debugactions.ClearReplAction.ID, debugactions.ClearReplAction.LABEL));

return TPromise.as(actions);
Expand Down
10 changes: 10 additions & 0 deletions src/vs/workbench/parts/debug/electron-browser/debugActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,16 @@ export class ClearReplAction extends AbstractDebugAction {
}
}

export class CopyAction extends actions.Action {
static ID = 'workbench.debug.action.copy';
static LABEL = nls.localize('copy', "Copy");

public run(): TPromise<any> {
clipboard.writeText(window.getSelection().toString());
return TPromise.as(null);
}
}

export class ToggleReplAction extends AbstractDebugAction {
static ID = 'workbench.debug.action.toggleRepl';
static LABEL = nls.localize('toggleRepl', "Debug Console");
Expand Down

0 comments on commit e261525

Please sign in to comment.