提交 383086bc 编写于 作者: D Daniel Imms

Remove a bunch of unused code in FileService

上级 ba1bca7f
......@@ -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;
......
......@@ -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']);
......
......@@ -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();
......
......@@ -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<void>;
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<void>(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<IFilesConfiguration>();
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);
}
}
......
......@@ -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) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册