Skip to content

Commit 504829b

Browse files
committed
add exp setting for envs ext
1 parent 5070566 commit 504829b

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,16 @@
440440
"scope": "resource",
441441
"type": "string"
442442
},
443+
"python.useEnvironmentsExtension": {
444+
"default": false,
445+
"description": "%python.useEnvironmentsExtension.description%",
446+
"scope": "machine-overridable",
447+
"type": "boolean",
448+
"tags": [
449+
"onExP",
450+
"preview"
451+
]
452+
},
443453
"python.experiments.enabled": {
444454
"default": true,
445455
"description": "%python.experiments.enabled.description%",

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"python.debugger.deprecatedMessage": "This configuration will be deprecated soon. Please replace `python` with `debugpy` to use the new Python Debugger extension.",
3939
"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",
4040
"python.envFile.description": "Absolute path to a file containing environment variable definitions.",
41+
"python.useEnvironmentsExtension.description": "Enables the Python Environments extension.",
4142
"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.",
4243
"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.",
4344
"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.",

src/client/envExt/api.internal.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
} from './types';
1515
import { executeCommand } from '../common/vscodeApis/commandApis';
1616
import { IInterpreterPathService } from '../common/types';
17+
import { getConfiguration } from '../common/vscodeApis/workspaceApis';
1718

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

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

0 commit comments

Comments
 (0)