Rod Johnson
Rod Johnson

Reputation: 2427

style cop + resharper control comments

this may seem like a trivial question but when i installed the stylecop plugin for resharper my comments are getting formatted like this

/// <summary>
/// Gets the gift item.
/// </summary>
/// <param name="uid">
/// The uid.
/// </param>
/// <param name="upc">
/// The upc.
/// </param>
/// <returns>
/// </returns>
Gift GetGift(long uid, string upc);

as opposed to

/// <summary>Gets the gift item.</summary>
/// <param name="uid">The uid.</param>
/// <param name="upc">The upc.</param>
/// <returns></returns>
Gift GetGift(long uid, string upc);

I can't seem to find any way to turn this type of formatting off.

Upvotes: 15

Views: 2842

Answers (3)

Michael
Michael

Reputation: 201

If you have the Microsoft Stylecop for Resharper plugin installed in Resharper, Go to Resharper Options, Tools, then StyleCop for Resharper. There you should see a checkbox for Use single lines for declaration headers.

Upvotes: 20

Kelly Adams
Kelly Adams

Reputation: 760

You can make GhostDoc work if you turn off "Reformat embedded XML doc comments" in your default Code Cleanup settings under the "C#" category. Then under StyleCop section, turn off rule "1611: Element Parameters Must Be Documented" and rule "1618: Generic Type Parameters Must Be Documented". That way code-cleanup won't re-mangle your GhostDoc comments. Bear in mind that Code Cleanup options are solution-specific.

Upvotes: -1

The Chairman
The Chairman

Reputation: 7187

Give GhostDoc a try. This free Visual Studio extension generates even nicer XML doc comments. param and return tags are inlined whereas summary tags remain on separate lines. Perhaps this already suits Your needs.

Upvotes: 1

Related Questions