diff --git a/CHANGELOG.md b/CHANGELOG.md index 00b8c1d4..da49e418 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.40.0] + +- Add Listen for Xdebug to debug panel. + ## [1.39.1] - Fix copy formatting on empty array. diff --git a/package.json b/package.json index 6611a383..5e68fce6 100644 --- a/package.json +++ b/package.json @@ -661,6 +661,9 @@ { "command": "extension.php-debug.copyRaw", "title": "Copy Value as raw" + }, + { + "command": "extension.php-debug.listenForXdebug" } ], "keybindings": [ @@ -674,6 +677,13 @@ "key": "F11", "when": "!inDebugMode && activeViewlet == 'workbench.view.debug' && debugConfigurationType == 'php'" } + ], + "viewsWelcome": [ + { + "view": "debug", + "contents": "[Listen for Xdebug](command:extension.php-debug.listenForXdebug)", + "when": "debugStartLanguage == php" + } ] } } diff --git a/src/extension.ts b/src/extension.ts index 0694ee0f..1e8f44a4 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -146,6 +146,17 @@ export function activate(context: vscode.ExtensionContext) { }) ) + context.subscriptions.push( + vscode.commands.registerCommand('extension.php-debug.listenForXdebug', async () => { + await vscode.debug.startDebugging(undefined, { + name: 'Listen for Xdebug', + type: 'php', + request: 'launch', + port: 9003, + }) + }) + ) + /* This is coppied from vscode/src/vs/workbench/contrib/debug/browser/variablesView.ts */ interface IVariablesContext { sessionId: string | undefined