"Change All XXX"

One really nice feature is when I cut and paste a small amount of code into
a new method in a new class, when a specific identifier isn't recognized,
one if the pop-up options from the light-bulb is "Change all XXX" ... this
allows me to change every occurence of the unknown identifier to be
something new (and correct).

I have one question though: why isn't this more wide-spread?

For example, I renamed a class in my project recently. So all the old code
that uses the old name now pops up as red. But no light-bulb pops up for
those items, and I don't get any opportunity to "change all XXX" for them...
I'm reduced to old-fashioned "find and replace" manually.

Could you please add this pop-up lightbulb with the "Change All XXX" option
(as well as any others, such as "create type" maybe?) in the next revision
of Resharper?

I think the number of cases where I want this feature and it's not there
outnumber the cases where I want this feature and it IS there. I'm guessing
it only works on local variables, not types?



4 comments
Comment actions Permalink

Hello Paul,


For example, I renamed a class in my project recently. So all the old
code that uses the old name now pops up as red. But no light-bulb
pops up for those items, and I don't get any opportunity to "change
all XXX" for them... I'm reduced to old-fashioned "find and replace"
manually.


Why not use the Rename refactoring and have R#r take care of this for you?

--
Matt Berther
http://www.mattberther.com


0
Comment actions Permalink

Change all could work with classes as well. In fact, we had tested it with
classes and namespaces. It is performance that was the decisive factor. Even
now you can manage to create a file with lots of unresolved identifiers that
will cause slow highlighting due to time-consuming change-all availability
checks. Nonetheless, it might be a good idea to implement it as a feature
explicitly driven by a user.

--
Andrey Simanovsky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"



"Paul Bradshaw" <pbradshaw@advsol.com> wrote in message
news:cp5cqu$ssd$1@is.intellij.net...

One really nice feature is when I cut and paste a small amount of code
into a new method in a new class, when a specific identifier isn't
recognized, one if the pop-up options from the light-bulb is "Change all
XXX" ... this allows me to change every occurence of the unknown
identifier to be something new (and correct).

>

I have one question though: why isn't this more wide-spread?

>

For example, I renamed a class in my project recently. So all the old
code that uses the old name now pops up as red. But no light-bulb pops up
for those items, and I don't get any opportunity to "change all XXX" for
them... I'm reduced to old-fashioned "find and replace" manually.

>

Could you please add this pop-up lightbulb with the "Change All XXX"
option (as well as any others, such as "create type" maybe?) in the next
revision of Resharper?

>

I think the number of cases where I want this feature and it's not there
outnumber the cases where I want this feature and it IS there. I'm
guessing it only works on local variables, not types?

>
>



0
Comment actions Permalink

Rename doesn't work because it's an "unknown identifier" ... Resharper has
no idea what it is. It's in red. So "Rename" isn't enabled.


"Matt Berther" <mberther@hotmail.com> wrote in message
news:6596858632380359446052615@news.intellij.net...

Hello Paul,

>
>>
>> For example, I renamed a class in my project recently. So all the old
>> code that uses the old name now pops up as red. But no light-bulb
>> pops up for those items, and I don't get any opportunity to "change
>> all XXX" for them... I'm reduced to old-fashioned "find and replace"
>> manually.
>

Why not use the Rename refactoring and have R#r take care of this for you?

>

--
Matt Berther
http://www.mattberther.com

>



0
Comment actions Permalink

I would be fine with just being able to right-click on a red "unresolved
symbol" and be able to select "Change All..." rather than having IDEA know
ahead of time and pop up light-bulbs or what-not, if that helps the
performance issue.


"Andrey Simanovsky (JetBrains)" <ands@jetbrains.com> wrote in message
news:cp6u0n$42a$1@is.intellij.net...

Change all could work with classes as well. In fact, we had tested it with
classes and namespaces. It is performance that was the decisive factor.
Even now you can manage to create a file with lots of unresolved
identifiers that will cause slow highlighting due to time-consuming
change-all availability checks. Nonetheless, it might be a good idea to
implement it as a feature explicitly driven by a user.

>

--
Andrey Simanovsky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>
>

"Paul Bradshaw" <pbradshaw@advsol.com> wrote in message
news:cp5cqu$ssd$1@is.intellij.net...

>> One really nice feature is when I cut and paste a small amount of code
>> into a new method in a new class, when a specific identifier isn't
>> recognized, one if the pop-up options from the light-bulb is "Change all
>> XXX" ... this allows me to change every occurence of the unknown
>> identifier to be something new (and correct).
>>
>> I have one question though: why isn't this more wide-spread?
>>
>> For example, I renamed a class in my project recently. So all the old
>> code that uses the old name now pops up as red. But no light-bulb pops
>> up for those items, and I don't get any opportunity to "change all XXX"
>> for them... I'm reduced to old-fashioned "find and replace" manually.
>>
>> Could you please add this pop-up lightbulb with the "Change All XXX"
>> option (as well as any others, such as "create type" maybe?) in the next
>> revision of Resharper?
>>
>> I think the number of cases where I want this feature and it's not there
>> outnumber the cases where I want this feature and it IS there. I'm
>> guessing it only works on local variables, not types?
>>
>>
>>
>



0

Please sign in to leave a comment.