From 7d2aa6dc7b3a1c22b2f1e65d43dc038758a42c4f Mon Sep 17 00:00:00 2001 From: Per Persson Date: Sat, 5 May 2018 21:04:39 +0000 Subject: [PATCH] Suggest other way to write some code Instead of const commands = [ ... ]; disposables.push(...commands); one can simply use disposables.push( ... ); --- src/extension.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 6fa8217..3931300 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -28,7 +28,8 @@ async function setup(disposables: vscode.Disposable[]) { vscode.window.setStatusBarMessage( 'gitflow using git executable: ' + git.info.path + ' with version ' + git.info.version, 5000); - const commands = [ + + disposables.push( vscode.commands.registerCommand( 'gitflow.initialize', async () => { @@ -117,9 +118,7 @@ async function setup(disposables: vscode.Disposable[]) { async () => { await runWrapped(flow.hotfix.finish); }), - ]; - // add disposable - disposables.push(...commands); + ); } export function activate(context: vscode.ExtensionContext) {