Skip to content

Commit 26929d8

Browse files
Nikola HristovNikola Hristov
authored andcommitted
2 parents 2a9e203 + 6afaa10 commit 26929d8

File tree

7 files changed

+738
-2
lines changed

7 files changed

+738
-2
lines changed

Source/extension/noConfigDebugInit.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import {
1414
} from 'vscode';
1515
import { createFileSystemWatcher, debugStartDebugging } from './utils';
1616
import { traceError, traceVerbose } from './common/log/logging';
17+
import { sendTelemetryEvent } from './telemetry';
18+
import { EventName } from './telemetry/constants';
1719

1820
/**
1921
* Registers the configuration-less debugging setup for the extension.
@@ -67,8 +69,8 @@ export async function registerNoConfigDebug(
6769
// Add env var for PYDEVD_DISABLE_FILE_VALIDATION to disable extra output in terminal when starting the debug session.
6870
collection.replace('PYDEVD_DISABLE_FILE_VALIDATION', '1');
6971

70-
// Add env vars for DEBUGPY_ADAPTER_ENDPOINTS, BUNDLED_DEBUGPY_PATH, and PATH
71-
collection.replace('DEBUGPY_ADAPTER_ENDPOINTS', tempFilePath);
72+
// Add env vars for VSCODE_DEBUGPY_ADAPTER_ENDPOINTS, BUNDLED_DEBUGPY_PATH, and PATH
73+
collection.replace('VSCODE_DEBUGPY_ADAPTER_ENDPOINTS', tempFilePath);
7274

7375
const noConfigScriptsDir = path.join(extPath, 'bundled', 'scripts', 'noConfigScripts');
7476
const pathSeparator = process.platform === 'win32' ? ';' : ':';
@@ -84,6 +86,7 @@ export async function registerNoConfigDebug(
8486
// create file system watcher for the debuggerAdapterEndpointFolder for when the communication port is written
8587
const fileSystemWatcher = createFileSystemWatcher(new RelativePattern(tempDirPath, '**/*'));
8688
const fileCreationEvent = fileSystemWatcher.onDidCreate(async (uri) => {
89+
sendTelemetryEvent(EventName.DEBUGGER_NO_CONFIG_DEBUGGING);
8790
const filePath = uri.fsPath;
8891
fs.readFile(filePath, (err, data) => {
8992
const dataParse = data.toString();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#! /bin/bash
22
# Bash script
3+
export DEBUGPY_ADAPTER_ENDPOINTS=$VSCODE_DEBUGPY_ADAPTER_ENDPOINTS
34
python3 $BUNDLED_DEBUGPY_PATH --listen 0 --wait-for-client $@
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
@echo off
22
:: Bat script
3+
set DEBUGPY_ADAPTER_ENDPOINTS=%VSCODE_DEBUGPY_ADAPTER_ENDPOINTS%
34
python %BUNDLED_DEBUGPY_PATH% --listen 0 --wait-for-client %*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Fish script
2+
set -x DEBUGPY_ADAPTER_ENDPOINTS $VSCODE_DEBUGPY_ADAPTER_ENDPOINTS
23
python3 $BUNDLED_DEBUGPY_PATH --listen 0 --wait-for-client $argv

bundled/scripts/noConfigScripts/debugpy.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# PowerShell script
2+
$env:DEBUGPY_ADAPTER_ENDPOINTS = $env:VSCODE_DEBUGPY_ADAPTER_ENDPOINTS
23
$os = [System.Environment]::OSVersion.Platform
34
if ($os -eq [System.PlatformID]::Win32NT) {
45
python $env:BUNDLED_DEBUGPY_PATH --listen 0 --wait-for-client $args
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
// Licensed under the MIT License.
4+
5+
'use strict';
6+
7+
export enum EventName {
8+
DEBUG_SUCCESS_ACTIVATION = 'DEBUG.SUCCESS_ACTIVATION',
9+
DEBUG_IN_TERMINAL_BUTTON = 'DEBUG.IN_TERMINAL',
10+
DEBUG_USING_LAUNCH_CONFIG_BUTTON = 'DEBUG.USING_LAUNCH_CONFIG',
11+
DEBUG_ADAPTER_USING_WHEELS_PATH = 'DEBUG_ADAPTER.USING_WHEELS_PATH',
12+
DEBUG_SESSION_ERROR = 'DEBUG_SESSION.ERROR',
13+
DEBUG_SESSION_START = 'DEBUG_SESSION.START',
14+
DEBUG_SESSION_STOP = 'DEBUG_SESSION.STOP',
15+
DEBUG_SESSION_USER_CODE_RUNNING = 'DEBUG_SESSION.USER_CODE_RUNNING',
16+
DEBUG_SHOW_INLINE_HEX_VALUE = 'DEBUG.SHOW_INLINE_HEX_VALUE',
17+
DEBUGGER = 'DEBUGGER',
18+
DEBUGGER_ATTACH_TO_CHILD_PROCESS = 'DEBUGGER.ATTACH_TO_CHILD_PROCESS',
19+
DEBUGGER_ATTACH_TO_LOCAL_PROCESS = 'DEBUGGER.ATTACH_TO_LOCAL_PROCESS',
20+
DEBUGGER_CONFIGURATION_PROMPTS = 'DEBUGGER.CONFIGURATION.PROMPTS',
21+
DEBUGGER_CONFIGURATION_PROMPTS_IN_LAUNCH_JSON = 'DEBUGGER.CONFIGURATION.PROMPTS.IN.LAUNCH.JSON',
22+
DEBUGGER_DYNAMIC_CONFIGURATION = 'DEBUGGER.DYNAMIC_CONFIGURATION',
23+
ENVFILE_VARIABLE_SUBSTITUTION = 'ENVFILE_VARIABLE_SUBSTITUTION',
24+
USE_REPORT_ISSUE_COMMAND = 'USE_REPORT_ISSUE_COMMAND',
25+
DEBUGGER_PYTHON_37_DEPRECATED = 'DEBUGGER_PYTHON_37_DEPRECATED',
26+
DEBUGGER_SHOW_PYTHON_INLINE_VALUES = 'DEBUGGER_SHOW_PYTHON_INLINE_VALUES',
27+
DEBUGGER_NO_CONFIG_DEBUGGING = 'DEBUGGER_NO_CONFIG_DEBUGGING',
28+
}

0 commit comments

Comments
 (0)