mirror of
https://github.com/Microsoft/vscode
synced 2024-10-01 08:50:48 +00:00
Update extension enabled tsconfig libs (#159631)
Matches what we set for `src/`
This commit is contained in:
parent
55046fccac
commit
01ea9c11ea
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue