You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cannot view contents of Map<DateTime, List> while debugging #2146
I have a structure defined as Map<DateTime, List> , each element of List is also a map. During debugging I cannot view the data in the List maps. Expanding each list element shows only its meta data values (_checkSum, _data, _deletedKeys, _hashMask, _index etc...) not the map key/values. This makes debugging very difficult.
@devoncarew@pq Is there a way to get a log of the VM service traffic from Android Studio? This same code seems to work fine there, but in VS Code we get an object with kind="PlainInstance" and not kind="Map" so I want to figure out what we're doing differently.
@DanTup: do you have the Android Studio plugin running from source? I think you'd have to add print statements to the VmServiceManager (IIRC or similar). I'm not in front of the source now but happy to help instrument if you want to spelunk.
do you have the Android Studio plugin running from source?
I don't. Is it simple to set up? (I've never built any java in my life :-))
Or if it's simpler - if I paste the Dart code in here, could you easily run it and capture the VM service traffic?
Failing that - can you point me at the code that is fetching the values for this tree? I'll see if I can see any obvious differences with what you're doing there and I'm doing here. Thanks!
If you breakpojnt on the print and expand through mapOfListOfMaps2 to reveal values inside the leaf map (1:1, 2:2) capturing the VM service traffic, that should help my figure out what I'm doing differently.
(if it's not already possible, maybe there's value in having a way to write logs easily for end users? I'm often wishing I could get logs from Android Studio, and the logs from VS Code come in handy debugging user issues all the time!)
Ok, I finally managed to track this down! It was a silly mistake on my part..
Against the values we track an "evaluateName" (this is a string that evaluates to the value shown, which can be used for "Add Watch", etc.). This only works when the key is a simple type (eg. we can add a watch expression for myMap[1] but not for myMap[someComplexType]).
When fixing up for TypeScript strict mode, I'd incorrectly assumed that value was always present/required to display the map when it's not (it's only required for things like "Add Watch") and caused it to follow a different code path.
Activity
DanTup commentedon Dec 4, 2019
Thanks, I can reproduce this - seems to only happen when the map has DateTime keys:
I'll see what I can find!
DanTup commentedon Dec 4, 2019
@devoncarew @pq Is there a way to get a log of the VM service traffic from Android Studio? This same code seems to work fine there, but in VS Code we get an object with
kind="PlainInstance"and notkind="Map"so I want to figure out what we're doing differently.pq commentedon Dec 5, 2019
@DanTup: do you have the Android Studio plugin running from source? I think you'd have to add print statements to the
VmServiceManager(IIRC or similar). I'm not in front of the source now but happy to help instrument if you want to spelunk.DanTup commentedon Dec 5, 2019
I don't. Is it simple to set up? (I've never built any java in my life :-))
Or if it's simpler - if I paste the Dart code in here, could you easily run it and capture the VM service traffic?
Failing that - can you point me at the code that is fetching the values for this tree? I'll see if I can see any obvious differences with what you're doing there and I'm doing here. Thanks!
pq commentedon Dec 6, 2019
Go ahead and paste code here. Setup takes a bit...
DanTup commentedon Dec 9, 2019
@pq Here's the code from above:
If you breakpojnt on the
printand expand throughmapOfListOfMaps2to reveal values inside the leaf map (1:1, 2:2) capturing the VM service traffic, that should help my figure out what I'm doing differently.Thanks!
DanTup commentedon Mar 11, 2020
@pq ping! I don't support you're able to capture a log for above (or give some hints on how I could do it)?
DanTup commentedon Apr 14, 2020
@pq ping! :)
(if it's not already possible, maybe there's value in having a way to write logs easily for end users? I'm often wishing I could get logs from Android Studio, and the logs from VS Code come in handy debugging user issues all the time!)
pq commentedon Apr 14, 2020
Ack! Sorry. Will look today.
EDIT: whoops; looks like this is in the Dart Plugin Debugger -- let me get that setup...
DanTup commentedon Apr 15, 2020
Ok, I finally managed to track this down! It was a silly mistake on my part..
Against the values we track an "evaluateName" (this is a string that evaluates to the value shown, which can be used for "Add Watch", etc.). This only works when the key is a simple type (eg. we can add a watch expression for
myMap[1]but not formyMap[someComplexType]).When fixing up for TypeScript strict mode, I'd incorrectly assumed that value was always present/required to display the map when it's not (it's only required for things like "Add Watch") and caused it to follow a different code path.
pq commentedon Apr 15, 2020
Good deal @DanTup!