I'll take you to the visual studio--to bring you high efficiency development

Source: Internet
Author: User
Tags comments locale

The previous article takes you to play the visual studio--to take you to understand the VC + + various types of engineering a article to say various types VC + + Project main function and the use. Now will take you to develop the C + + program quickly together.

People with experience in Java development know that Java's common development tools (such as Eclipse, IntelliJ idea, etc.) have very powerful features such as keyword highlighting, smart hints, fast tracking, and more. Then maybe you should ask: Does Visual Studio, which is developing C + +, have this functionality as well? The first thing to note is that Visual Studio itself does not have such a powerful feature (at least VS2010 and previous versions are like this, there are some simple code-tracking capabilities but it's hard to use), but it has a very powerful and Easy-to-use plug-in with these features, it's vassistx, also known as the VC Helper, It's what this article is about. Brief Introduction and download installation of VASSISTX Simple Introduction

The full name of VASSISTX is Visual Assist X, a very useful plug-in developed by whole tomato, which can be used for various versions of VC6.0 and Visual Studio, including Vs.net2002, VS. NET2003, VS2005, VS2008, VS2010, VS2012, VS2013 and VS2015).

VASSISTX has the following main functions:
Smart tip: keyword hints, already have class name, method name hints, class members (member data and member functions) prompts;
code highlighting: keyword, class name, method name, etc. with different colors for highlighting, convenient code reading;
Quick Tracking: quick jump of declaration and implementation,. cpp and. h files fast switching;
Efficient Search: file name lookup, identifier lookup, identifier complement reference lookup;
Code refactoring: renaming identifiers (variable names, method names, class names, and so on), automatically adding Set/get methods for member variables, automatically adding comments for functions, and so on. Download and install Download:

Official Download Address: http://www.wholetomato.com/downloads/default.asp
You can also go to some Chinese websites to download, a large number of online search. Installation:

The installation is very simple, you only need to click Va_x_setupxxxx.exe for the default installation can, there is nothing to say. Registration Code

Or that sentence: Find a way to do it (hereafter are no longer explained), if the money or support genuine, after all as a programmer we should know to write a good program is not easy. Guide to the use of VASSISTX 1. Learn fast by "Tip of the Day".

After you install VASSISTX, you will have a Help prompt (pictured below), which is the best way for you to learn VASSISTX quickly, as well as a little animated tip that you can read. If you can't read English, you can see how it is with small animations.

Figure 1:tip of the day

If you don't want the dialog to pop up every time you start vs, just remove the "Show Tips at startup" option in the lower left corner. If you need to eject the conversation again, select Vassitx\visual Assist X Option...–>starup in the menu, and then tick show tip to the day. 2. Main windows and Tools

Plug-in installed after you should be able to feel better than before, such as code highlighting Ah, smart tips Ah, should be able to reflect immediately. But this is a brief introduction.


Figure 2: Window view

After the plug-in is successfully installed, the menu bar will have a vassistx menu, which contains all the features of VASSISTX and related settings, and will be further discussed in the following settings.
The left side will have two VA outline and VA view views (if not, the menu may be Vassistx\tools\va outline). VA outline This view is useful and is one of the most common views I use, which clearly renders individual members of a class.
The toolbar will also have one more VASSISTX tool group. The most I use is the one with the rightmost. h and. cpp toggle buttons. 3 shortcut keys for common use

Here are just some of the most commonly used shortcuts, and it's usually enough to remember that.

shortcut Keys Description Notes
Alt+g Quick jump, such as jump from declaration to implementation, jump to declaration by implementation. The cursor will be at the identifier
Alt+o Fast switching of. h and. cpp files
Alt+shift+f Find identifiers for all referenced locations The cursor will be at the identifier
Alt+shift+o Find a file under the entire solution O refers to open, opens the specified file
Alt+shift+s Lookup identifier s refers to symbol
Alt+shift+r renaming identifiers Cursor to the identifier, r refers to rename
Ctrl+shift+v Select the contents of the Clipboard to paste
Change shortcut keys

