August 23rd, 2013

C++ IDE Improvements in Visual Studio 2013

When we considered what features to add to the C++ IDE in Visual Studio 2013, we decided to focus on improving the C++ code editing experience. We’ve added a number of features that will help you write and format your code more quickly, and will give you more useful information in IntelliSense. You can configure the behavior of most of these new features using the Options dialog from the Tools menu.

Code Formatting

One of my biggest frustrations with the C++ editor in Visual Studio over the past several years has been the lack of formatting when I pasted code into the editor. Combined with the lack of many common code formatting settings, this meant I spent quite a bit of time making my code look how I wanted, rather than actually writing new code.

In Visual Studio 2013 we added over 40 settings to help you control when and how your C/C++ code is formatted. We realize that there are many common formatting conventions for C/C++ code, so rather than dictate a single style of code formatting, we aim to give you the flexibility to adapt the settings to match your existing coding standards.

In some cases, we know that none of the options provided might be what you want. One particular example of this is controlling the exact position of opening curly braces for various block types. For these settings, we added an option to not apply a particular formatting rule so that you can control a particular aspect of your code formatting without needing to turn off formatting globally.

Image 8546 082313 0027 CIDEImprove1

It’s also possible to take advantage of code formatting without applying it automatically – simply go to the Text Editor -> C/C++ -> Formatting -> General page in the Options dialog, and uncheck all the boxes to turn off the auto-formatting behavior. You can then manually format your code using the Format Document and Format Selection commands from the Edit -> Advanced menu. This can be helpful if different areas of your codebase use different formatting standards, or if you need to make changes to 3rd party library code in your solution.

IntelliSense Improvements

We made some changes to Member List and Parameter Help so they provide more relevant information.

The Member List window now hides private members of types, except when you’re editing code that defines the type.

Image 3731 082313 0027 CIDEImprove2

The Parameter Help tooltip that appears when typing parameters of an overloaded function will now automatically switch to the best matching overload based on the number of parameters you’ve typed thus far. And it properly handles nested function calls – when you start typing a nested function call, Parameter Help will display results relevant to the nested call, then restore the contents of the tooltip to the outer function call when you close the argument list.

Image 8358 082313 0027 CIDEImprove3

Small Changes that make a Big Difference

Have you ever used the “Go To Header File” command from the editor context menu? Now you can toggle back and forth between a header and its corresponding code file. There’s even a default keyboard shortcut – Ctrl + K, Ctrl + O.

The editor can auto-generate event handlers in C++/CX and C++/CLI code files. You can choose to auto-generate just the delegate instance, or both the delegate instance and event handler function (both definition and declaration).

Image 4657 082313 0027 CIDEImprove4

Image 2514 082313 0027 CIDEImprove5

You may remember that In Visual Studio 2010, we changed Find All References to show just textual matches by default. You could have opted to have the compiler verify whether the textual results were actual matches.

We’ve changed Find All References to automatically resolve matches incrementally in the background after the textual matches are displayed – you don’t have to resolve the references in order to get the information from the compiler.

We also added a toolbar to the Find Symbol Results window so it’s easier to navigate the results and to stop resolution if desired.

Image 0451 082313 0027 CIDEImprove6

And the Project Properties window is (finally) resizable.

Image 8877 082313 0027 CIDEImprove7

Other Features

C++ developers can also take advantage of the improvements made to the common Visual Studio code editor, such as Peek Definition, Brace Completion, Enhanced Scrollbar, and updated Navigate To. You can learn more about these features in the Visual Studio blog post “Visual Studio 2013 New Editor Features“.

Your Feedback Matters

One of the main reasons we ship preview releases of Visual Studio is to get your feedback and bug reports on new features and functionality, so we can fix the main issues before the RTM release. We regularly review bugs and other feedback reported via Connect and through the Visual Studio Send a Smile feature. As of this writing, the Visual Studio 2013 Preview has been available for about two months. Since that time we’ve fixed 14 bugs that you’ve reported (and several others we’ve found internally). Please keep on sending your feedback and reporting bugs. Even though we may not be able to fix every issue or respond to each piece of feedback, please know that we do read and consider all feedback we receive.

Wrap-up

For the complete list of Visual C++ IDE features in Visual Studio 2013, check out the What’s New for Visual C++ in Visual Studio 2013 Preview page. And if there are features you’d like to see us add to the C++ IDE in future versions of Visual Studio, please vote for them on our UserVoice site.

Category
C++

0 comments

Discussion are closed.