From 5feff5924d0b95cb9089d220ef835d9633c0e703 Mon Sep 17 00:00:00 2001 From: liuqian Date: Wed, 8 Jan 2025 09:06:24 +0800 Subject: [PATCH] fix: dispose first --- packages/file-service/src/node/hosted/watcher.host.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/file-service/src/node/hosted/watcher.host.service.ts b/packages/file-service/src/node/hosted/watcher.host.service.ts index 8893fc6c86..ed011aeaa4 100644 --- a/packages/file-service/src/node/hosted/watcher.host.service.ts +++ b/packages/file-service/src/node/hosted/watcher.host.service.ts @@ -19,7 +19,7 @@ import { WatcherProcessLogger } from './watch-process-log'; const watcherPlaceHolder = { disposable: { - dispose: () => {}, + dispose: () => { }, }, handlers: [], }; @@ -77,9 +77,9 @@ export class WatcherHostServiceImpl implements IWatcherHostService { // rewatch for (const [_uri, { options, disposable }] of this.watcherCollection) { - this.doWatch(Uri.parse(_uri), options); this.logger.log('rewatch file changes: ', _uri, ' recursive: ', options?.recursive); disposable.dispose(); + this.doWatch(Uri.parse(_uri), options); } }