Skip to content

Commit 608e9e0

Browse files
committed
Updating Python settings references
1 parent c024a74 commit 608e9e0

File tree

1 file changed

+42
-34
lines changed

1 file changed

+42
-34
lines changed

docs/python/settings-reference.md

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,53 @@ For general information about working with settings in VS Code, refer to [User a
2020
| --- | --- | --- |
2121
| condaPath | `"conda"` | Path to the `conda` executable. |
2222
| defaultInterpreterPath | `"python"` | Path to the default Python interpreter to be used by the Python extension on the first time it loads for a workspace, or the path to a folder containing the Python interpreter. <br> Can use variables like `${workspaceFolder}` and `${workspaceFolder}/.venv`. <br> Using a path to a folder allows anyone working with a project to create an environment in the `.venv` folder as appropriate to their operating system, rather than having to specify an exact platform-dependent path. The `settings.json` file can then be included in a source code repository. <br> **Note**: Changes to this setting made after an interpreter has been selected for a workspace will not be applied or considered by the Python extension. The Python extension doesn't automatically add or change this setting.|
23-
| interpreter.infoVisibility | `"onPythonRelated"` | Controls when to display the selected interpreter information on the status bar. <br> By default, it only shows when there are Python related files open in the editor. <br> You can set it to `"always"` if you'd like it to always show on the status bar, or `"never"` to hide it entirely. |
24-
| pipenvPath | `"pipenv"` | Path to the pipenv executable to use for activation. |
25-
| venvFolders | `[]` | Paths to folders where virtual environments are created. <br> Depending on the virtualization tool used, it can be the project itself: `${workspaceFolder}`, or separate folders for all virtual environments located side by side: `.\envs`, `~/.virtualenvs`, and so on. |
2623
| envFile | `"${workspaceFolder}/`<br/>`.env"` | Absolute path to a file containing environment variable definitions. <br> See [Configuring Python environments - environment variable definitions file](/docs/python/environments.md#environment-variable-definitions-file). |
24+
| experiments.enabled | `true` | Enables [A/B experiments in the Python extension](https://aka.ms/AAjvt9q). If enabled, you may be provided with proposed enhancements and/or features. |
2725
| globalModuleInstallation | `false` | Specifies whether to install packages for the current user only using the `--user` command-line argument (the default), or to install for all users in the global environment (when set to `true`). Ignored when using a virtual environment. <br> For more information on the `--user` argument, see [pip - User Installs](https://pip.pypa.io/en/stable/user_guide/#user-installs). |
26+
| interpreter.infoVisibility | `"onPythonRelated"` | Controls when to display the selected interpreter information on the status bar. <br> By default, it only shows when there are Python related files open in the editor. <br> You can set it to `"always"` if you'd like it to always show on the status bar, or `"never"` to hide it entirely. |
27+
| pipenvPath | `"pipenv"` | Path to the pipenv executable to use for activation. |
2828
| poetryPath | `"poetry"` | Specifies the location of the [Poetry dependency manager](https://poetry.eustace.io/) executable, if installed. The default value `"poetry"` assumes the executable is in the current path. <br> The Python extension uses this setting to install packages when Poetry is available and there's a `poetry.lock` file in the workspace folder. |
29-
| terminal.launchArgs | `[]` | Launch arguments that are given to the Python interpreter when you run a file using commands such as **Python: Run Python File in Terminal**.<br> In the `launchArgs` list, each item is a top-level command-line element that's separated by a space (quoted values that contain spaces are a single top-level element and are thus one item in the list). <br> For example, for the arguments `--a --b --c {"value1" : 1, "value2" : 2}`, the list items should be `["--a", "--b", "--c", "{\"value1\" : 1, \"value2\" : 2}\""]`. <br> Note that VS Code ignores this setting when debugging because it instead uses arguments from your selected debugging configuration in `launch.json`. |
30-
| terminal.executeInFileDir | `false` | Indicates whether to run a file in the file's directory instead of the current folder. |
31-
| terminal.activateEnvironment | `true` | Indicates whether to automatically activate the environment you select using the **Python: Select Interpreter** command when a new terminal is created.<br> For example, when this setting is `true` and you select a virtual environment, the extension automatically runs the environment's *activate* command when creating a new terminal (`source env/bin/activate` on macOS/Linux; `env\scripts\activate` on Windows). |
29+
| REPL.enableREPLSmartSend | `true`| Specifies whether `Shift+Enter` leverage Smart Send. Smart Send looks at the code where the cursor is placed, sends the smallest runnable chunk of code to the Python REPL, and then places your cursor at the next line of code. |
3230
| terminal.activateEnvInCurrentTerminal | `false` | Specifies whether to activate the currently open terminal when the Python extension is activated, using the virtual environment selected. |
31+
| terminal.activateEnvironment | `true` | Indicates whether to automatically activate the environment you select using the **Python: Select Interpreter** command when a new terminal is created.<br> For example, when this setting is `true` and you select a virtual environment, the extension automatically runs the environment's *activate* command when creating a new terminal (`source env/bin/activate` on macOS/Linux; `env\scripts\activate` on Windows). |
32+
| terminal.executeInFileDir | `false` | Indicates whether to run a file in the file's directory instead of the current folder. |
3333
| terminal.focusAfterLaunch | `false` | Whether to switch the cursor focus to the terminal when launching a Python terminal. |
34-
| logging.level| `error` | Specifies the level of logging to be performed by the extension.<br> The possible levels of logging, in increasing level of information provided, are `off`, `error`, `warn`, `info`, and `debug`.<br> When set to `off`, which is not recommended, basic information will still be shown such as startup information and commands run by the Python extension.<br> At the `error` level, basic information and errors will be shown.<br> At the `warn` level, basic, error, and warning information will be shown. At the `info` level, basic, error, warning, and additional information like method execution times and return values will be shown. At this time, the `debug` level doesn't display additional information. |
35-
| experiments.enabled | `true` | Enables [A/B experiments in the Python extension](https://aka.ms/AAjvt9q). If enabled, you may be provided with proposed enhancements and/or features. |
34+
| terminal.launchArgs | `[]` | Launch arguments that are given to the Python interpreter when you run a file using commands such as **Python: Run Python File in Terminal**.<br> In the `launchArgs` list, each item is a top-level command-line element that's separated by a space (quoted values that contain spaces are a single top-level element and are thus one item in the list). <br> For example, for the arguments `--a --b --c {"value1" : 1, "value2" : 2}`, the list items should be `["--a", "--b", "--c", "{\"value1\" : 1, \"value2\" : 2}\""]`. <br> Note that VS Code ignores this setting when debugging because it instead uses arguments from your selected debugging configuration in `launch.json`. |
35+
| venvFolders | `[]` | Paths to folders where virtual environments are created. <br> Depending on the virtualization tool used, it can be the project itself: `${workspaceFolder}`, or separate folders for all virtual environments located side by side: `.\envs`, `~/.virtualenvs`, and so on. |
36+
37+
## Debugger Settings
38+
39+
### General debugging
40+
41+
| Setting<br/>(python.debugpy.) | Default | Description | See also |
42+
| --- | --- | --- | --- |
43+
| debugJustMyCode | `true` | Specifies whether the debugger should only step through user-written code. Disabling allows you to step through library code as well. | [Debugging](/docs/python/debugging.md) |
44+
45+
## Testing settings
46+
47+
### General testing
48+
49+
| Setting<br/>(python.testing.) | Default | Description | See also |
50+
| --- | --- | --- | --- |
51+
| autoTestDiscoverOnSaveEnabled | `true` | Specifies whether to enable or disable auto run test discovery when saving a test file. | [Testing](/docs/python/testing.md) |
52+
| cwd | null | Specifies an optional working directory for tests. | [Testing](/docs/python/testing.md) |
53+
| debugPort | `3000` | Port number used for debugging of unittest tests. | [Testing](/docs/python/testing.md) |
54+
| promptToConfigure | `true` | Specifies whether VS Code prompts to configure a test framework if potential tests are discovered. | [Testing](/docs/python/testing.md) |
55+
56+
### unittest framework
57+
58+
| Setting<br/>(python.testing.) | Default | Description | See also |
59+
| --- | --- | --- | --- |
60+
| unittestArgs | `["-v", "-s", ".", "-p", "*test*.py"]` | Arguments to pass to unittest, where each top-level element that's separated by a space is a separate item in the list. | [Testing](/docs/python/testing.md) |
61+
| unittestEnabled | `false` | Specifies whether unittest is enabled for testing. | [Testing](/docs/python/testing.md) |
62+
63+
### pytest framework
64+
65+
| Setting<br/>(python.testing.) | Default | Description | See also |
66+
| --- | --- | --- | --- |
67+
| pytestArgs | `[]` | Arguments to pass to pytest, where each top-level element that's separated by a space is a separate item in the list. When debugging tests with pytest-cov installed, include `--no-cov` in these arguments. | [Testing](/docs/python/testing.md) |
68+
| pytestEnabled | `false` | Specifies whether pytest is enabled for testing. | [Testing](/docs/python/testing.md) |
69+
| pytestPath | `"pytest"` | Path to pytest. Use a full path if pytest is located outside the current environment. | [Testing](/docs/python/testing.md) |
3670

3771
## Code analysis settings
3872

@@ -149,32 +183,6 @@ This section details all the available rules that can be customized using the `p
149183
| --- | --- | --- | --- |
150184
| extraPaths | `[]` | Specifies locations of additional packages for which to load autocomplete data. | [Editing](/docs/python/editing.md#autocomplete-and-intellisense) |
151185

152-
## Testing settings
153-
154-
### General testing
155-
156-
| Setting<br/>(python.testing.) | Default | Description | See also |
157-
| --- | --- | --- | --- |
158-
| cwd | null | Specifies an optional working directory for tests. | [Testing](/docs/python/testing.md) |
159-
| promptToConfigure | `true` | Specifies whether VS Code prompts to configure a test framework if potential tests are discovered. | [Testing](/docs/python/testing.md) |
160-
| debugPort | `3000` | Port number used for debugging of unittest tests. | [Testing](/docs/python/testing.md) |
161-
autoTestDiscoverOnSaveEnabled | `true` | Specifies whether to enable or disable auto run test discovery when saving a test file. | [Testing](/docs/python/testing.md) |
162-
163-
### unittest framework
164-
165-
| Setting<br/>(python.testing.) | Default | Description | See also |
166-
| --- | --- | --- | --- |
167-
| unittestEnabled | `false` | Specifies whether unittest is enabled for testing. | [Testing](/docs/python/testing.md) |
168-
| unittestArgs | `["-v", "-s", ".", "-p", "*test*.py"]` | Arguments to pass to unittest, where each top-level element that's separated by a space is a separate item in the list. | [Testing](/docs/python/testing.md) |
169-
170-
### pytest framework
171-
172-
| Setting<br/>(python.testing.) | Default | Description | See also |
173-
| --- | --- | --- | --- |
174-
| pytestEnabled | `false` | Specifies whether pytest is enabled for testing. | [Testing](/docs/python/testing.md) |
175-
| pytestPath | `"pytest"` | Path to pytest. Use a full path if pytest is located outside the current environment. | [Testing](/docs/python/testing.md) |
176-
| pytestArgs | `[]` | Arguments to pass to pytest, where each top-level element that's separated by a space is a separate item in the list. When debugging tests with pytest-cov installed, include `--no-cov` in these arguments. | [Testing](/docs/python/testing.md) |
177-
178186
## Predefined variables
179187

180188
The Python extension settings support predefined variables. Similar to the general VS Code settings, variables use the **${variableName}** syntax. Specifically, the extension supports the following variables:

0 commit comments

Comments
 (0)