June 23rd, 2021

STL Visualizers on GitHub

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. 

A visualisation for vectors of ints

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.   

   Visualisation of various chrono types

 

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.  

Selecting the STL.natvis file

6 comments

Discussion is closed. Login to edit/delete existing comments.

    • Anju Del Moral GonzalezMicrosoft employee Author

      We are aware of this feature request. Unfortunately we are currently working on issues with higher priority.

  • unituniverse2@yahoo.com

    When would we get the full support of the C++20 Concepts (still lacks ‘requires-expression’ now)?

    • Xiang FanMicrosoft employee

      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.

  • Phillip Foose (SI)

    Is there a roadmap or any plans on improving/adding new features to natvis?

    • Anju Del Moral GonzalezMicrosoft employee Author

      We have a GitHub issue tracking this here. But I’m planning on making something more formal soon.