forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlegacyIOC.ts
More file actions
27 lines (25 loc) · 1.11 KB
/
legacyIOC.ts
File metadata and controls
27 lines (25 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { instance, mock } from 'ts-mockito';
import { IServiceContainer, IServiceManager } from '../../client/ioc/types';
import { PythonEnvironments } from '../../client/pythonEnvironments/api';
import { initializeExternalDependencies } from '../../client/pythonEnvironments/common/externalDependencies';
import { registerLegacyDiscoveryForIOC, registerNewDiscoveryForIOC } from '../../client/pythonEnvironments/legacyIOC';
import { EnvironmentsSecurity } from '../../client/pythonEnvironments/security';
/**
* This is here to support old tests.
* @deprecated
*/
export async function registerForIOC(
serviceManager: IServiceManager,
serviceContainer: IServiceContainer,
): Promise<void> {
initializeExternalDependencies(serviceContainer);
// The old tests do not need real instances, directly pass in mocks.
registerNewDiscoveryForIOC(
serviceManager,
instance(mock(PythonEnvironments)),
instance(mock(EnvironmentsSecurity)),
);
await registerLegacyDiscoveryForIOC(serviceManager);
}