Skip to content

Commit f54ec47

Browse files
authored
feat: Add Listen for Xdebug to debug panel (#1096)
* Add Listen for Xdebug button to debug panel * Changelog
1 parent 8cb37be commit f54ec47

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [1.40.0]
8+
9+
- Add Listen for Xdebug to debug panel.
10+
711
## [1.39.1]
812

913
- Fix copy formatting on empty array.

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,9 @@
661661
{
662662
"command": "extension.php-debug.copyRaw",
663663
"title": "Copy Value as raw"
664+
},
665+
{
666+
"command": "extension.php-debug.listenForXdebug"
664667
}
665668
],
666669
"keybindings": [
@@ -674,6 +677,13 @@
674677
"key": "F11",
675678
"when": "!inDebugMode && activeViewlet == 'workbench.view.debug' && debugConfigurationType == 'php'"
676679
}
680+
],
681+
"viewsWelcome": [
682+
{
683+
"view": "debug",
684+
"contents": "[Listen for Xdebug](command:extension.php-debug.listenForXdebug)",
685+
"when": "debugStartLanguage == php"
686+
}
677687
]
678688
}
679689
}

src/extension.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,17 @@ export function activate(context: vscode.ExtensionContext) {
146146
})
147147
)
148148

149+
context.subscriptions.push(
150+
vscode.commands.registerCommand('extension.php-debug.listenForXdebug', async () => {
151+
await vscode.debug.startDebugging(undefined, {
152+
name: 'Listen for Xdebug',
153+
type: 'php',
154+
request: 'launch',
155+
port: 9003,
156+
})
157+
})
158+
)
159+
149160
/* This is coppied from vscode/src/vs/workbench/contrib/debug/browser/variablesView.ts */
150161
interface IVariablesContext {
151162
sessionId: string | undefined

0 commit comments

Comments
 (0)