Menu Tools\option ..., and then in the Open dialog box to select Keyboard,show commands containning input VASSISTX can see the various functions of VASSISTX, you can set a specified function of the shortcut keys. If you enter Vassistx.refactorrename, you can see that the default shortcut key for renaming is Shift+alt+r, you press shortcut keys to change it.

Figure 3: Setting shortcut keys

attribute compounding for efficient development of VASSISTX option Settings

Vassistx Some default settings are not very friendly and we can reset it ourselves. Select vassitx\visual Assist X option in the menu ... Opens the Settings dialog box. Here's my personal preferences, for reference only (meaning of some key settings).


Figure 4: Setting 1
1. Spelling error detection (this do not choose, or old will have red wavy line hint);
2. Type error detection (this selection, you can test your variable type is correct);


Figure 5: Setting 2
1. The identifier of the highlighted reference (sets the color, the color of the current word, the color of a non-current word);
2. Automatically highlight the identifier at the current cursor location
3. Highlight the results of the reference;
4. The variables associated with highlighting the renamed identifier;


Figure 6: Setting 3
1. (black) highlight matching brackets;
2. (red) highlight mismatched brackets;
3. Highlight the line where the current cursor is located (you can choose to highlight the foreground or highlight the background);
4. The divider line of the longitudinal indicator, which is generally used to control the number of characters in one line of code;
5. Highlight Find results.

annotation Compounding and automatic adding code

Annotations are also an important part of the program, and good annotations are a key factor in improving the readability of your code and the maintainability of your programs, and writing a large number of comments is a tedious task that adds a lot of burden to programmers, and VASSSISTX can help us mitigate that burden. Move the cursor to the function name, and the right mouse selection Refactor\document method automatically helps us add comments to the functions.

We can configure our own custom annotation formats. Select menu: Vassistx\insert va snippet...\edit va Snippet ... is set. Give me the relevant settings, just for reference:

Title: File Header Detailed
shortcut: FH
Description: annotate the entire file

===============================================================
//summary:
//          $FILE _base$ class, $end $
//filename:
//          $FILE _base$. $FILE _ext$
//remarks:
//... Date:
//          $YEAR $/$MONTH $/$DAY $
//author:
//          %USERNAME% (luoweifu@126.com)
//==== ===========================================================

Description: The content between two $ symbols is the macro defined in Vassistx, see appendix below: Visual Assist X Snippets macros

Title: Refactor Document method
Shortcut:
Description: Commenting on a function

---------------------------------------------------------------
//function: 
//          $SymbolName $ $end $
//access:
//          $SymbolVirtual $ $SymbolPrivileges $ $SymbolStatic $
//parameter:
//          [in] $ methodarg$- 
//returns:
//          $SymbolType $- 
//remarks:
//          ...
Author:    %username%[luoweifu]
//---------------------------------------------------------------

Title: #ifndef ... #endif
Shortcut: #ifn
Description: prevent header files from repeating include

#ifndef __$file_base_upper$_h__
#define __$FILE_BASE_UPPER$_H__
$end $
#endif  //__$file_base_ Upper$_h__

Title: Refactor Encapsulate Field
Shortcut:
Description: Add the Get/set method of the member variable in the class.

    $end $ $SymbolType $ get$generatedpropertyname$ () const
    {return
        $SymbolName $;
    }
    void set$generatedpropertyname$ ($SymbolType $ val)
    {
        $SymbolName $ = val;
    }

Title:
Shortcut: //-
Description: A comment for an important modification and record the modification time.

$end $ [$YEAR $/$MONTH $/$DAY $%USERNAME%]

Title:
Shortcut: ///
Description: separator line, for the separation of important blocks of code.

===============================================================
$end $
Appendix Visual Assist X Snippets macros
. Reserved String meaning Sample or Description
Date Date Date Year/month/day formatted as%04d/%02d/%02d 2015/10/02
Datelocale Date_locale Current date in locale format Localized format
Day Day Day of month formatted as%d 2
DAY02 day_02 Day of month formatted as%02d 02
Dayname Dayname Day abbreviation in locale format Fri
Daylongname Daylongname Full name of day in locale format Friday
MONTH MONTH Month formatted as%d 10
MONTH02 month_02 Month formatted as%02d 10
MonthName MonthName Month abbreviation in locale format Oct
Monthlongname
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.