Table of content
WholeTomato

VA Snippets for Refactoring and Code Generation

Several VA Snippets define the code created or modified by the refactoring and code-generation features of Visual Assist. For example, the VA Snippet titled Create Implementation defines the format of methods created by Extract Method and Create Implementation. 

The VA Snippets for refactoring and code generation are required, and are located by title. If you delete one of the VA Snippets, Visual Assist will recreate a default one.

You can modify the code associated with the VA Snippets, but you should not change their titles. For example, update the VA Snippet for Encapsulate Field if you prefer "Get" and "Set" prefixes on getter and setter methods.

Reserved Strings

The VA Snippets for refactoring and code generation make heavy use of reserved strings that expand when invoked. Many of the reserved strings are unique to refactoring and code-generation, and cannot be used in VA Snippets of other types.

Reserved strings related to symbol context expand to null in VA Snippets for refactoring and code generation.

See the documentation on reserved strings for more information.

List of VA Snippets for Refactoring and Code Generation

VA Snippet Title Language(s) Note
Create From Usage Class C++, C# Also used by Implement Interface
Create From Usage Class (C) C Creates a struct
Create From Usage Class (Managed) C++  
Create From Usage Class (Platform) C++ Invoked for WinRT code
Create From Usage Method Body C++, C#  
Create From Usage Method Body (C) C  
Create From Usage Method Body (Managed) C++  
Create From Usage Method Body (Platform) C++ Invoked for WinRT code
Create Header File C/C++ Used by Create File and Move Selection to New File
Create Implementation C++ Used also by Extract Method and Move Implementation to Source File
Create Implementation for Member C++ Used by Create Implementation for static members
Create Implementation for Member (header file) C++ Used by Create Implementation for static members when no corresponding source file is available
Create Source File C# Used by Create File and Move Selection to New File
Document Method C/C++, C#  
Encapsulate Field C++, C#  
Extract Method C/C++, C#