Disable/Customize comment (re-)formatting in Resharper when using code cleanup

喜欢而已 提交于 2019-12-23 20:06:17

问题


Is there a way to define how the comments are "cleaned" using Resharper (6)? I didn't find a solution to this problem.

Before code cleanup:

/// <summary>
/// This is a comment.
/// </summary>
public class MyClass
{
   ... <not yet cleaned code is here>
}

After code cleanup:

/// <summary>
///   This is a comment.
/// </summary>
public class MyClass
{
   ... <cleaned code is here>
}

Wanted result:

/// <summary>
/// This is a comment.
/// </summary>
public class MyClass
{
   ... <cleaned code is here>
}

Remarks: I don't want to disable the cleanup for a single class etc. I just want to change the indent within the comment which is added accidently.


回答1:


I have found a solution (using ReSharper 6.1.1000.8.2).

Open up the menu: ReSharper->Options->Code Editing->Code Cleanup->(Select profile, needs to be a user defined profile)->C#->Disable Reformat embedded XML doc comments

This seems to be a new checkbox in ReSharper 6.1!?

This solution will not set the indent but disables the comment reformating. Thus you'll have to clean up the comments yourself but they are no longer changed (using the wrong indent) by ReSharper.

I hope, JetBrains will add an option to support setting the indent separately within the next versions.




回答2:


I think this is a bug. Here it is on the ReSharper bug tracking site: http://youtrack.jetbrains.com/issue/RSRP-275881



来源:https://stackoverflow.com/questions/10208199/disable-customize-comment-re-formatting-in-resharper-when-using-code-cleanup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!