15

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.

Rod Johnson
  • 2,387
  • 6
  • 30
  • 48

3 Answers3

20

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.

Michael
  • 201
  • 2
  • 3
  • I still have this described problem but - "StyleCop for ReSharper has now merged with StyleCop" https://stylecopforresharper.codeplex.com/ – Paul C Nov 20 '14 at 13:25
  • 1
    You can install the plug-in for SyleCop from the Extension Manager from the ReSharper menu in Visual Studio. You can then manage the StyleCop Settings from Reharper-Options-Tools-StyleCop. – Jeff Pearce Nov 10 '15 at 18:49
1

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.

The Chairman
  • 7,087
  • 2
  • 36
  • 44
-1

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.

Kelly Adams
  • 750
  • 4
  • 15