Reputation: 5217
I think I might have hit some keystroke by accident within Visual Studio 2013 that I didn't intend to. When I put the /// in front of a method, it used to automatically create the following sort of XML documentation in front of the method:
/// <summary>
///
/// </summary>
/// <returns></returns>
For some reason, it now fails to indent the last three lines correctly. The first line is indented where it should, but the last three are not as they're aligned to the left side of the document. If I hit the Ctrl + K, Ctrl + D key combination, the text aligns as it should.
I went through the various options in How to auto format code indentations in VS2012? attempting to toggle any of those options into working and unfortunately, none of it managed to fix the issue.
What can I do to get the indentation to work properly?
Edit: This happens in every file, even if the syntax is accurate. And I know the combination for Edit>Advanced>Format Document (the Ctrl + K, Ctrl + D combination I named). I don't want to have to click or hit this key combination each and every time. I want Visual Studio to automatically format this XML block with the proper tabs without my interaction every time.
Upvotes: 1
Views: 1134
Reputation: 99999
This is most likely caused by another extension you have installed. If an extension is throwing an exception when a documentation comment is first inserted, it may cancel the automatic formatting option. When you execute the Format Document command instead, it is not involved so the formatting operation is able to proceed like normal.
Upvotes: 1