Reworks commanding structure for less redundancy

Adds command args copying when needed
This commit is contained in:
Eric Amodio
2017-06-27 19:28:14 -04:00
parent 8693c87523
commit 0a9559f5a5
36 changed files with 179 additions and 219 deletions

View File

@@ -24,7 +24,7 @@ export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand
super(Commands.ShowQuickCommitFileDetails);
}
async execute(editor: TextEditor, uri?: Uri, args: ShowQuickCommitFileDetailsCommandArgs = {}) {
async execute(editor?: TextEditor, uri?: Uri, args: ShowQuickCommitFileDetailsCommandArgs = {}) {
uri = getCommandUri(uri, editor);
if (uri === undefined) return undefined;
@@ -32,6 +32,7 @@ export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand
const gitUri = await GitUri.fromUri(uri, this.git);
args = { ...args };
if (args.sha === undefined) {
if (editor === undefined) return undefined;