Refactor Rename changes method names inside string literals

已回答

When renaming a method, CLion also replaces the method name inside string literals, which is unwanted.
Is there a setting or config to disable renaming inside string literals?

0

example

 

class ExampleClass
{
public:
   void CalculateValue(int x, int y, int z, int w)
   {
       // Implementation
   }
};


ICall_TEST("Namespace.ExampleClass::CalculateValue(int,int,int,int)", );

 

When I refactor the method name CalculateValue in ExampleClass, the string literal is also changed to the new method name, which is unwanted.
 

0

Hello!

If you use CLion Classic (i.e., CLion Nova is disabled), you can click the following icon to configure the settings (see https://www.jetbrains.com/help/clion/rename-refactorings.html#rename-procedure):

If you use CLion Nova, there is a setting in the “Rename” dialog:

0

Hello, I'm using CLion Classic and have unchecked "Comments and String" in the rename settings, but it still renames text inside strings. I’ve tried multiple times, and sometimes CLion freezes during the renaming operation, forcing me to quit it via Activity Monitor.

0

As a workaround, please go to File | Settings | Editor | Code Editing and set Specify refactoring options to In modal dialogs.

As another workaround, you can enable CLion Nova - https://www.jetbrains.com/help/clion/clion-nova-introduction.html#switch-to-nova-via-toolbar.

0

请先登录再写评论。