Also keep in mind if you want
If you mean, they collapse because there is no data at the current location, but you would either
- like them to show "error" on each line (which won't work for an array, because it needs at least the length)
That causes an other issue.
Let's say "foo" is an array. And expanded. And if the array wasn't there, the IDE would even remember the last "length" so it could show "dummy error entries".
However any of the following could happen.
==> You step into something, that has a variable of the same name "foo", but different data.
* The array had the entries 100..110 shown. But it now (temporary) shrinks to 20 entries. Then it may no make sense to show error entries for 100..110.
And if "bounds are enforced" then that is not possible. (There is another topic on that)
* It was an array of structures in the caller, and now is an array of integer (or an array of array).
Then what about nested entries that used to be expanded?
- If the new array is "of integer" there is no expanded state. There is no way to have an integer expanded with dummy error entries.
Even restoring such expanding states later is tricky, because even if later there is an array that could expand those sub-items, it may not be the same as before.
- If the array changed to an "array of array" should it then keep the sub-arrays expanded, to match which sub-structure were expanded before?
* Similar, if "foo" is an array in the caller, but a structure in the callee => keep it expanded? (not sure it currently may even do that).
But it certainly becomes tricky which sub-items to re-expand when it changes back to an array (step out). Even if the previous set of indexes was remembered, is it still applicable, did the step out return to the array to which that applied (instead of step out, it could be "run to break")
I have to solve some of that anyway for locals... I have to see where I end up with that.