Use of ghostdoc

Source: Internet
Author: User
Use of ghostdoc

  I. Introduction

Ghostdoc is a free plug-in for Visual Studio. It can automatically generate comments in XML format for developers.

  

  Ii. Download

If you need a friend, you can download it here and enter an email address: ghostdoc

  

  Iii. Installation

After the download and installation are complete, you can find ghostdoc under the tool menu of Visual Studio.

  

  

During the first use, you are required to set the shortcut key. The default value is Ctrl + Shift + S. If this is in conflict with the shortcut key you set, you can select another one from the drop-down list.

 

The advantage of ghostdoc is that it can quickly generate comments to improve development efficiency, but there are also many shortcomings. First, all the comments she generates are in English, and sometimes it will be difficult to see, in addition, it is sometimes impossible to generate accurate comments because the quality of the comments generated by ghostdoc depends largely on the quality of the identifiers. For example, the method uses the Pascal naming method and the variable uses the camel naming method, therefore, you can use ghostdoc to check whether your name is reasonable and whether it is meaningful.

 

If your class member is a member used to implement an interface or override the base class, ghostdoc uses the existing document, no matter where these interfaces or base classes come from, if there is no existing document available, ghostdoc will try to "Guess" how to generate comments for you. Of course, accuracy may depend on RP...

 

  Iv. Use

1. If the variable name cannot be identified, ghostdoc will only generate the summary tag, and the cursor will move to the blank comment content:

  

 

2. Sometimes the generated comments are inaccurate or do not conform to your habits:

  

 

3. If the name is reasonable, you can still accurately generate comments:

  

  

  5. Custom Configuration

In addition to simple use, you can also perform custom configuration in ghostdoc:

  

  

The configuration method has a ghostdoc help document under the installation directory. You can set it in detail according to the document. Here is a simple example:

  

1. Start with the lastOptions TabBecause it feels more practical, You can automatically generate additional comments here, there is a customtext text box, here you can both output the comments you want, you can also click the button next to it to use the macro variables that have been defined by the system, as shown below:

  

The generated comments are as follows:

  

Haha, it feels good ..

 

2. Let's talk about the first one."Rules" tabAnd is also the most important one. Here we just open a representative:

  

  

In the description, we can see that this rule will detect a Boolean value that starts with "can" Returned. below is the returned template and the generated summary annotation template. The highest priority will appear in the first one, if the first one is not matched, search down.

 

This may be the most complex but most demanding configuration. Let's take adding a simple personalized method as an example:

Click Add on methods, enter a name you like, and enter Method Configuration:

  

After the configuration is complete, you can perform a simple test below.

 

Then enter Type Configuration:

  

You can also configure parameters as needed. The methods are similar.

 

Then configure the template of the summary tag, for example:

  

You can also click the button to select a custom macro.

 

After configuration, let's take a look at the results:

  

The expected result is obtained .. Pai_^

 

3. The second tab isAcronymsHere, ghostdoc will try to detect the abbreviations. For example, HTML in the buildhtmltext () method will be interpreted as HTML, but it will only automatically process the consonants, other words must be configured in the configuration table on the tab of this dialog box.

For example:

  

Then add UML to the rule and generate the following comments:

  

4,"Of the" rule: For example, if size is defined here, the word "filebuffersize" will be annotated as "Size of the File Buffer". It seems that I have nothing to customize...

5,"No the" Word: When you create a comment in ghostdoc, a new one is created before the name, and the content displayed in the list of this tab is not created. The effect is as follows:

When no rule is added:

  

Add myx to enter this rule and generate comments again:

  

This seems to be a bit irrelevant. It is estimated that foreigners will also be concerned about this, so this rule is completed...

 

  6. Other Tips

Ghostdoc automatically detects the method annotations for inheritance and rewriting, which greatly simplifies the operation.

  Example 1: Inheritance

Here we define a simple attribute to see the effect of the annotation:

  

Let's take a look at the effect of the annotation during Rewriting:

  

Haha, you can get the content that we commented on earlier...

Note that the summary annotation label must be used, and simple // annotation of ghostdoc is ignored...

  

  Example 2: rewrite

If you want to say that ghostdoc cannot generate Chinese comments, it is also wrong. In fact, if you install the Chinese version of Vs, you can generate Chinese comments. For example, here we

Inherit the controlbuilder class under system. Web. UI, and prepare to rewrite the htmldecodeliterals () method. Let's take a look at vs's current Smart Tips:

 

Now generate comments to see the effect:

 

 

 

 

 

 

 

 

 

 

 

 

 

It's good. The comments are very standard, and they are exactly the same as those written by hand ..

 

Well, the above is the use of the small Visual Studio plug-in ghostdoc in the project. If you have the opportunity to outsource it in the future, it is estimated that this may be more useful. Continue to work hard... Pai_^

  I. Introduction

