Skip to content

add exp setting for envs ext #25195

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,16 @@
"scope": "resource",
"type": "string"
},
"python.useEnvironmentsExtension": {
"default": false,
"description": "%python.useEnvironmentsExtension.description%",
"scope": "machine-overridable",
"type": "boolean",
"tags": [
"onExP",
"preview"
]
},
"python.experiments.enabled": {
"default": true,
"description": "%python.experiments.enabled.description%",
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"python.debugger.deprecatedMessage": "This configuration will be deprecated soon. Please replace `python` with `debugpy` to use the new Python Debugger extension.",
"python.defaultInterpreterPath.description": "Path to default Python to use when extension loads up for the first time, no longer used once an interpreter is selected for the workspace. See [here](https://aka.ms/AAfekmf) to understand when this is used",
"python.envFile.description": "Absolute path to a file containing environment variable definitions.",
"python.useEnvironmentsExtension.description": "Enables the Python Environments extension.",
"python.experiments.enabled.description": "Enables A/B tests experiments in the Python extension. If enabled, you may get included in proposed enhancements and/or features.",
"python.experiments.optInto.description": "List of experiments to opt into. If empty, user is assigned the default experiment groups. See [here](https://github.com/microsoft/vscode-python/wiki/AB-Experiments) for more details.",
"python.experiments.optOutFrom.description": "List of experiments to opt out of. If empty, user is assigned the default experiment groups. See [here](https://github.com/microsoft/vscode-python/wiki/AB-Experiments) for more details.",
Expand Down
5 changes: 4 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 { getConfiguration } from '../common/vscodeApis/workspaceApis';

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

Expand All @@ -22,7 +23,9 @@ export function useEnvExtension(): boolean {
if (_useExt !== undefined) {
return _useExt;
}
_useExt = !!getExtension(ENVS_EXTENSION_ID);
const inExpSetting = getConfiguration('python').get<boolean>('useEnvironmentsExtension', false);
// If extension is installed and in experiment, then use it.
_useExt = !!getExtension(ENVS_EXTENSION_ID) && inExpSetting;
return _useExt;
}

Expand Down
Loading