Sort Object properties in Variables view
PHP version: 5.5.9 XDebug version: 2.4.0 Adapter version: 1.9.1
is it possible to sort object properties alphabetically?

I just send them to VS Code in the same order I get them from XDebug. XDebug sorts them like they are defined I think, and doesn't distinguish between object properties and variables. So I don't know if it woud be good to change this.
Well in my code $base is defined before $anagrafica so I think XDebug sorts the first level.
I think it would be more user friendly to have variable sorted
it would definitelly be good to change order of properties. It is annoyting when you cannot find property because of no sort order. If for somebody it is useful tha they are not sorted, then you could let user itself to choose if he wants to sort or not. Its not the firtst time that I cannot find. And then I have to add additional watch like $object->getProperty() to see its value !
The context variables (Locals, Superglobals...) are sorted, but keys in an array are not. And I would not change this as the order might be important. Perhaps we could do this with classes/objects, but even there I'd rather not introduce behavior different from native PHP.
And there is a type/search function in VS Code now, so finding something you are looking for should be better.
I think this is needed, at least sorting variables and object properties. Keys in arrays can be more problematic. VS code type/search is not comfortable enough to use constantly, time and time again
Moreover, in IDEs like PHPStorm there is a setting that can enable sorting properties alphabetically while in debug mode, and it's a major enhancement when working say with entities that have 100+ properties.
The context variables (Locals, Superglobals...) are sorted, but keys in an array are not. And I would not change this as the order might be important.
What are the criteria for the default order ? If no one knows, that might not be as important ?
Maybe order could become an option ?
In PHPStorm it seems it is. And the alphabetical order might be the default as I don't recall the need to modify the option when I was using this IDE ?
And there is a type/search function in VS Code now
I tried to focus the variable window and type something, and indeed that brings focus to the occurrence. Typing again seems to focus on the next one. So yes this is indeed a workaround, but :
- not easy to find,
- and also not as convenient as the alphabetical order as for objects you generally want to check multiple attributes values
I'll revisit this as an option...
I'll revisit this as an option...
Many thanks !