Ghostdoc is a free plug-in for Visual Studio. It can automatically generate comments in XML format for developers.

  

  Ii. Download

If you need a friend, you can download it here and enter an email address: ghostdoc

  

  Iii. Installation

After the download and installation are complete, you can find ghostdoc under the tool menu of Visual Studio.

  

  

During the first use, you are required to set the shortcut key. The default value is Ctrl + Shift + S. If this is in conflict with the shortcut key you set, you can select another one from the drop-down list.

 

The advantage of ghostdoc is that it can quickly generate comments to improve development efficiency, but there are also many shortcomings. First, all the comments she generates are in English, and sometimes it will be difficult to see, in addition, it is sometimes impossible to generate accurate comments because the quality of the comments generated by ghostdoc depends largely on the quality of the identifiers. For example, the method uses the Pascal naming method and the variable uses the camel naming method, therefore, you can use ghostdoc to check whether your name is reasonable and whether it is meaningful.

 

If your class member is a member used to implement an interface or override the base class, ghostdoc uses the existing document, no matter where these interfaces or base classes come from, if there is no existing document available, ghostdoc will try to "Guess" how to generate comments for you. Of course, accuracy may depend on RP...

 

  Iv. Use

1. If the variable name cannot be identified, ghostdoc will only generate the summary tag, and the cursor will move to the blank comment content:

  

 

2. Sometimes the generated comments are inaccurate or do not conform to your habits:

  

 

3. If the name is reasonable, you can still accurately generate comments:

  

  

  5. Custom Configuration

In addition to simple use, you can also perform custom configuration in ghostdoc:

  

  

The configuration method has a ghostdoc help document under the installation directory. You can set it in detail according to the document. Here is a simple example:

  

1. Start with the lastOptions TabBecause it feels more practical, You can automatically generate additional comments here, there is a customtext text box, here you can both output the comments you want, you can also click the button next to it to use the macro variables that have been defined by the system, as shown below:

  

The generated comments are as follows:

  

Haha, it feels good ..

 

2. Let's talk about the first one."Rules" tabAnd is also the most important one. Here we just open a representative:

  

  

In the description, we can see that this rule will detect a Boolean value that starts with "can" Returned. below is the returned template and the generated summary annotation template. The highest priority will appear in the first one, if the first one is not matched, search down.

 

This may be the most complex but most demanding configuration. Let's take adding a simple personalized method as an example:

Click Add on methods, enter a name you like, and enter Method Configuration:

  

After the configuration is complete, you can perform a simple test below.

 

Then enter Type Configuration:

  

You can also configure parameters as needed. The methods are similar.

 

Then configure the template of the summary tag, for example:

  

You can also click the button to select a custom macro.

 

After configuration, let's take a look at the results:

  

The expected result is obtained .. Pai_^

 

3. The second tab isAcronymsHere, ghostdoc will try to detect the abbreviations. For example, HTML in the buildhtmltext () method will be interpreted as HTML, but it will only automatically process the consonants, other words must be configured in the configuration table on the tab of this dialog box.

For example:

  

Then add UML to the rule and generate the following comments:

  

4,"Of the" rule: For example, if size is defined here, the word "filebuffersize" will be annotated as "Size of the File Buffer". It seems that I have nothing to customize...

5,"No the" Word: When you create a comment in ghostdoc, a new one is created before the name, and the content displayed in the list of this tab is not created. The effect is as follows:

When no rule is added:

  

Add myx to enter this rule and generate comments again:

  

This seems to be a bit irrelevant. It is estimated that foreigners will also be concerned about this, so this rule is completed...

 

  6. Other Tips

Ghostdoc automatically detects the method annotations for inheritance and rewriting, which greatly simplifies the operation.

  Example 1: Inheritance

Here we define a simple attribute to see the effect of the annotation:

  

Let's take a look at the effect of the annotation during Rewriting:

  

Haha, you can get the content that we commented on earlier...

Note that the summary annotation label must be used, and simple // annotation of ghostdoc is ignored...

  

  Example 2: rewrite

If you want to say that ghostdoc cannot generate Chinese comments, it is also wrong. In fact, if you install the Chinese version of Vs, you can generate Chinese comments. For example, here we

Inherit the controlbuilder class under system. Web. UI, and prepare to rewrite the htmldecodeliterals () method. Let's take a look at vs's current Smart Tips:

 

Now generate comments to see the effect:

 

 

 

 

 

 

 

 

 

 

 

 

 

It's good. The comments are very standard, and they are exactly the same as those written by hand ..

 

Well, the above is the use of the small Visual Studio plug-in ghostdoc in the project. If you have the opportunity to outsource it in the future, it is estimated that this may be more useful. Continue to work hard... Pai_^

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.