cancel
Showing results for 
Search instead for 
Did you mean: 

Refactor -> Rename renames indentifiers in all my projects

EThom.3
Senior II

Background: I have designed a new PCB, which includes a chip similar to one I've used on other PCBs, but with a different part number. The function names for this chip start with the part number.

As mentioned, the new project uses a slightly different chip, with a different part number. To not start from scratch, I copied the chip-related files from a different project in the same workspace, and changed the function names. I used Refactor -> Rename to rename the functions, so it would do the source and header files in one go.

But renaming didn't stop with the new project. It renamed identical function names in the older projects as well. All files where these functions were mentioned, were updated and saved. So now I have a file restoring task ahead of me. Thank Goodness for a cloud service with a file version history.

Question:

How do I avoid this in the future? I would very much like to limit renaming to a single project. But the only setting I have found regarding this is here:

EThom3_0-1765881474731.png

This is how it was set up when I did the renaming. Or so I believe – I didn't actually open the window until I had discovered the accident.

My guess is that I should have set it up like this (below) but can anyone confirm it? Or are there some other settings that I simply haven't found?

EThom3_2-1765881730748.png

Any help will be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

I've only ever used the 'Refactor' feature from the right-click menu, and don't seem to have had this problem.

Perhaps you could try that instead ... ?

AndrewNeil_0-1765887587276.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

11 REPLIES 11
  1. Were all the other projects open? I recommend closing projects you are not working with.
  2. Have you considered using git?
Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
EThom.3
Senior II

1. Yes.

Several of these projects are related. Some firmwares communicate with each other in the products where they are used, thus I frequently work on two or more projects simultaneously.

2. In my former workplace, git was used. And I learned to utterly dislike it.


@EThom.3 wrote:

git was used. And I learned to utterly dislike it.


Other version control systems are available ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Hi Andrew,

Indeed. (And I use my own.)

Files have been restored without issues.

LCE
Principal II

"Nightmare before christmas"

;)

Happy for you that you could restore the files!

Backups and versioning systems are there for a reason...

True. :D

Restoring the files was no big deal. Just a slight annoyance.

 

Returning to my original question: If I can trust the Preview feature, it seems that Refactor -> Rename attempts to rename in all open projects, regardless of the settings in the Preview window. I do have the possibility to uncheck certain files, but only if I remenber to use Preview.

So... maybe I should just stop using Refactor -> Rename. Although it was rather practical.

I've only ever used the 'Refactor' feature from the right-click menu, and don't seem to have had this problem.

Perhaps you could try that instead ... ?

AndrewNeil_0-1765887587276.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

 


@Andrew Neil wrote:

I've only ever used the 'Refactor' feature from the right-click menu, and don't seem to have had this problem.

Perhaps you could try that instead ... ?

 


That's exactly what I do.

I have now set the preferences to always open the Rename menu. Mainly as a reminder.

EThom.3
Senior II

Errr... I'm not sure why a reply has been marked as a solution, as nothing has actually been solved.

I still believe that the feature does stuff it shouldn't do.