VISUAL ASSIST - Filling Gaps in Visual Studio for C/C++ and C# Developers

Tips and Tricks

A quick way to create implementations of all methods in a class

We released a feature some time ago that we failed to document, and since its UI is subtle, there is a good chance you know about it only if you follow our release notes closely. I raise the feature for two reasons: 1) it’s valuable, and 2) now it’s documented. The feature is Create Method Implementations, and it gives you a quick way to create implementations of all methods of a class.

Move to the name of a class in its declaration, typically in a header, and select Create Method Implementations from a refactoring menu. For example, press Shift+Alt+Q.

Open Quick Refactoring Menu from the name of a class

A dialog opens, letting you select the methods whose implementations you want created. As with other refactoring and code generation commands, Visual Assist will attempt to create implementations in a sensible location.

Select methods to implement

Visual Assist is clever enough to exclude methods already implemented, so you can invoke the command again if you add a few methods to the declaration of an existing class.

You can adjust the format of newly created implementations by modifying the VA Snippet for Create Implementation—the same VA Snippet used by its namesake and Extract Method.

%d bloggers like this: