[R# 5.0 EAP] Rules for XML Doc Comment Formatting

The option for formatting XML Doc Comments during Code Cleanup is a nice
addition, but where exactly are these rules/settings coming from?
Currently, switching this option on adds a leading blank line to each doc
comment block:

///
///

It also removes the space between the triple slashes and each tag.  These
formatting rules are driving me nuts, but I would like to be able to use
this feature :).  Is there a way to configure these settings by manually
editing a config file?

Thanks,
Mike

6 comments

Hello Mike
     Could you please post a small example of how ReSharper formats your xml-doc comments and an example of how you'd like them to be formatted? Thank you!

Andrey Serebryansky

Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0

Hello,

There're no XmlDoc-specific formatting settings (yet?). They're just treated
as generic XML inserted into a C# document in a special manner (with all
those triple slashes). The XML formatter does not see any slashes, and the
formatting result has to be re-shashed and inserted back into the C# document.
The effects you see are not the matter of settings (those would have been
very strange default settings indeed), but rather obvious bugs in C#-XML
interop. They're to be fixed before the release.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0

Hi,

I'm using R# 5.1 with VS2010 and the formatting still seems to be wrong when using the left hand button to generate the comments ('Add xml-doc comments'). The space before the XML tags and text is missing. An example skeleton:

///<summary>
///</summary>
///<returns></returns>
public string GetVersion()


Using '///' and Enter to generate the comments does not show this behavior. These missing spaces lead to problems when generating an API documentation with Doxygen. According to the C# Language Specification (page 487) there must be a leading space.

Thanks
Yves

0

ReSharper generates XML comments in this form, using the add XML comment command:

///<summary>
///</summary>

but Visual Stuio in this form, after typing ///

/// <summary>
///
/// </summary>

I guess it should work the same way. Also if there's some text already:

/// <summary>
/// Create new object...
/// </summary>

And Ctrl E + F command is used for smart refactoring, the XML comment is indented in unwanted way:

/// <summary>
///     Create new object...
/// </summary>

This was introduced in R# 5.0 and since then I can't use refactoring shortcut for the whole file using Ctrl A + E + F.
This feature about indenting XML comments should be at least optional in settings.

0

I have the same issue, and yes it is very annoying. Also because it does not occur on all my machines.. ?? The machine where this behavior occurs has vs2008 and vs2010 installed, on the machine where just vs2008 is installed the behavior isn't there. I'm guessing it has to do with something installed by vs2010? Anyway you can disable the formatting of xml-doc comments by creating a code-cleanup profile and turning the option 'Reformat embedded XML doc comments' off. Hope this helps.

0

Hello Andre,

There's a corresponding issue in our tracker: http://youtrack.jetbrains.net/issue/RSRP-49252
and you're welcome to vote for it. Thank you!

Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I have the same issue, and yes it is very annoying. Also because it
does not occur on all my machines.. ?? The machine where this behavior
occurs has vs2008 and vs2010 installed, on the machine where just
vs2008 is installed the behavior isn't there. I'm guessing it has to
do with something installed by vs2010? Anyway you can disable the
formatting of xml-doc comments by creating a code-cleanup profile and
turning the option 'Reformat embedded XML doc comments' off. Hope this
helps.

---
Original message URL:
http://devnet.jetbrains.net/message/5272809#5272809



0

Please sign in to leave a comment.