Whoops -- Parameter refactor blew up my DBML generated code.

Hey folks,

I'm probably the lone idiot here, but I just purchased Resharper 6 and was using it today to with the code analysis to scan our newest version of a project, and was using the refactoring to change someones parameter values to a less confusing name.

I changed his parameter named "code" to something like "updatedCode" or something to disambiguate it from the others used in the same function.... However! When I did the parameter refactor the default (search in comments and string literals) was checked. This seemed fair enough, I did not however realize that it would change things in my entire project. This changed a "Key" string literal in my DBML autogenerated code -- is this normal or did something go wonky? I would imagine the refactor in comments would probably stick to the same file.

Thanks,
-Matt

1 comment
Comment actions Permalink

When I used it the last time it also checked string in files where it might be used with some false results. I guess it would help to find WinForms DataBinding usages which would be broken otherwise. It also checks caller methods as they could contain related string used for the parameter too. What it really does I don'n now have to wait for Andrey he might give a technical point of view answer.

As you noticed you can damage your project if you do not check all strings it wants to replace. You can disble one by one what you don't want to be replaced. Just remeber that and always check it.

Also note that you can revert the full renamin with ctrl+z

0

Please sign in to leave a comment.