In an existing code base, the call to parse dates depends on the machine's culture. I created a custom resharper search/replace pattern that can spot and fix these calls.

Is there a way quickly find and fix all the hits of this search replace pattern? I'm now doing them one by one and it's going to take forever ...

有帮助吗?

解决方案

Isn't the 'Global Fix' at the end of that very blog post you link to exactly what you want?

Global Fix

What we’ve just done is a manual local fix, that is, locate the offending entry and hit Alt+Enter to apply a QuickFix. We can do this at a global scope by using the Pattern Catalog tool window.

1. Undo the prefix fix (so as to have several instances)

2. Open up the Patterns Catalog

3. Select the recently created Pattern and click on Search now. This time, instead of the Find Results dialog, we get a Replace dialog which displays all matching patterns and a Replace button

enter image description here

4. We can select the entries we want replacing (by default all checked). Click Replace

We’re done! ReSharper will now replace all occurrences. So we’ve applied a QuickFix globally.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top