-
Notifications
You must be signed in to change notification settings - Fork 327
[XDebug Bridge] Exclude file and directory paths from devtools stack and debugging #2423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
I will need to add tests before making it ready for review. |
I added tests based on the tests from pull request #2409. |
There's a few conflicts to resolve and the implementation section of the description is missing (a sentence or two should suffice here) but other than that it LGTM. Let's fix those and merge – thank you @mho22! |
}, | ||
}); | ||
if (this.isExcludedPath(fileUri)) { | ||
this.sendDbgpCommand('step_over'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The excluded file could call a function defined in a non-excluded file. Would step_over
ignore the entire call and never step into that other file? This isn't relevant for breaking on the first line but it is relevant for calls made by Playground-level mu-plugins, e.g. the SQLite integration plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oho. I guess it will ignore the file. It should also check the command. If the command is step_into
then, don't ignore the file. I'll need to test that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I didn't understand your sentence correctly a few days ago! The excluded file won't be "loaded" by Devtools but its code will be run as expected. So if an excluded file is running a function from a non excluded file it will pause the script on the first line of the non-excluded file.
The opposite will happen though. If you run a script that calls another one that has an excluded path, you won't see anything from that excluded path script. That is why I understood with my last comment.
That is why I should let the current code change but I should add a second condition in the if statement indicating that if the current command is step_into
and the file has an excluded path we should not step_over
and show the script.
I am adding a new test for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Motivation for the change, related issues
Based on this comment and pull request.
In Playground CLI, the first line where Xdebug stops in Devtools is the
auto_prepend_file.php
file located in theinternal
directory. This pull request aims to ignore what's in the directory by adding aexcludedPaths
option in the bridge that will be ignored when stacking or stepping.Implementation details
Added an
excludedPath
option to thestartBridge
function. When specified,XdebugCDPBridge
will check this option, and the DevTools willstep_over
any file matching the excluded path, skipping its parsing.Testing Instructions
With script
cli.ts
:Run command :
Before
After