views:

225

answers:

2

Is there a way to rename all methods, properties etc. suggested by R#. I have code that I converted from java and all methods and properties are in the format like this "onBeforeInsertExpression" and I want them to follow camel casing that is common in .NET.

This question is also for CodeRush.

+1  A: 

No, unfortunately there isn't a way. Resharper's Code Cleanup / Reformat Code options work nicely for formatting, namepaces, etc, but will not do any automatic member renaming. You're kinda stuck doing a "Quick Fix" on each member. If you have a lot of them, this can be a pain...

Nader Shirazie
Would coderush do it?
epitka
CodeRush has over 160 refactorings, this is not always noticed as they are only displayed when useful. For the full catalog check out http://www.devexpress.com/Products/Visual_Studio_Add-in/Refactoring/.
Rory Becker
@Rory: I know it has a lot of individual refactorings... I just don't see anything that points to a "global auto rename of all members". I'm sure the DXCore platform can be used to write some sort of plugin, but I'm pretty sure it doesn't come with the tool...
Nader Shirazie
@Nader I was just pointing out that a tool with 160 refactorings is fairly well focused on Refactoring. This is contrary to your previous comment. As you correctly indicate though, there is nothing out of the box to provide a global application of any refactoring.
Rory Becker
@Rory: Ok, gotcha. After re-reading my comment, it is a little unfair. I shall delete and replace my comment.
Nader Shirazie
See Rory's answer for more info on CodeRush. I don't believe there's a way to do a global auto rename. You may be able to write a plugin to either R# or CodeRush (DXCore) that would do what you want.
Nader Shirazie
A: 

CodeRush's approach to this kind of fix is more of an interactive process.

Which is to say you have to physically be in the location of the variable whose name you wish to change and you have to change each one individually.

That said, there is a very powerful engine under CodeRush called the DXCore, which can be used to create a very wide variety of functionality. Indeed it is this layer on which the whole of CodeRush and RefactoPro are built.

I have no doubt that it could be used to create the functionality you are after. However I doubt that you would use the existing rename technology. I will have to look into this a little further, but I am optimistic about being able to produce something.

Rory Becker
Thank you I would appreciate it. It is very big project and many, many variables. Having to do it manually would be a paaaaiiin. I know R# marks the variable and shows what would be "proper" name. So, there should be a way to run through all files and accept all renames. I don't know much about CodeRush, but I am hearing good things.
epitka
A few questions...Are you purely looking to change the case of the vars in your code?Which Identifiers? .. Locals, Fields, Method Names, Classes, Structs, events, delegates?Is there any external code (external to the solution) which might depend on this code and therefore break when these changes are applied?
Rory Becker

related questions