Skip to content

Commit 76c671a

Browse files
author
Kartik Raj
authored
Only activate discovery component when in experiment (#14985)
1 parent af2de4d commit 76c671a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/client/extensionActivation.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ import { ITestCodeNavigatorCommandHandler, ITestExplorerCommandHandler } from '.
6969
import { registerTypes as unitTestsRegisterTypes } from './testing/serviceRegistry';
7070

7171
// components
72-
import * as pythonEnvironments from './pythonEnvironments';
72+
// import * as pythonEnvironments from './pythonEnvironments';
7373

7474
import { ActivationResult, ExtensionState } from './components';
7575
import { Components } from './extensionInit';
7676

7777
export async function activateComponents(
7878
// `ext` is passed to any extra activation funcs.
7979
ext: ExtensionState,
80-
components: Components
80+
_components: Components
8181
): Promise<ActivationResult[]> {
8282
// Note that each activation returns a promise that resolves
8383
// when that activation completes. However, it might have started
@@ -89,7 +89,13 @@ export async function activateComponents(
8989
// activation resolves `ActivationResult`, which can safely wrap
9090
// the "inner" promise.
9191
const promises: Promise<ActivationResult>[] = [
92-
pythonEnvironments.activate(components.pythonEnvs),
92+
// tslint:disable-next-line:no-suspicious-comment
93+
// TODO: For now the extension should only interact with the component via the component adapter,
94+
// which takes care of putting the component behind the experiment flag. It already activates the
95+
// component among other things, hence the following is not needed.
96+
// pythonEnvironments.activate(components.pythonEnvs),
97+
// If we need to activate, we need to use the adapter:
98+
// https://github.com/microsoft/vscode-python/issues/14984
9399
// These will go away eventually.
94100
activateLegacy(ext)
95101
];

src/client/pythonEnvironments/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function initialize(ext: ExtensionState): PythonEnvironments {
5454
ext.legacyIOC.serviceManager,
5555
api,
5656
environmentsSecurity,
57-
ext.disposables
57+
ext.disposables,
5858
);
5959

6060
return api;

0 commit comments

Comments
 (0)