-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Recently updated VS Code + PHP XDebug - Disable 'auto expand data' arrays/objects #755
Comments
Hi Thanks for the report. I'm looking into it and I think I already found something... I'll let you know if I need more info. |
Thank you @zobo, good luck in finding the issue! EDIT: You must have replied exactly when I posted. Sure will try that quickly |
@zobo A quick installation of Comparing Image 1 above (showing |
Ok. I am pushing out a fix. I have to run right now, but will come back soon and explain the problem in more detail. |
Wow thanks so much for the quick update! Talk to you later when are available. |
I can confirm that the new version |
Ok, a "post mortem". The problem was introduced in the last two versions (released more or less at the same time) while trying to solve traversal of property structure with extended fields. Here is the structure. If you look at the code change here I replaced So what I can see in you screenshots is that the whole tree of properties was flattened up on the first level. Since you also had Thanks for reporting. |
Again, thank you very much for the quick updates and fix, all I did was report the problem! I was just extremely confused yesterday when I got so many values (flattened as you mentioned), and even thought I created a huge bug to 'duplicate' objects with recent changes I applied. After that, I tried to figure out if any new variables were introduced, but couldn't find any. I usually go |
You could also leave it at |
Verified that v1.24.3 is absolutely beautiful (again) :) Thank you SOOOO much for handling this so quickly - in this great FOSS world sometimes we need to wait for months or years for irritations like this to go away. Not this time. And our coding now continues... |
@zobo For doing this for
And then use the |
This test case shows how it works in more detail: |
Ugh.. I did not think of this hack... However I would much rather have Xdebug have a local copy of evaled zval until a step operation happens... I'll try to find time to test an implementation... Thanks! |
NOTE: I originally applied this on stackoverflow, and as requested by zobo
Please see at the end (screenshots/info) for more information that I added additionally here
I also believe that the following is 'related' in some way (crashes/slow performance for hover): While debugging, hover tooltip takes 3 seconds to show, as although I do not get 'slow hover', I get 'huge object output, which might cause VS Code to crash
A recent update (not sure which, I updated yesterday since cancelling updates since end last year) of Visual Studio Code changed behavior of PHP Debug from XDebug (or even with PHP Tools extension from DEVSENSE) now has this 'auto-expand-data' feature, where arrays and objects now shows their values inline of the array/object, which in the case of Magento 2 makes debugging extremely cumbersome now.
**I should have just not upgraded!!!
The VS Code would crash more often now when large objects are displayed, because it now wants to auto-expand every single private variable for a Magento 2 object as well
Since the extended feature 'auto-expands' variable values, it is not really clear anymore which are private/protected/public values any more.
Which recent settings are added, and how do we disable this?
Example
New:
Old:
Clearly the 'old way' (before updating VS Code today) is more concise and easier to read, I am giving an array example, since Magento 2 object would just cause VS Code to crash (so can't show an exact example).
I don't need this feature, and would rather just want to access and view values as I need them from functions/variables:
For instance, when I would get $this->getCollection() from terminal now, I would get 1000s of unneeded values (private things expanded).
In debug terminal
How can I disable this feature?
Additional information
TonyG mentioned this in the comments as well, which I forgot to mention (as I just gave information on terminal command view), but this also happens to me.
VS Code version:
PHP Debug (Xdebug)
v1.24.2
XDebug on Server: (Ubuntu 20.04)
Screenshots & Extra Code samples
For more information:
show_hidden 1 or 0
does not change the output, I just wanted to confirm if this is perhaps the output that changed (I do not know all the xDebugSettings variables!).$this
Discussed here in the screenshots is of typeMagento\LayeredNavigation\Block\Navigation
Image 1
Things of note here:
Image 2
$this
at line 299. Same type as the hover image.Things of note here:
Image 3
$this
object, but scrolling down, partially showing_underscoreCache
and then showing_catalogLayer
and then_underscoreCache
Things of note here:
Image 4
$this
alot downwards, andfactories
isarray(7)
, and the array entities are auto expanded showing the object types (7 items).Image 5
$this
, further downwards, showingfilterTypes (array(4))
expanded, same for `filters (array(32))Summary
The recent changes (with some visual improvements - for instance Tree-like indented output would be extremely useful for smaller objects to auto-show their array contents. I think if it is indented more, it should be easier to see which 'level' you are on.
However, for overly large objects (like most Magento 2 objects are...), this auto-expanded feature makes it extremely hard to find the information you need..... scrolling through 1000+ lines for the same object, and hoping it does not crash VS Code.
The text was updated successfully, but these errors were encountered: