Skip to content

Commit 4de38ca

Browse files
authored
feat: add key binding to start debugging and stop on entry. (#724)
* Add key binding to start debugging and stop on entry. * Docs update.
1 parent aa3a05c commit 4de38ca

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
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.24.0]
8+
9+
- F10/F11 start debugging with stop on entry.
10+
711
## [1.23.0]
812

913
- When `env` is specified in launch configuration it will be merged the process environment.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Options specific to CLI debugging:
109109
- Function breakpoints
110110
- Step over, step in, step out
111111
- Break on entry
112+
- Start with Stop on entry (F10/F11)
112113
- Breaking on uncaught exceptions and errors / warnings / notices
113114
- Multiple, parallel requests
114115
- Stack traces, scope variables, superglobals, user defined constants
@@ -150,9 +151,10 @@ A _Xdebug helper_ browser extension is also recommended. There the request side
150151
- If you think you found a bug, [open an issue](https://github.com/xdebug/vscode-php-debug/issues)
151152
- Make sure you have the latest version of this extension and Xdebug installed
152153
- Try out a simple PHP file to recreate the issue, for example from the [testproject](https://github.com/xdebug/vscode-php-debug/tree/main/testproject)
153-
- In your php.ini, set [`xdebug.remote_log = /path/to/logfile`](https://xdebug.org/docs/remote#remote_log)
154+
- Set `"log": true` in your launch.json and observe Debug Console panel
155+
- In your php.ini, set [`xdebug.log = /path/to/logfile`](https://xdebug.org/docs/step_debug#troubleshoot)
154156
(make sure your webserver has write permissions to the file)
155-
- Set `"log": true` in your launch.json
157+
- Reach out on Twitter [@damjancvetko](https://twitter.com/damjancvetko)
156158

157159
## Contributing
158160

package.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@
144144
"main": "./out/extension.js",
145145
"activationEvents": [
146146
"onDebugResolve:php",
147-
"onCommand:php.debug.debugPhpFile"
147+
"onCommand:php.debug.debugPhpFile",
148+
"onCommand:php.debug.startWithStopOnEntry"
148149
],
149150
"capabilities": {
150151
"untrustedWorkspaces": {
@@ -489,6 +490,23 @@
489490
"title": "Debug PHP",
490491
"icon": "$(debug-alt-small)",
491492
"enablement": "resourceLangId == php"
493+
},
494+
{
495+
"command": "php.debug.startWithStopOnEntry",
496+
"title": "Start Debugging and Stop on Entry",
497+
"category": "Debug"
498+
}
499+
],
500+
"keybindings":[
501+
{
502+
"command": "php.debug.startWithStopOnEntry",
503+
"key": "F10",
504+
"when": "!inDebugMode && debugConfigurationType == 'php'"
505+
},
506+
{
507+
"command": "php.debug.startWithStopOnEntry",
508+
"key": "F11",
509+
"when": "!inDebugMode && debugConfigurationType == 'php'"
492510
}
493511
]
494512
}

src/extension.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,14 @@ export function activate(context: vscode.ExtensionContext) {
9696
vscode.debug.startDebugging(undefined, { type: '', name: '', request: '' })
9797
})
9898
)
99+
100+
context.subscriptions.push(
101+
vscode.commands.registerCommand('php.debug.startWithStopOnEntry', async (uri: vscode.Uri) => {
102+
vscode.commands.executeCommand('workbench.action.debug.start', {
103+
config: {
104+
stopOnEntry: true,
105+
},
106+
})
107+
})
108+
)
99109
}

0 commit comments

Comments
 (0)