Skip to content

Commit ef6171e

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

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
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.",
4141
"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.",
42+
"python.useEnvironmentsExtension.description": "Enables the Python Environments extension.",
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.",
4445
"python.experiments.All.description": "Combined list of all experiments.",
@@ -91,7 +92,7 @@
9192
"python.venvPath.description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs).",
9293
"walkthrough.pythonWelcome.title": "Get Started with Python Development",
9394
"walkthrough.pythonWelcome.description": "Your first steps to set up a Python project with all the powerful tools and features that the Python extension has to offer!",
94-
"walkthrough.step.python.createPythonFile.title": "Create a Python file",
95+
"walkthrough.step.python.createPythonFile.title": "Create a Python file",
9596
"walkthrough.step.python.createPythonFolder.title": "Open a Python project folder",
9697
"walkthrough.step.python.createPythonFile.description": {
9798
"message": "[Open](command:toSide:workbench.action.files.openFile) or [create](command:toSide:workbench.action.files.newUntitledFile?%7B%22languageId%22%3A%22python%22%7D) a Python file - make sure to save it as \".py\".\n[Create Python File](command:toSide:workbench.action.files.newUntitledFile?%7B%22languageId%22%3A%22python%22%7D)",
@@ -103,7 +104,7 @@
103104
},
104105
"walkthrough.step.python.createPythonFolder.description": {
105106
"message": "[Open](command:workbench.action.files.openFolder) or create a project folder.\n[Open Project Folder](command:workbench.action.files.openFolder)",
106-
"comment": [
107+
"comment": [
107108
"{Locked='](command:workbench.action.files.openFolder'}",
108109
"Do not translate the 'command:*' part inside of the '(..)'. It is an internal command syntax for VS Code",
109110
"Please make sure there is no space between the right bracket and left parenthesis: ]( this is an internal syntax for links"
@@ -133,7 +134,7 @@
133134
"walkthrough.step.python.createEnvironment.title": "Select or create a Python environment",
134135
"walkthrough.step.python.createEnvironment.description": {
135136
"message": "Create an environment for your Python project or use [Select Python Interpreter](command:python.setInterpreter) to select an existing one.\n[Create Environment](command:python.createEnvironment)\n**Tip**: Run the ``Python: Create Environment`` command in the [Command Palette](command:workbench.action.showCommands).",
136-
"comment": [
137+
"comment": [
137138
"{Locked='](command:python.createEnvironment'}",
138139
"{Locked='](command:workbench.action.showCommands'}",
139140
"{Locked='](command:python.setInterpreter'}",
@@ -145,8 +146,8 @@
145146
"walkthrough.step.python.runAndDebug.description": "Open your Python file and click on the play button on the top right of the editor, or press F5 when on the file and select \"Python File\" to run with the debugger. \n \n[Learn more](https://code.visualstudio.com/docs/python/python-tutorial#_run-hello-world)",
146147
"walkthrough.step.python.learnMoreWithDS.title": "Keep exploring!",
147148
"walkthrough.step.python.learnMoreWithDS.description": {
148-
"message":"🎨 Explore all the features the Python extension has to offer by looking for \"Python\" in the [Command Palette](command:workbench.action.showCommands). \n 📈 Learn more about getting started with [data science](command:workbench.action.openWalkthrough?%7B%22category%22%3A%22ms-python.python%23pythonDataScienceWelcome%22%2C%22step%22%3A%22ms-python.python%23python.createNewNotebook%22%7D) in Python. \n ✨ Take a look at our [Release Notes](https://aka.ms/AA8dxtb) to learn more about the latest features. \n \n[Follow along with the Python Tutorial](https://aka.ms/AA8dqti)",
149-
"comment":[
149+
"message": "🎨 Explore all the features the Python extension has to offer by looking for \"Python\" in the [Command Palette](command:workbench.action.showCommands). \n 📈 Learn more about getting started with [data science](command:workbench.action.openWalkthrough?%7B%22category%22%3A%22ms-python.python%23pythonDataScienceWelcome%22%2C%22step%22%3A%22ms-python.python%23python.createNewNotebook%22%7D) in Python. \n ✨ Take a look at our [Release Notes](https://aka.ms/AA8dxtb) to learn more about the latest features. \n \n[Follow along with the Python Tutorial](https://aka.ms/AA8dqti)",
150+
"comment": [
150151
"{Locked='](command:workbench.action.showCommands'}",
151152
"{Locked='](command:workbench.action.openWalkthrough?%7B%22category%22%3A%22ms-python.python%23pythonDataScienceWelcome%22%2C%22step%22%3A%22ms-python.python%23python.createNewNotebook%22%7D'}",
152153
"Do not translate the 'command:*' part inside of the '(..)'. It is an internal command syntax for VS Code",

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)