当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript FileService2.registerProvider方法代码示例

本文整理汇总了TypeScript中vs/workbench/services/files2/common/fileService2.FileService2.registerProvider方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FileService2.registerProvider方法的具体用法?TypeScript FileService2.registerProvider怎么用?TypeScript FileService2.registerProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vs/workbench/services/files2/common/fileService2.FileService2的用法示例。


在下文中一共展示了FileService2.registerProvider方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: setup

	setup(async () => {
		service = new FileService2(new NullLogService());
		disposables.push(service);

		fileProvider = new TestDiskFileSystemProvider();
		service.registerProvider(Schemas.file, fileProvider);

		testProvider = new TestDiskFileSystemProvider();
		service.registerProvider(testSchema, testProvider);

		const id = generateUuid();
		testDir = join(parentDir, id);
		const sourceDir = getPathFromAmdModule(require, './fixtures/service');

		await copy(sourceDir, testDir);
	});
开发者ID:joelday,项目名称:vscode,代码行数:16,代码来源:diskFileService.test.ts

示例2: initServices

	private initServices(): Promise<{ serviceCollection: ServiceCollection, logService: ILogService, storageService: StorageService }> {
		const serviceCollection = new ServiceCollection();

		// Main Process
		const mainProcessService = this._register(new MainProcessService(this.configuration.windowId));
		serviceCollection.set(IMainProcessService, mainProcessService);

		// Window
		serviceCollection.set(IWindowService, new SyncDescriptor(WindowService, [this.configuration]));

		// Environment
		const environmentService = new EnvironmentService(this.configuration, this.configuration.execPath);
		serviceCollection.set(IEnvironmentService, environmentService);

		// Log
		const logService = this._register(this.createLogService(mainProcessService, environmentService));
		serviceCollection.set(ILogService, logService);

		// Files
		const fileService = new FileService2(logService);
		serviceCollection.set(IFileService, fileService);

		fileService.registerProvider(Schemas.file, new DiskFileSystemProvider());

		// Remote
		const remoteAuthorityResolverService = new RemoteAuthorityResolverService();
		serviceCollection.set(IRemoteAuthorityResolverService, remoteAuthorityResolverService);
		const remoteAgentService = new RemoteAgentService(this.configuration, environmentService, remoteAuthorityResolverService);
		serviceCollection.set(IRemoteAgentService, remoteAgentService);

		const connection = remoteAgentService.getConnection();
		if (connection) {
			const channel = connection.getChannel<IChannel>(REMOTE_FILE_SYSTEM_CHANNEL_NAME);
			const fileSystemProvider = new RemoteExtensionsFileSystemProvider(channel);
			fileService.registerProvider('vscode-remote', fileSystemProvider);
			remoteAgentService.getEnvironment().then(remoteAgentEnvironment => {
				const isCaseSensitive = !!(remoteAgentEnvironment && remoteAgentEnvironment.os === OperatingSystem.Linux);
				fileSystemProvider.setCaseSensitive(isCaseSensitive);
			});
		}

		return this.resolveWorkspaceInitializationPayload(environmentService).then(payload => Promise.all([
			this.createWorkspaceService(payload, environmentService, remoteAgentService, logService).then(service => {

				// Workspace
				serviceCollection.set(IWorkspaceContextService, service);

				// Configuration
				serviceCollection.set(IConfigurationService, service);

				return service;
			}),

			this.createStorageService(payload, environmentService, logService, mainProcessService).then(service => {

				// Storage
				serviceCollection.set(IStorageService, service);

				return service;
			})
		]).then(services => ({ serviceCollection, logService, storageService: services[1] })));
	}
开发者ID:joelday,项目名称:vscode,代码行数:62,代码来源:main.ts

示例3: Promise

				e.join(new Promise(resolve => {
					registrationDisposable = service.registerProvider('test', new NullFileSystemProvider());

					resolve();
				}));
开发者ID:joelday,项目名称:vscode,代码行数:5,代码来源:fileService2.test.ts


注:本文中的vs/workbench/services/files2/common/fileService2.FileService2.registerProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。