Update extension enabled tsconfig libs (#159631)

Matches what we set for `src/`
This commit is contained in:
Matt Bierner 2022-08-30 22:57:15 -07:00 committed by GitHub
parent 55046fccac
commit 01ea9c11ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 37 deletions

View File

@ -3,14 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export class MultiDisposeError extends Error {
constructor(
public readonly errors: any[]
) {
super(`Encountered errors while disposing of store. Errors: [${errors.join(', ')}]`);
}
}
export function disposeAll(disposables: Iterable<IDisposable>) {
const errors: any[] = [];
@ -25,7 +17,7 @@ export function disposeAll(disposables: Iterable<IDisposable>) {
if (errors.length === 1) {
throw errors[0];
} else if (errors.length > 1) {
throw new MultiDisposeError(errors);
throw new AggregateError(errors, 'Encountered errors while disposing of store');
}
}
@ -60,21 +52,3 @@ export abstract class Disposable {
}
}
export class DisposableStore extends Disposable {
private readonly items = new Set<IDisposable>();
public override dispose() {
super.dispose();
disposeAll(this.items);
this.items.clear();
}
public add<T extends IDisposable>(item: T): T {
if (this.isDisposed) {
console.warn('Adding to disposed store. Item will be leaked');
}
this.items.add(item);
return item;
}
}

View File

@ -5,14 +5,6 @@
import * as vscode from 'vscode';
export class MultiDisposeError extends Error {
constructor(
public readonly errors: any[]
) {
super(`Encountered errors while disposing of store. Errors: [${errors.join(', ')}]`);
}
}
export function disposeAll(disposables: Iterable<vscode.Disposable>) {
const errors: any[] = [];
@ -27,7 +19,7 @@ export function disposeAll(disposables: Iterable<vscode.Disposable>) {
if (errors.length === 1) {
throw errors[0];
} else if (errors.length > 1) {
throw new MultiDisposeError(errors);
throw new AggregateError(errors, 'Encountered errors while disposing of store');
}
}

View File

@ -20,7 +20,10 @@
"ES2020.Promise",
"ES2020.String",
"ES2020.Symbol.WellKnown",
"ES2020.Intl"
"ES2020.Intl",
"ES2021.Promise",
"ES2021.String",
"ES2021.WeakRef"
],
"module": "commonjs",
"strict": true,