From edc6ce5e418e9a0d5f4afd074e54d5dc0180ae3f Mon Sep 17 00:00:00 2001 From: Kim-Adeline Miguel Date: Tue, 29 Sep 2020 15:03:39 -0700 Subject: [PATCH] Move IPersistentStateFactory registration to registerForIOC --- src/client/common/serviceRegistry.ts | 3 --- src/client/pythonEnvironments/legacyIOC.ts | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/common/serviceRegistry.ts b/src/client/common/serviceRegistry.ts index 444b666c70e3..5f8b6e10e2da 100644 --- a/src/client/common/serviceRegistry.ts +++ b/src/client/common/serviceRegistry.ts @@ -65,7 +65,6 @@ import { FileDownloader } from './net/fileDownloader'; import { HttpClient } from './net/httpClient'; import { NugetService } from './nuget/nugetService'; import { INugetService } from './nuget/types'; -import { PersistentStateFactory } from './persistentState'; import { IS_WINDOWS } from './platform/constants'; import { PathUtils } from './platform/pathUtils'; import { CurrentProcess } from './process/currentProcess'; @@ -105,7 +104,6 @@ import { IFeatureDeprecationManager, IInstaller, IPathUtils, - IPersistentStateFactory, IRandom, IsWindows } from './types'; @@ -120,7 +118,6 @@ export function registerTypes(serviceManager: IServiceManager) { serviceManager.addSingleton(IInterpreterPathService, InterpreterPathService); serviceManager.addSingleton(IExtensions, Extensions); serviceManager.addSingleton(IRandom, Random); - serviceManager.addSingleton(IPersistentStateFactory, PersistentStateFactory); serviceManager.addSingleton(ITerminalServiceFactory, TerminalServiceFactory); serviceManager.addSingleton(IPathUtils, PathUtils); serviceManager.addSingleton(IApplicationShell, ApplicationShell); diff --git a/src/client/pythonEnvironments/legacyIOC.ts b/src/client/pythonEnvironments/legacyIOC.ts index d6c199d9e301..3a0dfe9661be 100644 --- a/src/client/pythonEnvironments/legacyIOC.ts +++ b/src/client/pythonEnvironments/legacyIOC.ts @@ -3,6 +3,8 @@ import { injectable } from 'inversify'; import * as vscode from 'vscode'; +import { PersistentStateFactory } from '../common/persistentState'; +import { IPersistentStateFactory } from '../common/types'; import { getVersionString, parseVersion } from '../common/utils/version'; import { CONDA_ENV_FILE_SERVICE, @@ -367,5 +369,8 @@ export function registerForIOC( serviceManager.addSingleton(IInterpreterWatcherBuilder, InterpreterWatcherBuilder); serviceManager.addSingletonInstance(IEnvironmentInfoService, new EnvironmentInfoService()); + + serviceManager.addSingleton(IPersistentStateFactory, PersistentStateFactory); + initializeExternalDependencies(serviceContainer); }