-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Var-Dumper] Automatically add an hyperlink to the file in CliDumper #30830
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
Comments
ref #28395 now that files can be linked, the visual output will be shorter. And actually the same feature is available in web already. i agree having a file/line reference in CLI is handy. I've been searching my dumps() before 😅 |
@ro0NL i didn't see why this PR had been closed. |
It was closed because it would also cause a lot of extra output in situations where it was needed at all, as such having a detrimental effect on the debugging experience (more scrolling, less overview). I'd be open for another attempt, but it would need to have some way of determining when useful or not. |
@curry684, well so what about adding a function to get a list of placed dumps. 🤔 |
Make a reasonable proposal and it will be considered 👍 |
adding a clickable caret |
@nicolas-grekas you mean adding a caret which drops down the flle path and line in the terminal ? |
@nicolas-grekas is that what you were expected ? I've also open a PR to get more feedback : #31446 |
That seems pretty awesome actually, wasn't even aware this would be possible :) |
…herage) This PR was merged into the 4.4 branch. Discussion ---------- [VarDumper] Output the location of calls to dump() | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | not tested yet | Fixed tickets | #30830 | License | MIT | Doc PR | see #30830 Commits ------- f0a59d3 [VarDumper] Output the location of calls to dump()
Uh oh!
There was an error while loading. Please reload this page.
Description
During few days, i had to use the
dump()
function in order to debug failing unit test.In order to see where i placed dumps (and don't forget to remove them after the fix) i used to add the following argument to my dumps
dump(__FILE__.' l.'.__LINE__, $myVar)
.** Possible solution **
I made a POC which uses the
debug_backtrace
to get file and line and add those attributes to style which has effect to add a href in the console to the file. Ideally the final version would add a line like usingdump(__FILE__.' l.'.__LINE__, $myVar)
with this href.Example
master...ktherage:poc-var-dump
Gif preview of the POC

WDYT ?
The text was updated successfully, but these errors were encountered: