Resharper (Find and) fix all issues at once

2020-05-21 07:24发布

问题:

e.g. alt enter -> context menu -> Find all 'Redundant name qualifier' issues -> but now in the new window that lists all those issues in my project, is there a way to fix them all ? (rather than go through them individualy)

ta.

回答1:

For now, you have to go through the issues individually. There's an existing request to batch-apply fixes to all similar issues selected in the "Inspection Results" tool window.

Code Cleanup does batch-remove certain issues in any given scope but it's quite limited in the number of fixes it can apply, compared to the number of code issues that ReSharper is able to detect.



回答2:

Click into a redundant qualifier, alt+enter, then choose from the context menu that lets you fix the issue however thoroughly you'd like.

I'm running ReSharper 8.2.



回答3:

Yes, you can use ReSharper's "Cleanup Code" to remove redundant qualifiers (amongst other things). This is available from the context-menu when you right-click files, projects and folders in the Solution Explorer window. Code Cleanup will run over all the selected files, reformatting and fixing common issues - it is also customizable.



回答4:

This is available (in part) in the latest build. If you go to a specific issue in the code editor, click the lightbulb the fix option now has a submenu for some issues that can be applied to the entire solution. Would be cooler if it was available from the Code Issues window, but still a great improvement.

https://www.jetbrains.com/help/resharper/2016.1/Code_Analysis__Fix_in_Scope.html