How to visualise this HashMap using Natvis?

Hi Guys,

I am checking the amethyst/legion crate and it is really great. However, I have a challenge in debugging it. In my code, there are many places I will have below if let,

if let Some(entry) = world.entry(entity) {
        let position = entry.into_component::<Position>().unwrap();
        println!("{}", position.x);

If I visualise entry using debugger, it shows the raw data like below and I have to declare a temperory variable position to know the values in this entry. This is quite challenging because I am working on a huge simulator and using println! is less productive.

Hence, I thought of writing my own Natvis for visualisation but it is not working :frowning:

<Type Name="legion::internals::entry::Entry">
    <DisplayString>{{ Selva }}</DisplayString>
    <Expand HideRawView="true">
                  <Variable Name="i" InitialValue="0" />
                  <Variable Name="n" InitialValue="world->components.storages.base.table.items" />
                        <Break Condition="n == 0" />
						<!-- This if condition need to be modified to show only items of this entry -->
                        <If Condition="(world->components.storages.base.table.ctrl.pointer[i] &amp; 0x80) == 0">
                              <Item>((tuple&lt;$T1, $T2&gt;*)world.components.storages.base.table.ctrl.pointer)[-(i + 1)]</Item>
                              <!-- <Item>((tuple&lt;$T1, $T2&gt;*)world->components.storages.base.table.ctrl.pointer)</Item> -->

I think the storages stored as HashMap is not visualised correctly (with or without my Natvis). I feel it is due to custom hasher they use, HashMap< ComponentTypeId, Box<dyn UnknownComponentStorage>, BuildHasherDefault<ComponentTypeIdHasher>.

Can someone help me on how I can modify this Natvis to show this HashMap?

Note: My custom natvis file is based on the natvis in Rust git repo.