/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; export function dispose(arg: vscode.Disposable | Iterable): void { if (arg instanceof vscode.Disposable) { arg.dispose(); } else { for (const disposable of arg) { disposable.dispose(); } } } export function combinedDisposable(disposables: Iterable): vscode.Disposable { return { dispose() { dispose(disposables); } }; }