We are happy to announce that now it’s possible to contribute to the STL Visualizers for Visual Studio’s debugger on GitHub.
A visualizer is a file with .natvis extension that allows you to manipulate the way native types appear in the debugger’s watch window.
We’ve been working on fixing existing issues with the visualizers and augmenting them, but with C++20 coming with new types, they have been falling behind. We decided to open source them so that the community can benefit and collaborate.
What’s Available?
The file is now in the GitHub repo under stl\debugger\STL.natvis. We also have available documentation for the .natvis file format here. All changes made on GitHub will be ported to Visual Studio.
This has been up already for a couple of weeks and we are happy to see that there are already contributors helping in this new area. We would like to thank AdamBucior, statementreply, SuperWig and joemmett. Some of the PRs add visualizers to coroutines, chrono, ranges, the spaceship operator, source location, span, and more.
Contribute now!
We are happy with the results of this change, and we would like to see more. After you make changes to the visualizer you can test them by adding the natvis file to any Visual Studio C++ project by right clicking your project, selecting Add > Existing Item, and choosing the STL.natvis file. After doing this you should be able to see your changes in a Visual Studio debugging session.
Since you all are looking at this area, I’d like to get your attention on this visualizer feature request again: add an EndPointer natvis XML tag for LinkedListItems that can be used in lieu of Size.
https://developercommunity.visualstudio.com/t/natvis-for-linkedlistitems-allow-an-endpointer-val/822713
We are aware of this feature request. Unfortunately we are currently working on issues with higher priority.
When would we get the full support of the C++20 Concepts (still lacks ‘requires-expression’ now)?
Thanks for the comment! We plan to address this issue (allow requires-expression in any context) in Visual Studio 2022 version 17.0 Preview 4.
Is there a roadmap or any plans on improving/adding new features to natvis?
We have a GitHub issue tracking this here. But I’m planning on making something more formal soon.