diff --git a/src/vs/workbench/services/backup/test/backupFileService.test.ts b/src/vs/workbench/services/backup/test/backupFileService.test.ts index 9c3b8fdd1576872b3fe2efec17e9ad6ff8a76ee7..4d8212aef0ed2005fa3c6e5d736d75a994dfc64c 100644 --- a/src/vs/workbench/services/backup/test/backupFileService.test.ts +++ b/src/vs/workbench/services/backup/test/backupFileService.test.ts @@ -20,7 +20,7 @@ import { FileService } from 'vs/workbench/services/files/node/fileService'; class TestBackupFileService extends BackupFileService { constructor(workspace: Uri, backupHome: string, workspacesJsonPath: string) { - const fileService = new FileService(workspace.fsPath, { disableWatcher: true }, null, null, null); + const fileService = new FileService(workspace.fsPath, { disableWatcher: true }, null); super(workspace, TestEnvironmentService, fileService); this.backupHome = backupHome; diff --git a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts index 90835157f0c1546344d03ae0f993e1130a6fa39b..3fb9bb17257a7ba92904370f86cb28979c612d91 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts @@ -96,7 +96,7 @@ suite('WorkspaceConfigurationEditingService - Node', () => { const configurationService = new WorkspaceConfigurationService(workspaceContextService, new TestEventService(), environmentService); const textFileService = workbenchInstantiationService().createInstance(TestDirtyTextFileService, dirty); const events = new utils.TestEventService(); - const fileService = new FileService(noWorkspace ? null : workspaceDir, { disableWatcher: true }, events, environmentService, configurationService); + const fileService = new FileService(noWorkspace ? null : workspaceDir, { disableWatcher: true }, events); return configurationService.initialize().then(() => { return { @@ -359,7 +359,7 @@ suite('WorkspaceConfigurationEditingService - Node', () => { if (error) { return cleanUp(done, error); } - + createServices(workspaceDir, globalSettingsFile).done(services => { const target = path.join(workspaceDir, WORKSPACE_STANDALONE_CONFIGURATIONS['launch']); diff --git a/src/vs/workbench/services/files/electron-browser/fileService.ts b/src/vs/workbench/services/files/electron-browser/fileService.ts index 00a777396f9a2b8d85bd0bc8036e0fc65c9705b3..b4642adedb4dd2d277709df7e779831f7b24fee1 100644 --- a/src/vs/workbench/services/files/electron-browser/fileService.ts +++ b/src/vs/workbench/services/files/electron-browser/fileService.ts @@ -81,7 +81,7 @@ export class FileService implements IFileService { // create service const workspace = this.contextService.getWorkspace(); - this.raw = new NodeFileService(workspace ? workspace.resource.fsPath : void 0, fileServiceConfig, this.eventService, this.environmentService, this.configurationService); + this.raw = new NodeFileService(workspace ? workspace.resource.fsPath : void 0, fileServiceConfig, this.eventService); // Listeners this.registerListeners(); diff --git a/src/vs/workbench/services/files/node/fileService.ts b/src/vs/workbench/services/files/node/fileService.ts index 12098ddc880afd8b624d27a909dd9befea6d1934..7093fb38ac90ef761a7626dc812b2eaa7cc19cfa 100644 --- a/src/vs/workbench/services/files/node/fileService.ts +++ b/src/vs/workbench/services/files/node/fileService.ts @@ -28,14 +28,10 @@ import pfs = require('vs/base/node/pfs'); import encoding = require('vs/base/node/encoding'); import mime = require('vs/base/node/mime'); import flow = require('vs/base/node/flow'); -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { FileWatcher as UnixWatcherService } from 'vs/workbench/services/files/node/watcher/unix/watcherService'; import { FileWatcher as WindowsWatcherService } from 'vs/workbench/services/files/node/watcher/win32/watcherService'; import { toFileChangesEvent, normalize, IRawFileChange } from 'vs/workbench/services/files/node/watcher/common'; import { IEventService } from 'vs/platform/event/common/event'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IFilesConfiguration } from 'vs/platform/files/common/files'; export interface IEncodingOverride { resource: uri; @@ -76,7 +72,6 @@ export class FileService implements IFileService { private static FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms) private static MAX_DEGREE_OF_PARALLEL_FS_OPS = 10; // degree of parallel fs calls that we accept at the same time - private toUnbind: IDisposable[]; private basePath: string; private tmpPath: string; private options: IFileServiceOptions; @@ -87,14 +82,10 @@ export class FileService implements IFileService { private fileChangesWatchDelayer: ThrottledDelayer; private undeliveredRawFileChangesEvents: IRawFileChange[]; - private configuredHotExit: boolean; - constructor( basePath: string, options: IFileServiceOptions, - private eventEmitter: IEventService, - private environmentService: IEnvironmentService, - private configurationService: IConfigurationService + private eventEmitter: IEventService ) { this.basePath = basePath ? paths.normalize(basePath) : void 0; @@ -128,19 +119,6 @@ export class FileService implements IFileService { this.activeFileChangesWatchers = Object.create(null); this.fileChangesWatchDelayer = new ThrottledDelayer(FileService.FS_EVENT_DELAY); this.undeliveredRawFileChangesEvents = []; - - // Configuration changes - this.toUnbind = []; - if (this.configurationService) { - this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(e.config))); - - const configuration = this.configurationService.getConfiguration(); - this.onConfigurationChange(configuration); - } - } - - private onConfigurationChange(configuration: IFilesConfiguration): void { - this.configuredHotExit = configuration && configuration.files && configuration.files.hotExit; } public updateOptions(options: IFileServiceOptions): void { @@ -688,8 +666,6 @@ export class FileService implements IFileService { watcher.close(); } this.activeFileChangesWatchers = Object.create(null); - - this.toUnbind = dispose(this.toUnbind); } } diff --git a/src/vs/workbench/services/files/test/node/fileService.test.ts b/src/vs/workbench/services/files/test/node/fileService.test.ts index 5b09c5dfc92fa9ee1fea8943c7ba16d9bb967fa7..9010079c455b1d1feb1a55995c7933eea289ffd3 100644 --- a/src/vs/workbench/services/files/test/node/fileService.test.ts +++ b/src/vs/workbench/services/files/test/node/fileService.test.ts @@ -38,7 +38,7 @@ suite('FileService', () => { } events = new utils.TestEventService(); - service = new FileService(testDir, { disableWatcher: true }, events, null, null); + service = new FileService(testDir, { disableWatcher: true }, events); done(); }); }); @@ -499,7 +499,7 @@ suite('FileService', () => { encoding: 'windows1252', encodingOverride: encodingOverride, disableWatcher: true - }, null, null, null); + }, null); _service.resolveContent(uri.file(path.join(testDir, 'index.html'))).done(c => { assert.equal(c.encoding, 'windows1252'); @@ -525,7 +525,7 @@ suite('FileService', () => { let _service = new FileService(_testDir, { disableWatcher: true - }, null, null, null); + }, null); extfs.copy(_sourceDir, _testDir, () => { fs.readFile(resource.fsPath, (error, data) => {