You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the user does not specify an event name or properties, pick an informative and descriptive name for the telemetry event based on the task or feature. Add properties as you see fit to collect the necessary information to achieve the telemetry goal, ensuring they are relevant and useful for diagnostics or analytics.
6
+
7
+
When adding telemetry:
8
+
9
+
- If the user wants to record when an action is started (such as a command invocation), place the telemetry call at the start of the handler or function.
10
+
- If the user wants to record successful completions or outcomes, place the telemetry call at the end of the action, after the operation has succeeded (and optionally, record errors or failures as well).
11
+
12
+
Instructions to add a new telemetry event:
13
+
14
+
1. Add a new event name to the `EventNames` enum in `src/common/telemetry/constants.ts`.
15
+
2. Add a corresponding entry to the `IEventNamePropertyMapping` interface in the same file, including a GDPR comment and the expected properties.
16
+
3. In the relevant code location, call `sendTelemetryEvent` with the new event name and required properties. Example:
17
+
```typescript
18
+
sendTelemetryEvent(EventNames.YOUR_EVENT_NAME, undefined, { property: value });
Copy file name to clipboardExpand all lines: README.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Python Environments (experimental)
1
+
# Python Environments (preview)
2
2
3
3
## Overview
4
4
@@ -62,22 +62,32 @@ A "Python Project" is any file or folder that contains runnable Python code and
62
62
63
63
Projects can be added via the Python Environments pane or in the File Explorer by right-clicking on the folder/file and selecting the "Add as Python Project" menu item.
64
64
65
-
There are a couple of ways that you can add a Python Project from the Python Environments panel:
65
+
There are a few ways to add a Python Project from the Python Environments panel:
| Add Existing | Allows you to add an existing folder from the file explorer. |
70
70
| Auto find | Searches for folders that contain `pyproject.toml` or `setup.py` files |
71
+
| Create New | Creates a new project from a template. |
72
+
73
+
#### Create New Project from Template
74
+
The **Python Envs: Create New Project from Template** command simplifies the process of starting a new Python project by scaffolding it for you. Whether in a new workspace or an existing one, this command configures the environment and boilerplate file structure, so you don’t have to worry about the initial setup, and only the code you want to write. There are currently two project types supported:
75
+
76
+
- Package: A structured Python package with files like `__init__.py` and setup configurations.
77
+
- Script: A simple project for standalone Python scripts, ideal for quick tasks or just to get you started.
71
78
72
79
## Command Reference
73
80
81
+
All commands can be accessed via the Command Palette (`ctrl/cmd + Shift + P`):
| Python: Create Environment | Create a virtual environment using your preferred environment manager preconfigured with "Quick Create" or configured to your choices. |
77
-
| Python: Manage Packages | Install and uninstall packages in a given Python environment. |
78
-
| Python: Activate Environment in Current Terminal | Activates the currently opened terminal with a particular environment. |
79
-
| Python: Deactivate Environment in Current Terminal | Deactivates environment in currently opened terminal. |
80
-
| Python: Run as Task | Runs Python module as a task. |
85
+
| Create Environment | Create a virtual environment using your preferred environment manager preconfigured with "Quick Create" or configured to your choices. |
86
+
| Manage Packages | Install and uninstall packages in a given Python environment. |
87
+
| Activate Environment in Current Terminal | Activates the currently opened terminal with a particular environment. |
88
+
| Deactivate Environment in Current Terminal | Deactivates environment in currently opened terminal. |
89
+
| Run as Task | Runs Python module as a task. |
90
+
| Create New Project from Template | Creates scaffolded project with virtual environments based on a template. |
* Creates a new Python environment within the specified scope.
382
+
* Creates a new Python environment within the specified scope. Create should support adding a .gitignore file if it creates a folder within the workspace.
383
383
* @param scope - The scope within which to create the environment.
384
384
* @param options - Optional parameters for creating the Python environment.
385
385
* @returns A promise that resolves to the created Python environment, or undefined if creation failed.
0 commit comments