Skip to content

Commit

Permalink
Update extension name (#84)
Browse files Browse the repository at this point in the history
* Update package.json

* Fix readme

* update debug type name

* Fix tests

* Fix lint

* Fix test

* Update translations

* revert extension id

* Fix tests

* fix lint

* Update debug type name

* Fix translations and lint

* update debug type

* fix lint
  • Loading branch information
paulacamargo25 committed Oct 11, 2023
1 parent 5a42ab8 commit e09ccc4
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 110 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Debugpy extension for Visual Studio Code
# Python Debugger extension for Visual Studio Code

A [Visual Studio Code](https://code.visualstudio.com/) [extension](https://marketplace.visualstudio.com/VSCode) that supports Python debugging with debugpy. debugpy provides a seamless debugging experience by allowing you to set breakpoints, step through code, inspect variables, and perform other essential debugging tasks. The debugy extension offers debugging support for various types of Python applications including scripts, web applications, remote processes, and multi-threaded processes.
A [Visual Studio Code](https://code.visualstudio.com/) [extension](https://marketplace.visualstudio.com/VSCode) that supports Python debugging with debugpy. Python Debugger provides a seamless debugging experience by allowing you to set breakpoints, step through code, inspect variables, and perform other essential debugging tasks. The debugy extension offers debugging support for various types of Python applications including scripts, web applications, remote processes, and multi-threaded processes.

Note:
- The Python extension offers the debugpy extension as an optional installation, including it during the setup process.
- The Python extension offers the python debugger extension as an optional installation, including it during the setup process.
- This extension is supported for all [actively supported versions](https://devguide.python.org/#status-of-python-branches) of the Python language (i.e., Python >= 3.7).

## Usage

Once installed in Visual Studio Code, debugpy will be automatically activated when you open a Python file.
Once installed in Visual Studio Code, python-debugger will be automatically activated when you open a Python file.

## Disabling the Debugpy extension
If you want to disable the Debugpy extension, you can [disable this extension](https://code.visualstudio.com/docs/editor/extension-marketplace#_disable-an-extension) per workspace in Visual Studio Code.
## Disabling the Python Debugger extension
If you want to disable the Python Debugger extension, you can [disable this extension](https://code.visualstudio.com/docs/editor/extension-marketplace#_disable-an-extension) per workspace in Visual Studio Code.

## Commands

| Command | Description |
| ---------------------- | --------------------------------- |
| Debugpy: viewOutput | Show the debugpy extension output. |
| Debugpy: clearCacheAndReload | Allows you to clear the global values set in the extension. |
| Debugpy: debugInTerminal | Allows you to debug a simple Python file in the terminal. |
| Python Debugger: viewOutput | Show the Python Debugger Extension output. |
| Python Debugger: clearCacheAndReload | Allows you to clear the global values set in the extension. |
| Python Debugger: debugInTerminal | Allows you to debug a simple Python file in the terminal. |

## Data and telemetry
The Debubpy Extension for Visual Studio Code collects usage data and sends it to Microsoft to help improve our products and services. Read our [privacy statement](https://privacy.microsoft.com/privacystatement) to learn more. This extension respects the `telemetry.enableTelemetry` setting which you can learn more about at https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "debugpy",
"displayName": "Debugpy",
"displayName": "Python Debugger",
"description": "Python Debugger extension using `debugpy`.",
"version": "2023.3.0-dev",
"publisher": "ms-python",
Expand Down Expand Up @@ -39,18 +39,18 @@
"contributes": {
"commands": [
{
"category": "Debugpy",
"category": "Python Debugger",
"command": "debugpy.debugInTerminal",
"icon": "$(debug-alt)",
"title": "%debugpy.command.debugInTerminal.title%"
},
{
"category": "Debugpy",
"category": "Python Debugger",
"command": "debugpy.clearCacheAndReload",
"title": "%debugpy.command.clearCacheAndReload.title%"
},
{
"category": "Debugpy",
"category": "Python Debugger",
"command": "debugpy.viewOutput",
"icon": {
"dark": "resources/dark/repl.svg",
Expand All @@ -62,18 +62,18 @@
"menus": {
"commandPalette": [
{
"category": "Debugpy",
"category": "Python Debugger",
"command": "debugpy.clearCacheAndReload",
"title": "%debugpy.command.clearCacheAndReload.title%"
},
{
"category": "Debugpy",
"category": "Python Debugger",
"command": "debugpy.debugInTerminal",
"icon": "$(debug-alt)",
"title": "%debugpy.command.debugInTerminal.title%"
},
{
"category": "Debugpy",
"category": "Python Debugger",
"command": "debugpy.viewOutput",
"title": "%debugpy.command.viewOutput.title%"
}
Expand Down Expand Up @@ -434,7 +434,7 @@
}
},
"configurationSnippets": [],
"label": "Debugpy",
"label": "Python Debugger",
"languages": [
"python"
],
Expand Down
24 changes: 12 additions & 12 deletions src/extension/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export namespace DebugConfigStrings {
placeholder: l10n.t('Debug Configuration'),
};
export const launchJsonCompletions = {
label: l10n.t('Debugpy'),
description: l10n.t('Select a Debugpy debug configuration'),
label: l10n.t('Python Debugger'),
description: l10n.t('Select a Python Debugger debug configuration'),
};
export namespace file {
export const snippet = {
name: l10n.t('Debugpy: Current File'),
name: l10n.t('Python Debugger: Current File'),
};
export const selectConfiguration = {
label: l10n.t('Python File'),
Expand All @@ -33,7 +33,7 @@ export namespace DebugConfigStrings {
}
export namespace fileWithArgs {
export const snippet = {
name: l10n.t('Debugpy: Current File with Arguments'),
name: l10n.t('Python Debugger: Current File with Arguments'),
};
export const selectConfiguration = {
label: l10n.t('Python File with Arguments'),
Expand All @@ -42,7 +42,7 @@ export namespace DebugConfigStrings {
}
export namespace module {
export const snippet = {
name: l10n.t('Debugpy: Module'),
name: l10n.t('Python Debugger: Module'),
default: l10n.t('enter-your-module-name'),
};
export const selectConfiguration = {
Expand All @@ -58,7 +58,7 @@ export namespace DebugConfigStrings {
}
export namespace attach {
export const snippet = {
name: l10n.t('Debugpy: Remote Attach'),
name: l10n.t('Python Debugger: Remote Attach'),
};
export const selectConfiguration = {
label: l10n.t('Remote Attach'),
Expand All @@ -77,7 +77,7 @@ export namespace DebugConfigStrings {
}
export namespace attachPid {
export const snippet = {
name: l10n.t('Debugpy: Attach using Process Id'),
name: l10n.t('Python Debugger: Attach using Process Id'),
};
export const selectConfiguration = {
label: l10n.t('Attach using Process ID'),
Expand All @@ -86,7 +86,7 @@ export namespace DebugConfigStrings {
}
export namespace django {
export const snippet = {
name: l10n.t('Debugpy: Django'),
name: l10n.t('Python Debugger: Django'),
};
export const selectConfiguration = {
label: l10n.t('Django'),
Expand All @@ -102,7 +102,7 @@ export namespace DebugConfigStrings {
}
export namespace fastapi {
export const snippet = {
name: l10n.t('Debugpy: FastAPI'),
name: l10n.t('Python Debugger: FastAPI'),
};
export const selectConfiguration = {
label: l10n.t('FastAPI'),
Expand All @@ -116,21 +116,21 @@ export namespace DebugConfigStrings {
}
export namespace flask {
export const snippet = {
name: l10n.t('Debugpy: Flask'),
name: l10n.t('Python Debugger: Flask'),
};
export const selectConfiguration = {
label: l10n.t('Flask'),
description: l10n.t('Launch and debug a Flask web application'),
};
export const enterAppPathOrNamePath = {
title: l10n.t('Debug Flask'),
prompt: l10n.t('Debugpy: Flask'),
prompt: l10n.t('Python Debugger: Flask'),
invalid: l10n.t('Enter a valid name'),
};
}
export namespace pyramid {
export const snippet = {
name: l10n.t('Debugpy: Pyramid Application'),
name: l10n.t('Python Debugger: Pyramid Application'),
};
export const selectConfiguration = {
label: l10n.t('Pyramid'),
Expand Down
2 changes: 1 addition & 1 deletion src/extension/debugger/adapter/outdatedDebuggerPrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class OutdatedDebuggerPrompt implements DebugAdapterTracker {
if (eventMessage.event === 'output') {
const outputMessage = eventMessage as DebugProtocol.OutputEvent;
if (outputMessage.body.category === 'telemetry') {
// debugpy sends telemetry as both ptvsd and debugpy. This was done to help with
// Python Debugger sends telemetry as both ptvsd and debugpy. This was done to help with
// transition from ptvsd to debugpy while analyzing usage telemetry.
if (
outputMessage.body.output === 'ptvsd' &&
Expand Down
2 changes: 1 addition & 1 deletion src/extension/debugger/adapter/remoteLaunchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../../common/promiseUtils';
import { EXTENSION_ROOT_DIR } from '../../common/constants';
import { fileToCommandArgumentForPythonExt } from '../../common/stringUtils';

const pathToPythonLibDir = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python');
const pathToPythonLibDir = path.join(EXTENSION_ROOT_DIR, 'bundled', 'libs');
const pathToDebugger = path.join(pathToPythonLibDir, 'debugpy');

type RemoteDebugOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class DynamicPythonDebugConfigurationService implements IDynamicDebugConf
const providers = [];

providers.push({
name: 'Debugpy: Python File',
name: 'Python Debugger: Python File',
type: DebuggerTypeName,
request: 'launch',
program: '${file}',
Expand All @@ -33,7 +33,7 @@ export class DynamicPythonDebugConfigurationService implements IDynamicDebugConf
const djangoManagePath = await DynamicPythonDebugConfigurationService.getDjangoPath(folder);
if (djangoManagePath) {
providers.push({
name: 'Debugpy: Django',
name: 'Python Debugger: Django',
type: DebuggerTypeName,
request: 'launch',
program: `${workspaceFolderToken}${path.sep}${djangoManagePath}`,
Expand All @@ -46,7 +46,7 @@ export class DynamicPythonDebugConfigurationService implements IDynamicDebugConf
const flaskPath = await DynamicPythonDebugConfigurationService.getFlaskPath(folder);
if (flaskPath) {
providers.push({
name: 'Debugpy: Flask',
name: 'Python Debugger: Flask',
type: DebuggerTypeName,
request: 'launch',
module: 'flask',
Expand All @@ -64,7 +64,7 @@ export class DynamicPythonDebugConfigurationService implements IDynamicDebugConf
if (fastApiPath) {
fastApiPath = replaceAll(path.relative(folder.uri.fsPath, fastApiPath), path.sep, '.').replace('.py', '');
providers.push({
name: 'Debugpy: FastAPI',
name: 'Python Debugger: FastAPI',
type: DebuggerTypeName,
request: 'launch',
module: 'uvicorn',
Expand Down
4 changes: 2 additions & 2 deletions src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import { EventName } from './telemetry/constants';
// your extension is activated the very first time the command is executed
export async function activate(context: IExtensionContext): Promise<void> {
// Setup logging
const outputChannel = createOutputChannel('Debugpy');
const outputChannel = createOutputChannel('Python Debugger');
context.subscriptions.push(outputChannel, registerLogger(outputChannel));
context.subscriptions.push(registerCommand(Commands.ViewOutput, () => outputChannel.show()));

traceLog(`Name: Debugpy`);
traceLog(`Name: Python Debugger`);
traceLog(`Module: debugpy`);

try {
Expand Down
2 changes: 0 additions & 2 deletions src/extension/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ export enum EventName {
DEBUGGER_ATTACH_TO_LOCAL_PROCESS = 'DEBUGGER.ATTACH_TO_LOCAL_PROCESS',
DEBUGGER_CONFIGURATION_PROMPTS = 'DEBUGGER.CONFIGURATION.PROMPTS',
DEBUGGER_CONFIGURATION_PROMPTS_IN_LAUNCH_JSON = 'DEBUGGER.CONFIGURATION.PROMPTS.IN.LAUNCH.JSON',
DIAGNOSTICS_MESSAGE = 'DIAGNOSTICS.MESSAGE',
DIAGNOSTICS_ACTION = 'DIAGNOSTICS.ACTION',
ENVFILE_VARIABLE_SUBSTITUTION = 'ENVFILE_VARIABLE_SUBSTITUTION',
}
48 changes: 0 additions & 48 deletions src/extension/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,21 +384,6 @@ export interface IEventNamePropertyMapping {
*/
console?: ConsoleType;
};
// /**
// * Telemetry event sent when we are checking if we can handle the diagnostic code
// */
// /* __GDPR__
// "diagnostics.message" : {
// "code" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "karthiknadig" }
// }
// */
// [EventName.DIAGNOSTICS_MESSAGE]: {
// /**
// * Code of diagnostics message detected and displayed.
// * @type {string}
// */
// code: DiagnosticCodes;
// };
/**
* Telemetry captured when user code starts running after loading the debugger.
*/
Expand Down Expand Up @@ -655,39 +640,6 @@ export interface IEventNamePropertyMapping {
"debugger.configuration.prompts.in.launch.json" : { "owner": "paulacamargo25" }
*/
[EventName.DEBUGGER_CONFIGURATION_PROMPTS_IN_LAUNCH_JSON]: never | undefined;
/**
* Telemetry event sent with details of actions when invoking a diagnostic command
*/
/* __GDPR__
"diagnostics.action" : {
"commandname" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "karthiknadig" },
"ignorecode" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "karthiknadig" },
"url" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "karthiknadig" },
"action" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "karthiknadig" }
}
*/
[EventName.DIAGNOSTICS_ACTION]: {
/**
* Diagnostics command executed.
* @type {string}
*/
commandName?: string;
/**
* Diagnostisc code ignored (message will not be seen again).
* @type {string}
*/
ignoreCode?: string;
/**
* Url of web page launched in browser.
* @type {string}
*/
url?: string;
/**
* Custom actions performed.
* @type {'switchToCommandPrompt'}
*/
action?: 'switchToCommandPrompt';
};
/**
* Telemetry event sent when substituting Environment variables to calculate value of variables
*/
Expand Down
2 changes: 2 additions & 0 deletions src/test/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,5 @@ function getPythonPath(): string {
}

export interface IExtensionTestApi extends IExtensionApi {}

export const debuggerTypeName = 'debugpy';
2 changes: 1 addition & 1 deletion src/test/unittest/adapter/remoteLaunchers.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ suite('External debugpy Debugger Launcher', () => {
});

suite('Path To Debugger Package', () => {
const pathToPythonLibDir = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python');
const pathToPythonLibDir = path.join(EXTENSION_ROOT_DIR, 'bundled', 'libs');
test('Path to debugpy debugger package', () => {
const actual = launchers.getDebugpyPackagePath();
const expected = path.join(pathToPythonLibDir, 'debugpy');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ suite('Debugging - Configuration Provider File with Arguments', () => {
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
const state = { config: {}, folder };

await buildFileWithArgsLaunchDebugConfiguration(undefined as unknown as MultiStepInput<DebugConfigurationState>, state);
await buildFileWithArgsLaunchDebugConfiguration(
undefined as unknown as MultiStepInput<DebugConfigurationState>,
state,
);

const config = {
name: DebugConfigStrings.fileWithArgs.snippet.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { AttachRequestArguments, DebugOptions } from '../../../../extension/type
import { AttachConfigurationResolver } from '../../../../extension/debugger/configuration/resolvers/attach';
import * as vscodeapi from '../../../../extension/common/vscodeapi';
import * as platform from '../../../../extension/common/platform';
import { debuggerTypeName } from '../../../common';

getInfoPerOS().forEach(([osName, osType, path]) => {
if (osType === platform.OSType.Unknown) {
Expand Down Expand Up @@ -97,7 +98,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => {

const attach: Partial<AttachRequestArguments> = {
name: 'Python attach',
type: 'debugpy',
type: debuggerTypeName,
request: 'attach',
};

Expand Down
Loading

0 comments on commit e09ccc4

Please sign in to comment.