Rename refactoring is scary
I renamed a function in my local class, and without any warning or indication (the files aren't listed, aren't open--nothing), headers files in the Eigen library that was included were changed. I'm not sure why these files were scanned at all.
Related issues from a decade ago:
Please sign in to leave a comment.
Hello,
Do you have this setting turned on?
When it's off (by default) R# definitely shouldn't change files from the included libraries.
To open modified files after a refactoring, check the “Open all files with changes for editing” setting in the refactoring.
Could you please show what you tried to rename and what R# actually changed in Eigen headers? For usages that do not necessarily refer to your code, Rename should show a confirmation page which lists potential usages.
"Enable undo" was checked, but external changed files weren't opened.
“Enable inspections” in the options was checked, and unchecking it helped: it stopped checking external files.
But the real issue was that you still didn't fix the high contrast issue, and the dialog looks like this:
I renamed func() to fun() in the code above.
The checkbox at the top (rename addional refs) looks unchecked, right? No, it's not… As a consequence, it renamed func() in eigen3\Eigen\src\Core\CoreEvaluators.h.
Thanks for the assist.
Thanks! It looks like there is an issue where usages in dependent code from external files are found but not displayed properly in this refactoring page, I'll investigate - https://youtrack.jetbrains.com/issue/RSCPP-36177/
I don't get your last comment though. I've tried enabling a high contrast theme and I still see a check mark in the checkbox. Are you saying that when you click on the empty “Rename additional references” checkbox to toggle it you don't see a check mark? Could you please recheck this? Which high contrast theme are you using?
I was referring to this issue:
https://resharper-support.jetbrains.com/hc/en-us/community/posts/360003582979-dark-mode
Set a theme with white text on a black background, e.g., Accessibility> Contrast themes> Night Sky.
It should have occurred to me that the same way that I can't see the text in a white-background edit, I can't see check marks on white checkboxes.
To spell it out, a white writing on a white background is invisible. Resharper overrides the system default color and sets a white background to a control in a form but leaves the default text color white as well. If you override the default system colors, then you need to verify that the text and background aren't the same color.
As I mentioned, it's not white for me. Here's how it looks with “Night sky” on my Windows 11:
But I've just noticed that for some reason your color scheme is different and the text instead of having the yellow color as in my case is white.
Indeed, I'm not using the standard "night sky," and my text is set to white. However, this so called yellow seems not much different to me: I can't read the highlighted text or discern if the checkbox is checked.
Therefore, a correction to my previous suggestion: check that the (back/foreground) colors aren't too similar (some distance in the RGB metric) instead of exactly the same.