From 3c28234a561277cf8cd5b4ed720fe86050474eea Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 16 Apr 2019 14:30:32 +0200 Subject: [PATCH] fileservice2 => fileservice --- src/vs/workbench/browser/nodeless.main.ts | 4 ++-- .../electron-browser/extensionsTipsService.test.ts | 4 ++-- src/vs/workbench/electron-browser/main.ts | 6 +++--- .../test/electron-browser/backupFileService.test.ts | 4 ++-- .../configurationEditingService.test.ts | 4 ++-- .../test/electron-browser/configurationService.test.ts | 10 +++++----- .../files/common/{fileService2.ts => fileService.ts} | 2 +- .../services/files/common/workspaceWatcher.ts | 4 ++-- .../services/files/test/browser/fileService2.test.ts | 6 +++--- .../services/files/test/node/diskFileService.test.ts | 6 +++--- .../test/electron-browser/keybindingEditing.test.ts | 4 ++-- .../services/textfile/test/textFileService.io.test.ts | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) rename src/vs/workbench/services/files/common/{fileService2.ts => fileService.ts} (99%) diff --git a/src/vs/workbench/browser/nodeless.main.ts b/src/vs/workbench/browser/nodeless.main.ts index 26543d5fe96..74ff1e9037c 100644 --- a/src/vs/workbench/browser/nodeless.main.ts +++ b/src/vs/workbench/browser/nodeless.main.ts @@ -19,7 +19,7 @@ import { RemoteAuthorityResolverService } from 'vs/platform/remote/browser/remot import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { IFileService } from 'vs/platform/files/common/files'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { Schemas } from 'vs/base/common/network'; class CodeRendererMain extends Disposable { @@ -78,7 +78,7 @@ class CodeRendererMain extends Disposable { serviceCollection.set(IRemoteAgentService, remoteAgentService); // Files - const fileService = this._register(new FileService2(logService)); + const fileService = this._register(new FileService(logService)); serviceCollection.set(IFileService, fileService); const connection = remoteAgentService.getConnection(); diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts index afdf58b7765..32d569b0b57 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts @@ -46,7 +46,7 @@ import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/ele import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ExtensionType } from 'vs/platform/extensions/common/extensions'; import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { NullLogService } from 'vs/platform/log/common/log'; import { Schemas } from 'vs/base/common/network'; import { DiskFileSystemProvider } from 'vs/workbench/services/files/node/diskFileSystemProvider'; @@ -282,7 +282,7 @@ suite('ExtensionsTipsService Test', () => { const myWorkspace = testWorkspace(URI.from({ scheme: 'file', path: folderDir })); workspaceService = new TestContextService(myWorkspace); instantiationService.stub(IWorkspaceContextService, workspaceService); - const fileService = new FileService2(new NullLogService()); + const fileService = new FileService(new NullLogService()); fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService())); instantiationService.stub(IFileService, fileService); } diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index 5578fe54e0a..10f802b99b7 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -41,7 +41,7 @@ import { RemoteAuthorityResolverService } from 'vs/platform/remote/electron-brow import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { RemoteAgentService } from 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { IFileService } from 'vs/platform/files/common/files'; import { DiskFileSystemProvider } from 'vs/workbench/services/files/electron-browser/diskFileSystemProvider'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; @@ -190,7 +190,7 @@ class CodeRendererMain extends Disposable { serviceCollection.set(IRemoteAgentService, remoteAgentService); // Files - const fileService = this._register(new FileService2(logService)); + const fileService = this._register(new FileService(logService)); serviceCollection.set(IFileService, fileService); const diskFileSystemProvider = this._register(new DiskFileSystemProvider(logService)); @@ -295,7 +295,7 @@ class CodeRendererMain extends Disposable { }, error => onUnexpectedError(error)); } - private createWorkspaceService(payload: IWorkspaceInitializationPayload, environmentService: IWorkbenchEnvironmentService, fileService: FileService2, remoteAgentService: IRemoteAgentService, logService: ILogService): Promise { + private createWorkspaceService(payload: IWorkspaceInitializationPayload, environmentService: IWorkbenchEnvironmentService, fileService: FileService, remoteAgentService: IRemoteAgentService, logService: ILogService): Promise { const configurationFileService = new ConfigurationFileService(); configurationFileService.fileService = fileService; diff --git a/src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts b/src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts index 6fd28930503..0ab7566a273 100644 --- a/src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts +++ b/src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts @@ -17,7 +17,7 @@ import { getRandomTestPath } from 'vs/base/test/node/testUtils'; import { DefaultEndOfLine } from 'vs/editor/common/model'; import { Schemas } from 'vs/base/common/network'; import { IWindowConfiguration } from 'vs/platform/windows/common/windows'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { NullLogService } from 'vs/platform/log/common/log'; import { DiskFileSystemProvider } from 'vs/workbench/services/files/node/diskFileSystemProvider'; import { WorkbenchEnvironmentService } from 'vs/workbench/services/environment/node/environmentService'; @@ -55,7 +55,7 @@ class TestBackupEnvironmentService extends WorkbenchEnvironmentService { class TestBackupFileService extends BackupFileService { constructor(workspace: Uri, backupHome: string, workspacesJsonPath: string) { - const fileService = new FileService2(new NullLogService()); + const fileService = new FileService(new NullLogService()); fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService())); const environmentService = new TestBackupEnvironmentService(workspaceBackupPath); diff --git a/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts b/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts index e8840849d3e..b3c90ce98d9 100644 --- a/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts @@ -33,7 +33,7 @@ import { URI } from 'vs/base/common/uri'; import { createHash } from 'crypto'; import { RemoteAgentService } from 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { NullLogService } from 'vs/platform/log/common/log'; import { Schemas } from 'vs/base/common/network'; import { DiskFileSystemProvider } from 'vs/workbench/services/files/node/diskFileSystemProvider'; @@ -109,7 +109,7 @@ suite('ConfigurationEditingService', () => { instantiationService.stub(IWorkspaceContextService, workspaceService); return workspaceService.initialize(noWorkspace ? { id: '' } : { folder: URI.file(workspaceDir), id: createHash('md5').update(URI.file(workspaceDir).toString()).digest('hex') }).then(() => { instantiationService.stub(IConfigurationService, workspaceService); - const fileService = new FileService2(new NullLogService()); + const fileService = new FileService(new NullLogService()); fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService())); instantiationService.stub(IFileService, fileService); instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService)); diff --git a/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts b/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts index 888d2c7607d..e35f5b0de41 100644 --- a/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts +++ b/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts @@ -37,7 +37,7 @@ import { IWindowConfiguration } from 'vs/platform/windows/common/windows'; import { RemoteAgentService } from 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import { RemoteAuthorityResolverService } from 'vs/platform/remote/electron-browser/remoteAuthorityResolverService'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { NullLogService } from 'vs/platform/log/common/log'; import { DiskFileSystemProvider } from 'vs/workbench/services/files/node/diskFileSystemProvider'; import { ConfigurationCache } from 'vs/workbench/services/configuration/node/configurationCache'; @@ -218,7 +218,7 @@ suite('WorkspaceContextService - Workspace Editing', () => { const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, path.join(parentDir, 'settings.json')); const remoteAgentService = instantiationService.createInstance(RemoteAgentService, {}); instantiationService.stub(IRemoteAgentService, remoteAgentService); - const fileService = new FileService2(new NullLogService()); + const fileService = new FileService(new NullLogService()); fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService())); const configurationFileService = new ConfigurationFileService(); configurationFileService.fileService = fileService; @@ -479,7 +479,7 @@ suite('WorkspaceService - Initialization', () => { const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); const remoteAgentService = instantiationService.createInstance(RemoteAgentService, {}); instantiationService.stub(IRemoteAgentService, remoteAgentService); - const fileService = new FileService2(new NullLogService()); + const fileService = new FileService(new NullLogService()); fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService())); const configurationFileService = new ConfigurationFileService(); configurationFileService.fileService = fileService; @@ -743,7 +743,7 @@ suite('WorkspaceConfigurationService - Folder', () => { const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); const remoteAgentService = instantiationService.createInstance(RemoteAgentService, {}); instantiationService.stub(IRemoteAgentService, remoteAgentService); - const fileService = new FileService2(new NullLogService()); + const fileService = new FileService(new NullLogService()); fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService())); const configurationFileService = new ConfigurationFileService(); configurationFileService.fileService = fileService; @@ -1071,7 +1071,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => { environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, path.join(parentDir, 'settings.json')); const remoteAgentService = instantiationService.createInstance(RemoteAgentService, {}); instantiationService.stub(IRemoteAgentService, remoteAgentService); - const fileService = new FileService2(new NullLogService()); + const fileService = new FileService(new NullLogService()); fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService())); const configurationFileService = new ConfigurationFileService(); configurationFileService.fileService = fileService; diff --git a/src/vs/workbench/services/files/common/fileService2.ts b/src/vs/workbench/services/files/common/fileService.ts similarity index 99% rename from src/vs/workbench/services/files/common/fileService2.ts rename to src/vs/workbench/services/files/common/fileService.ts index eaeff3af6ba..7206d943a87 100644 --- a/src/vs/workbench/services/files/common/fileService2.ts +++ b/src/vs/workbench/services/files/common/fileService.ts @@ -18,7 +18,7 @@ import { VSBuffer, VSBufferReadable, readableToBuffer, bufferToReadable, streamT import { Queue } from 'vs/base/common/async'; import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation'; -export class FileService2 extends Disposable implements IFileService { +export class FileService extends Disposable implements IFileService { _serviceBrand: ServiceIdentifier; diff --git a/src/vs/workbench/services/files/common/workspaceWatcher.ts b/src/vs/workbench/services/files/common/workspaceWatcher.ts index 48f2172a7ba..a16c82e3594 100644 --- a/src/vs/workbench/services/files/common/workspaceWatcher.ts +++ b/src/vs/workbench/services/files/common/workspaceWatcher.ts @@ -16,14 +16,14 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { StorageScope, IStorageService } from 'vs/platform/storage/common/storage'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { localize } from 'vs/nls'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; export class WorkspaceWatcher extends Disposable { private watches = new ResourceMap(); constructor( - @IFileService private readonly fileService: FileService2, + @IFileService private readonly fileService: FileService, @IConfigurationService private readonly configurationService: IConfigurationService, @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, @INotificationService private readonly notificationService: INotificationService, diff --git a/src/vs/workbench/services/files/test/browser/fileService2.test.ts b/src/vs/workbench/services/files/test/browser/fileService2.test.ts index e90bee6afba..eb0078a0825 100644 --- a/src/vs/workbench/services/files/test/browser/fileService2.test.ts +++ b/src/vs/workbench/services/files/test/browser/fileService2.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { URI } from 'vs/base/common/uri'; import { IFileSystemProviderRegistrationEvent, FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; @@ -15,7 +15,7 @@ import { timeout } from 'vs/base/common/async'; suite('File Service 2', () => { test('provider registration', async () => { - const service = new FileService2(new NullLogService()); + const service = new FileService(new NullLogService()); const resource = URI.parse('test://foo/bar'); assert.equal(service.canHandleResource(resource), false); @@ -64,7 +64,7 @@ suite('File Service 2', () => { }); test('watch', async () => { - const service = new FileService2(new NullLogService()); + const service = new FileService(new NullLogService()); let disposeCounter = 0; service.registerProvider('test', new NullFileSystemProvider(() => { diff --git a/src/vs/workbench/services/files/test/node/diskFileService.test.ts b/src/vs/workbench/services/files/test/node/diskFileService.test.ts index 8240ff71dfa..09bbe242bc1 100644 --- a/src/vs/workbench/services/files/test/node/diskFileService.test.ts +++ b/src/vs/workbench/services/files/test/node/diskFileService.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { tmpdir } from 'os'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { Schemas } from 'vs/base/common/network'; import { DiskFileSystemProvider } from 'vs/workbench/services/files/node/diskFileSystemProvider'; import { getRandomTestPath } from 'vs/base/test/node/testUtils'; @@ -104,7 +104,7 @@ suite('Disk File Service', () => { const parentDir = getRandomTestPath(tmpdir(), 'vsctests', 'diskfileservice'); const testSchema = 'test'; - let service: FileService2; + let service: FileService; let fileProvider: TestDiskFileSystemProvider; let testProvider: TestDiskFileSystemProvider; let testDir: string; @@ -114,7 +114,7 @@ suite('Disk File Service', () => { setup(async () => { const logService = new NullLogService(); - service = new FileService2(logService); + service = new FileService(logService); disposables.push(service); fileProvider = new TestDiskFileSystemProvider(logService); diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts index 0d72dfd6ac5..c9327d4205b 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts @@ -41,7 +41,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService'; import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { TestBackupFileService, TestContextService, TestEditorGroupsService, TestEditorService, TestLifecycleService, TestLogService, TestTextFileService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { Schemas } from 'vs/base/common/network'; import { DiskFileSystemProvider } from 'vs/workbench/services/files/node/diskFileSystemProvider'; @@ -81,7 +81,7 @@ suite('KeybindingsEditing', () => { instantiationService.stub(ILogService, new TestLogService()); instantiationService.stub(ITextResourcePropertiesService, new TestTextResourcePropertiesService(instantiationService.get(IConfigurationService))); instantiationService.stub(IModelService, instantiationService.createInstance(ModelServiceImpl)); - const fileService = new FileService2(new NullLogService()); + const fileService = new FileService(new NullLogService()); fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService())); instantiationService.stub(IFileService, fileService); instantiationService.stub(IUntitledEditorService, instantiationService.createInstance(UntitledEditorService)); diff --git a/src/vs/workbench/services/textfile/test/textFileService.io.test.ts b/src/vs/workbench/services/textfile/test/textFileService.io.test.ts index b2222d7ef25..f1377e9bf2a 100644 --- a/src/vs/workbench/services/textfile/test/textFileService.io.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileService.io.test.ts @@ -18,7 +18,7 @@ import { Schemas } from 'vs/base/common/network'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { rimraf, RimRafMode, copy, readFile, exists } from 'vs/base/node/pfs'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { FileService2 } from 'vs/workbench/services/files/common/fileService2'; +import { FileService } from 'vs/workbench/services/files/common/fileService'; import { NullLogService } from 'vs/platform/log/common/log'; import { getRandomTestPath } from 'vs/base/test/node/testUtils'; import { tmpdir } from 'os'; @@ -84,7 +84,7 @@ suite('Files - TextFileService i/o', () => { accessor = instantiationService.createInstance(ServiceAccessor); const logService = new NullLogService(); - const fileService = new FileService2(logService); + const fileService = new FileService(logService); const fileProvider = new DiskFileSystemProvider(logService); disposables.push(fileService.registerProvider(Schemas.file, fileProvider)); -- GitLab