How to apply the same refactoring to a selection (i.e. more than a single line)

Hi,

   Firstly, just want to say ReSharper is an excellent tool (well done the ReSharper team).

I have a lot of old C# code that looks like the following (i.e. constants declared in uppercase):



private const double FIRST_CONSTANT = 10;


private const double SECOND_CONSTANT = 20;

ReSharper suggests the following refactorings:

   Name 'FIRST_CONSTANT' does not match rule 'Constant fields (private)'. Suggested name is 'FirstConstant'

   Name SECOND_CONSTANT' does not match rule 'Constant fields (private)'. Suggested name is 'SecondConstant'



Is there a way using in ReShaper to select both these lines and apply the suggested refactoring (I have 100 of lines of code of this form so don't want to have to do each individual rename separately) ?

I note the clean "Cleanup Code..." option can be restricted to a selection but it doesn't include performing any refactorings such as the suggested renaming above ?

I'm using ReSharper 5.1 Full Edition (Build 5.1.1753.4 on 2010-10-15T15:51:30).

Thanks in advance,
Joel Gordon.
1 comment
Avatar
Andrey Serebryansky
Comment actions Permalink

Hello Joel,

At the moment there's no way to fix multiple issues at a time, but this is
a highly requested feature and we will consider providing such ability in
one of the future releases. Meanwhile, you're welcome to monitor the status
of the following feature request: http://youtrack.jetbrains.net/issue/RSRP-188837.
Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi,

Firstly, just want to say ReSharper is an excellent tool (well done
the ReSharper team).

I have a lot of old C# code that looks like the following (i.e.
constants declared in uppercase):

private const double FIRST_CONSTANT = 10;

private const double SECOND_CONSTANT = 20;

ReSharper suggests the following refactorings:

Name 'FIRST_CONSTANT' does not match rule 'Constant fields
(private)'. Suggested name is 'FirstConstant'
Name SECOND_CONSTANT' does not match rule 'Constant fields
(private)'. Suggested name is 'SecondConstant'
Is there a way using in ReShaper to select both these lines and apply
the suggested refactoring (I have 100 of lines of code of this form so
don't want to have to do each individual rename separately) ?

I note the clean "Cleanup Code..." option can be restricted to a
selection but it doesn't include performing any refactorings such as
the suggested renaming above ?

I'm using ReSharper 5.1 Full Edition (Build 5.1.1753.4 on
2010-10-15T15:51:30).

Thanks in advance,
Joel Gordon.
---
Original message URL:
http://devnet.jetbrains.net/message/5278170#5278170



0

Please sign in to leave a comment.