Can I change the preferred style of XML documentation?
Hi folks,
when using Rider to code C# for Unity, entering three slashes above a method automatically creates summary start and end tags. However, when coding C++ for Unreal, entering three slashes doesn't. I noticed that these two are interpreted as the same:
/// <summary>
/// Holds the id of the radio button that was chosen as an answer.
/// </summary>and
/// Holds the id of the radio button that was chosen as an answer.
So I wonder, can I have the latter as the default? Especially for fields, it's more compact and therefore I like it more.
This goes for both, C# and C++, even though in C++, the default is the entirely different /* … */.
Also, is it some kind of convention or agreed upon style that C++ uses /* … */ and C# uses ///?
Please sign in to leave a comment.
Hello,
In C# XML Documentation Comment is the standard approach: see xmldoc on learn Microsoft. In Rider there is no way to switch to use a different syntax. However, you can disable this template generation for C# via Settings | Editor | General | Typing Assistance | C# | Insert documentation comment stub on ‘/’
For C++, you can choose what syntax to use. Check the Settings | Languages & Frameworks | C/C++ | Code Generation page, see the “Documentation comment template” section there. Or, same as for C#, you can disable this template generation via Settings | Editor | General | Typing Assistance | C/C++ | Generate documentation comments.
Hope that helps. Have a nice day!
Thank you Dmitry, that was helpful!