Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,17 @@
"pythonPromptNewToolsExt",
"pythonTerminalEnvVarActivation",
"pythonDiscoveryUsingWorkers",
"pythonTestAdapter"
"pythonTestAdapter",
"pythonEnvExtEnabled"
],
"enumDescriptions": [
"%python.experiments.All.description%",
"%python.experiments.pythonSurveyNotification.description%",
"%python.experiments.pythonPromptNewToolsExt.description%",
"%python.experiments.pythonTerminalEnvVarActivation.description%",
"%python.experiments.pythonDiscoveryUsingWorkers.description%",
"%python.experiments.pythonTestAdapter.description%"
"%python.experiments.pythonTestAdapter.description%",
"%python.experiments.pythonEnvExtEnabled.description%"
]
},
"scope": "window",
Expand All @@ -481,15 +483,17 @@
"pythonPromptNewToolsExt",
"pythonTerminalEnvVarActivation",
"pythonDiscoveryUsingWorkers",
"pythonTestAdapter"
"pythonTestAdapter",
"pythonEnvExtEnabled"
],
"enumDescriptions": [
"%python.experiments.All.description%",
"%python.experiments.pythonSurveyNotification.description%",
"%python.experiments.pythonPromptNewToolsExt.description%",
"%python.experiments.pythonTerminalEnvVarActivation.description%",
"%python.experiments.pythonDiscoveryUsingWorkers.description%",
"%python.experiments.pythonTestAdapter.description%"
"%python.experiments.pythonTestAdapter.description%",
"%python.experiments.pythonEnvExtEnabled.description%"
]
},
"scope": "window",
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"python.experiments.pythonSurveyNotification.description": "Denotes the Python Survey Notification experiment.",
"python.experiments.pythonPromptNewToolsExt.description": "Denotes the Python Prompt New Tools Extension experiment.",
"python.experiments.pythonTerminalEnvVarActivation.description": "Enables use of environment variables to activate terminals instead of sending activation commands.",
"python.experiments.pythonEnvExtEnabled.description": "Enables the Python Environments extension to be enabled by default.",
"python.experiments.pythonDiscoveryUsingWorkers.description": "Enables use of worker threads to do heavy computation when discovering interpreters.",
"python.experiments.pythonTestAdapter.description": "Denotes the Python Test Adapter experiment.",
"python.experiments.pythonRecommendTensorboardExt.description": "Denotes the Tensorboard Extension recommendation experiment.",
Expand Down
4 changes: 4 additions & 0 deletions src/client/common/experiments/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export enum TerminalEnvVarActivation {
experiment = 'pythonTerminalEnvVarActivation',
}

export enum EnvExtEnabled {
experiment = 'pythonEnvExtEnabled',
}

export enum DiscoveryUsingWorkers {
experiment = 'pythonDiscoveryUsingWorkers',
}
Expand Down
7 changes: 6 additions & 1 deletion src/client/common/experiments/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

import { env, workspace } from 'vscode';
import { IExperimentService } from '../types';
import { TerminalEnvVarActivation } from './groups';
import { EnvExtEnabled, TerminalEnvVarActivation } from './groups';
import { isTestExecution } from '../constants';
import { traceInfo } from '../../logging';
import { inExperiment } from '../../pythonEnvironments/common/externalDependencies';

export function inTerminalEnvVarExperiment(experimentService: IExperimentService): boolean {
if (!isTestExecution() && env.remoteName && workspace.workspaceFolders && workspace.workspaceFolders.length > 1) {
Expand All @@ -20,3 +21,7 @@ export function inTerminalEnvVarExperiment(experimentService: IExperimentService
}
return true;
}

export function inEnvExtEnabledExperiment(): boolean {
return inExperiment(EnvExtEnabled.experiment);
}
4 changes: 3 additions & 1 deletion src/client/envExt/api.internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from './types';
import { executeCommand } from '../common/vscodeApis/commandApis';
import { IInterpreterPathService } from '../common/types';
import { inEnvExtEnabledExperiment } from '../common/experiments/helpers';

export const ENVS_EXTENSION_ID = 'ms-python.vscode-python-envs';

Expand All @@ -22,7 +23,8 @@ export function useEnvExtension(): boolean {
if (_useExt !== undefined) {
return _useExt;
}
_useExt = !!getExtension(ENVS_EXTENSION_ID);
// If extension is installed and in experiment, then use it.
_useExt = !!getExtension(ENVS_EXTENSION_ID) && inEnvExtEnabledExperiment();
return _useExt;
}

Expand Down
Loading