From 2caf36fdf5ab257e43d29c67e5f0584c9794bf07 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 17 Jan 2017 16:42:27 +0100 Subject: [PATCH] don't debounce FS events --- .../api/node/extHostFileSystemEventService.ts | 2 +- .../api/node/mainThreadFileSystemEventService.ts | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/api/node/extHostFileSystemEventService.ts b/src/vs/workbench/api/node/extHostFileSystemEventService.ts index eb102ae15c5..abfcee9b75f 100644 --- a/src/vs/workbench/api/node/extHostFileSystemEventService.ts +++ b/src/vs/workbench/api/node/extHostFileSystemEventService.ts @@ -10,7 +10,7 @@ import { match } from 'vs/base/common/glob'; import { Uri, FileSystemWatcher as _FileSystemWatcher } from 'vscode'; import { FileSystemEvents, ExtHostFileSystemEventServiceShape } from './extHost.protocol'; -export class FileSystemWatcher implements _FileSystemWatcher { +class FileSystemWatcher implements _FileSystemWatcher { private _onDidCreate = new Emitter(); private _onDidChange = new Emitter(); diff --git a/src/vs/workbench/api/node/mainThreadFileSystemEventService.ts b/src/vs/workbench/api/node/mainThreadFileSystemEventService.ts index b5771d4807d..9e4dfebe5a6 100644 --- a/src/vs/workbench/api/node/mainThreadFileSystemEventService.ts +++ b/src/vs/workbench/api/node/mainThreadFileSystemEventService.ts @@ -6,7 +6,6 @@ import { FileChangeType, IFileService } from 'vs/platform/files/common/files'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; -import { RunOnceScheduler } from 'vs/base/common/async'; import { ExtHostContext, ExtHostFileSystemEventServiceShape, FileSystemEvents } from './extHost.protocol'; export class MainThreadFileSystemEventService { @@ -23,13 +22,6 @@ export class MainThreadFileSystemEventService { deleted: [] }; - const scheduler = new RunOnceScheduler(() => { - proxy.$onFileEvent(events); - events.created.length = 0; - events.changed.length = 0; - events.deleted.length = 0; - }, 100); - fileService.onFileChanges(event => { for (let change of event.changes) { switch (change.type) { @@ -44,7 +36,11 @@ export class MainThreadFileSystemEventService { break; } } - scheduler.schedule(); + + proxy.$onFileEvent(events); + events.created.length = 0; + events.changed.length = 0; + events.deleted.length = 0; }); } } -- GitLab