提交 041a5c3b 编写于 作者: S Sandeep Somavarapu

fix tests - do not use file scheme

上级 f92251d8
......@@ -393,7 +393,7 @@ class DesktopMain extends Disposable {
}
private async createWorkspaceService(payload: IWorkspaceInitializationPayload, fileService: FileService, remoteAgentService: IRemoteAgentService, uriIdentityService: IUriIdentityService, logService: ILogService): Promise<WorkspaceService> {
const workspaceService = new WorkspaceService({ remoteAuthority: this.environmentService.remoteAuthority, configurationCache: new ConfigurationCache(this.environmentService, fileService) }, this.environmentService, fileService, remoteAgentService, uriIdentityService, logService);
const workspaceService = new WorkspaceService({ remoteAuthority: this.environmentService.remoteAuthority, configurationCache: new ConfigurationCache(URI.file(this.environmentService.userDataPath), fileService) }, this.environmentService, fileService, remoteAgentService, uriIdentityService, logService);
try {
await workspaceService.initialize(payload);
......
......@@ -3,8 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { join } from 'vs/base/common/path';
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
import { IConfigurationCache, ConfigurationKey } from 'vs/workbench/services/configuration/common/configuration';
import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
......@@ -16,7 +14,7 @@ export class ConfigurationCache implements IConfigurationCache {
private readonly cachedConfigurations: Map<string, CachedConfiguration> = new Map<string, CachedConfiguration>();
constructor(private readonly environmentService: INativeWorkbenchEnvironmentService, private readonly fileService: IFileService) {
constructor(private readonly cacheHome: URI, private readonly fileService: IFileService) {
}
needsCaching(resource: URI): boolean {
......@@ -40,7 +38,7 @@ export class ConfigurationCache implements IConfigurationCache {
const k = `${type}:${key}`;
let cachedConfiguration = this.cachedConfigurations.get(k);
if (!cachedConfiguration) {
cachedConfiguration = new CachedConfiguration({ type, key }, this.environmentService, this.fileService);
cachedConfiguration = new CachedConfiguration({ type, key }, this.cacheHome, this.fileService);
this.cachedConfigurations.set(k, cachedConfiguration);
}
return cachedConfiguration;
......@@ -56,10 +54,10 @@ class CachedConfiguration {
constructor(
{ type, key }: ConfigurationKey,
environmentService: INativeWorkbenchEnvironmentService,
cacheHome: URI,
private readonly fileService: IFileService
) {
this.cachedConfigurationFolderResource = URI.file(join(environmentService.userDataPath, 'CachedConfigurations', type, key));
this.cachedConfigurationFolderResource = joinPath(cacheHome, 'CachedConfigurations', type, key);
this.cachedConfigurationFileResource = joinPath(this.cachedConfigurationFolderResource, type === 'workspaces' ? 'workspace.json' : 'configuration.json');
}
......
......@@ -99,7 +99,7 @@ suite('ConfigurationEditingService', () => {
disposables.add(fileService.registerProvider(Schemas.userData, disposables.add(new FileUserDataProvider(Schemas.file, fileSystemProvider, Schemas.userData, logService))));
instantiationService.stub(IFileService, fileService);
instantiationService.stub(IRemoteAgentService, remoteAgentService);
workspaceService = disposables.add(new WorkspaceService({ configurationCache: new ConfigurationCache(environmentService, fileService) }, environmentService, fileService, remoteAgentService, new UriIdentityService(fileService), new NullLogService()));
workspaceService = disposables.add(new WorkspaceService({ configurationCache: new ConfigurationCache(URI.file(environmentService.userDataPath), fileService) }, environmentService, fileService, remoteAgentService, new UriIdentityService(fileService), new NullLogService()));
instantiationService.stub(IWorkspaceContextService, workspaceService);
await workspaceService.initialize({ folder: workspaceFolder, id: createHash('md5').update(workspaceFolder.toString()).digest('hex') });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册