提交 2caf36fd 编写于 作者: J Johannes Rieken

don't debounce FS events

上级 6a205d16
......@@ -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<Uri>();
private _onDidChange = new Emitter<Uri>();
......
......@@ -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;
});
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册