Extract duplicated code

This commit is contained in:
Matt Bierner
2018-10-05 16:11:32 -07:00
parent 23fedc5a3e
commit 7b8e463099
3 changed files with 13 additions and 14 deletions

View File

@@ -50,3 +50,12 @@ export function closeAllEditors(): Thenable<any> {
return vscode.commands.executeCommand('workbench.action.closeAllEditors');
}
export function disposeAll(disposables: vscode.Disposable[]) {
while (disposables.length) {
let item = disposables.pop();
if (item) {
item.dispose();
}
}
}