VS2010 editing the source program tips

Source: Internet
Author: User
Tags function definition

First introduce the next personal situation, the company's original code on the server, there is no version control tool (very spit), often need to copy the server code to local editing and upload.


1: How to display the VS2010 according to the source program directory, the effect is as follows:

Here's how: File-New-Create a project from existing code, then create a solution for the entire directory code, generating a. vcxproj file. If you need more than one project directory, do the same (file-new-Create project from existing code).

Then, if you need to display several solutions at the same time, file-add-existing project, and then open the. vcxproj file that you created in the previous step.


2: Source code operating habits tips

It is recommended to use the VASSISTX plug-in for easy source code editing. Auto-completion function name, variable name and so on, function jump, find function or variable reference function.

2.1: Go To Definition

Jumps to a function or variable at its definition. VS2010 with F12 jump, or use the VASSISTX plug-in jump function, as shown in figure

The cursor is at the function, click on the Go button above. Looks a little more handsome, hehe ~

2.2 Find All references

For a function or variable, see where the project is referenced, you can use the function of the VASSISTX plug-in, Alt+shift+f, vs2010 features unknown. The effect is as follows:

2.3 Jump Back

When using 2.1 and 2.2 features, you often get back to a problem. For example, I want to query I=testfun (), where the Testfun function is defined and jumps to the function definition using the method described in 2.1. Now I'm going to move the cursor back to Ii=testfun (); This place, how to do it. If it is a different file, Ctrl+tab can. If it is the same file, there is a left-to-right button on the menu bar, click on it. As shown in figure:


Come here for the time being, and then continue to add.


3: Notes

Comment on the function. In the Vassistx plugin, you can set the function comment template, enter the VASSISTX option settings, enter Advanced-suggestions-edit VA snipptes, click on the Refactor Document method setting, To set up the template. eg

/*
************************************
Method: $SymbolName $
Description:
Main idea:
Author: Bao Just
Date: $DATE $
Parameter
In
Global in:
Out
Global out:
Return:
Called Method:
Modification:
************************************
*/



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.