Replace Pattern should add an argument to method call but does nothing
Hi,
Writing a pattern to enforce specifying culture in parse methods (any existing?)
Search pattern:
$double$.Parse($arg$)
$arg$ - expression of System.String;
$double$ - System.Double type
Replace pattern:
$double$.Parse($arg$, System.Globalization.CultureInfo.InvariantCulture)
It finds all occurrences, there is a replace description ("Add invariant culture") in quick fix menu. But it does nothing, document flickers and remains the same.
What am I doing wrong?
Thanks
Please sign in to leave a comment.
Hello Vadim,
Could you please describe which ReSharper version do you use?
Thanks!
Here it is:
JetBrains ReSharper 7.0.1 C# Edition
License server at http://resharper.***.com:8080/licenseServer is used
Plugins: none
Visual Studio 11.0.50522.1.
Thanks.
Hello Vadim,
This pattern works fine for me. Could you please create and send me a small sample solution, which will demonstrate the issue? I beleive it can be happening only on some specific code/project/etc.
Thank you in advance!
Sure, see in attach..
Simple sln + screenshots.
Thanks for assist,
Vadim
Attachment(s):
AlmostNothing.7z.zip
One more question:
How to make this replacement work?
$Assert$.IsTrue($arg$) --> $arg$.Should().BeTrue("because ***");
Hello Vadim,
I apologize for a delayed response.
I've confirmed this issue as a bug and logged it here in YouTrack for further fixing: http://youtrack.jetbrains.com/issue/RSRP-336144.
Thank you.
Hello Vadim,
This pattern should work:
Search pattern (I beleive Assert can be searched directly without placeholder):
Assert.IsTrue($arg$);
Replace pattern:
$arg$.Should().BeTrue("because ***");
Please let me know if it works fine for you.
Thank you!