| 2696 | } |
| 2697 | |
| 2698 | private cleanUp(restart: boolean = false): void { |
| 2699 | if (this._listeners) { |
| 2700 | this._listeners.forEach(listener => listener.dispose()); |
| 2701 | this._listeners = undefined; |
| 2702 | } |
| 2703 | if (this._providers) { |
| 2704 | this._providers.forEach(provider => provider.dispose()); |
| 2705 | this._providers = undefined; |
| 2706 | } |
| 2707 | if (this._syncedDocuments) { |
| 2708 | this._syncedDocuments.clear(); |
| 2709 | } |
| 2710 | for (let handler of this._dynamicFeatures.values()) { |
| 2711 | handler.dispose(); |
| 2712 | } |
| 2713 | if (!restart && this._outputChannel && this._disposeOutputChannel) { |
| 2714 | this._outputChannel.dispose(); |
| 2715 | } |
| 2716 | if (!restart && this._diagnostics) { |
| 2717 | this._diagnostics.dispose(); |
| 2718 | this._diagnostics = undefined; |
| 2719 | } |
| 2720 | } |
| 2721 | |
| 2722 | private notifyFileEvent(event: FileEvent): void { |
| 2723 | this._fileEvents.push(event); |