Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/simulation/fixtures/review/nested-services-1.ts
13399 views
1
class InstantiationService1 {
2
3
private readonly _children = new Set<InstantiationService1>();
4
5
constructor(private readonly _parent?: InstantiationService1) {}
6
7
createChild(): InstantiationService1 {
8
const child = new class extends InstantiationService1 {
9
override dispose(): void {
10
this._children.delete(child);
11
super.dispose();
12
}
13
}(this);
14
this._children.add(child);
15
16
return child;
17
}
18
19
dispose(): void {
20
this._children.forEach(child => child.dispose());
21
}
22
}
23