Skip to content

Commit 01ea9c1

Browse files
authored
Update extension enabled tsconfig libs (microsoft#159631)
Matches what we set for `src/`
1 parent 55046fc commit 01ea9c1

File tree

3 files changed

+6
-37
lines changed

3 files changed

+6
-37
lines changed

extensions/markdown-language-features/server/src/util/dispose.ts

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
export class MultiDisposeError extends Error {
7-
constructor(
8-
public readonly errors: any[]
9-
) {
10-
super(`Encountered errors while disposing of store. Errors: [${errors.join(', ')}]`);
11-
}
12-
}
13-
146
export function disposeAll(disposables: Iterable<IDisposable>) {
157
const errors: any[] = [];
168

@@ -25,7 +17,7 @@ export function disposeAll(disposables: Iterable<IDisposable>) {
2517
if (errors.length === 1) {
2618
throw errors[0];
2719
} else if (errors.length > 1) {
28-
throw new MultiDisposeError(errors);
20+
throw new AggregateError(errors, 'Encountered errors while disposing of store');
2921
}
3022
}
3123

@@ -60,21 +52,3 @@ export abstract class Disposable {
6052
}
6153
}
6254

63-
export class DisposableStore extends Disposable {
64-
private readonly items = new Set<IDisposable>();
65-
66-
public override dispose() {
67-
super.dispose();
68-
disposeAll(this.items);
69-
this.items.clear();
70-
}
71-
72-
public add<T extends IDisposable>(item: T): T {
73-
if (this.isDisposed) {
74-
console.warn('Adding to disposed store. Item will be leaked');
75-
}
76-
77-
this.items.add(item);
78-
return item;
79-
}
80-
}

extensions/markdown-language-features/src/util/dispose.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55

66
import * as vscode from 'vscode';
77

8-
export class MultiDisposeError extends Error {
9-
constructor(
10-
public readonly errors: any[]
11-
) {
12-
super(`Encountered errors while disposing of store. Errors: [${errors.join(', ')}]`);
13-
}
14-
}
15-
168
export function disposeAll(disposables: Iterable<vscode.Disposable>) {
179
const errors: any[] = [];
1810

@@ -27,7 +19,7 @@ export function disposeAll(disposables: Iterable<vscode.Disposable>) {
2719
if (errors.length === 1) {
2820
throw errors[0];
2921
} else if (errors.length > 1) {
30-
throw new MultiDisposeError(errors);
22+
throw new AggregateError(errors, 'Encountered errors while disposing of store');
3123
}
3224
}
3325

extensions/tsconfig.base.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
"ES2020.Promise",
2121
"ES2020.String",
2222
"ES2020.Symbol.WellKnown",
23-
"ES2020.Intl"
23+
"ES2020.Intl",
24+
"ES2021.Promise",
25+
"ES2021.String",
26+
"ES2021.WeakRef"
2427
],
2528
"module": "commonjs",
2629
"strict": true,

0 commit comments

Comments
 (0)