Skip to content
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

Visual Studio Natvis visualization #227

Merged
merged 3 commits into from
Aug 8, 2018
Merged

Visual Studio Natvis visualization #227

merged 3 commits into from
Aug 8, 2018

Conversation

WheretIB
Copy link
Contributor

@WheretIB WheretIB commented Aug 5, 2018

This PR adds custom visualization for pugixml types to improve debugging experience in Visual Studio.

All build mode switches expect for PUGIXML_COMPACT are covered. There will be a separate PR for compact mode.

@zeux
Copy link
Owner

zeux commented Aug 5, 2018

Looks like the only difference between wide and non-wide visualizers is the format specifier - sb vs sub. Just to confirm, what happens if there's no format specifier for these values? (e.g. {value} instead of {value,sb}) If that automatically uses the correct type that could mean we only need one file.

@WheretIB
Copy link
Contributor Author

WheretIB commented Aug 5, 2018

sb and sub formats remove "" and L"" around the strings respectively.

It's mainly used to display a pretty preview of the node value depending on type:
Current view

Without that format specifier it will look like this:
Single file view

I can rework the display to require only one file with a view like:
Reworked

@WheretIB
Copy link
Contributor Author

WheretIB commented Aug 6, 2018

Updated the view to
New Mode

<DisplayString Condition="(header &amp; 0xf) == 3">node_pcdata value={value,na}</DisplayString>
<DisplayString Condition="(header &amp; 0xf) == 4">node_cdata value={value,na}</DisplayString>
<DisplayString Condition="(header &amp; 0xf) == 5">node_comment value={value,na}</DisplayString>
<DisplayString Condition="(header &amp; 0xf) == 6">node_pi name={name,na}</DisplayString>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node_pi should also display value (e.g. <?include me?>)

@WheretIB
Copy link
Contributor Author

WheretIB commented Aug 7, 2018

I've replaced each node type specialization with a generic enum cast with conditional name and value display if they are available:
Conditional display

@zeux zeux merged commit c51214f into zeux:master Aug 8, 2018
@zeux
Copy link
Owner

zeux commented Aug 8, 2018

Perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants