Productivity Improvements for C++: New Default Colorization, Template Argument Filtering in Call Stack Window, and IntelliCode On-By-Default
New Default Semantic Colorization
In Visual Studio 2019 version 16.3 Preview 2 we’ve introduced a new default semantic colorization scheme for C++. For a long time, many of the default colors were simply black. However, colorization can help you quickly understand the structure of code at a glance. To take advantage of this, we’ve created two new color schemes, and of course you can still customize your colors further by typing “Change font” in the Ctrl + Q search bar.
Under Tools > Options > Text Editor > C++ > View > Color Scheme you can now pick between three presets: Enhanced, Enhanced (Globals vs. Members), and Visual Studio 2017. By default, Enhanced will already be selected. Note that these color schemes change the Default color values, so if you have previously customized a color, you’ll need to reset it to Default if you want the new scheme to take effect (see the “Customizing Individual Colors” section at the bottom of this post).
This is the new default color scheme. The following colors of this colorization differ from Visual Studio 2017:
- Local variables
- Escape characters
- Keyword – control
- This is a new classification for keywords related to control flow (if, else, for, return)
- String escape characters
Below are of the Enhanced color scheme for the Light and Dark themes.
Enhanced (Globals vs. Members) Scheme
We also added a preset called “Enhanced (Globals vs. Members)” which is designed to emphasize the scope of your code. In this scheme, global functions and global variables share the same color, while member functions and fields share another color.
For example, notice how “pow” now stands out as a global function.
Visual Studio 2017 Scheme
If you’d like to revert to the Visual Studio 2017 scheme, select the “Visual Studio 2017” preset.
Customizing Individual Colors
We understand that colorization preferences are personal, so if you wish to customize any particular color, you can do so under Tools > Options > Environment > Fonts and Colors.
To use all the default colors, make sure to click “Use Defaults” in the top right.
Template Argument Filtering in Call Stack Window
Previously, when using heavily to moderately templated types (including the STL), the Call Stack window quickly would become overwhelmed with template expansions to the point that became difficult to debug due to poor readability.
Now, you can right-click in the Call Stack Window and toggle “Show Template Arguments” to make room for other important information, and making it much more readable!
In Visual Studio 2019 version 16.2 we added C++ IntelliCode in-box. In version 16.3 Preview 2, we are taking that a step further and have turned the feature on-by-default. This means that, by default, you’ll start to benefit from autocompletion results recommended by a machine-learned prediction model. The recommended results are surfaced at the top of the completion list and are prepended with stars:
For more details on IntelliCode, check out our other C++ IntelliCode blog posts.
Talk to Us!
If you have feedback on any of these productivity features in Visual Studio, we would love to hear from you. We can be reached via the comments below or via email (firstname.lastname@example.org). If you encounter other problems with Visual Studio or MSVC or have a suggestion, you can use the Report a Problem tool in Visual Studio or head over to Visual Studio Developer Community. You can also find us on Twitter @VisualC and follow me @nickuhlenhuth.