Get rid of IEventService in favour of real events (#17515)

This commit is contained in:
Benjamin Pasero
2016-12-19 09:37:10 +01:00
committed by GitHub
parent a6a73e5450
commit 3cefffccfc
87 changed files with 1078 additions and 1126 deletions

View File

@@ -4,15 +4,17 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files';
import { FileChangeType, IFileService } from 'vs/platform/files/common/files';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
import { IEventService } from 'vs/platform/event/common/event';
import { RunOnceScheduler } from 'vs/base/common/async';
import { ExtHostContext, ExtHostFileSystemEventServiceShape, FileSystemEvents } from './extHost.protocol';
export class MainThreadFileSystemEventService {
constructor( @IEventService eventService: IEventService, @IThreadService threadService: IThreadService) {
constructor(
@IThreadService threadService: IThreadService,
@IFileService fileService: IFileService
) {
const proxy: ExtHostFileSystemEventServiceShape = threadService.get(ExtHostContext.ExtHostFileSystemEventService);
const events: FileSystemEvents = {
@@ -28,7 +30,7 @@ export class MainThreadFileSystemEventService {
events.deleted.length = 0;
}, 100);
eventService.addListener2('files:fileChanges', (event: FileChangesEvent) => {
fileService.onFileChanges(event => {
for (let change of event.changes) {
switch (change.type) {
case FileChangeType.ADDED: