Documentation Comment Editing

The Template Editor makes it easy to document your template code. The documentation you write shows up in statement completion and quick info, so you can see what a method, property or argument does without reading its code.

Adding a documentation comment

To add a documentation comment, type /// (C#) or ''' (Visual Basic) on the line immediately before a type or member. The editor inserts a stub with the right tags for you.

As you press Enter inside a documentation comment, the editor adds /// or ''' to the next line so you can keep typing.

Example

Suppose you're working on an existing template and come across a WriteToLog<T> method. You don't know what it does, so you point at it to see its quick info. It has no documentation, so quick info shows only its signature.

Quick info for WriteToLog showing only the method signature

You use Go To Definition to read the method, and then document it for the next person:

  1. Place the cursor on the empty line above the method.

    Empty line above the WriteToLog method

  2. Type ///. The editor inserts a documentation stub with summary, typeparam and param tags.

    Documentation comment stub with summary, typeparam and param tags above WriteToLog

  3. Fill in the summary.

Now, when you point at WriteToLog<T>, quick info shows your description.

Quick info for WriteToLog showing the signature and the added summary