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

@@ -23,9 +23,10 @@ export class OpenInRemoteCommand extends ActiveEditorCommand {
async execute(editor: TextEditor, uri?: Uri, args: OpenInRemoteCommandArgs = {}) {
uri = getCommandUri(uri, editor);
try {
if (args.remotes === undefined || args.resource === undefined) return undefined;
args = { ...args };
if (args.remotes === undefined || args.resource === undefined) return undefined;
try {
if (args.remotes.length === 1) {
const command = new OpenRemoteCommandQuickPickItem(args.remotes[0], args.resource);
return command.execute();