Skip to content

Rename ​

Renaming a symbol (textDocument/rename, F2 in VS Code) changes every place that names it across the workspace, from the project index. clice refactor rename runs the same engine from the command line; its page details what a rename follows and what it refuses.

Edits ​

A rename edits the declarations, the definition and every use of the symbol, and renames the symbols that must keep its name.

Supported

Rename across files

Renaming a function edits its declaration, its definition and every call in the workspace; a spelling inside a macro is left alone and named in a message

Supported

What a rename follows

Renaming a class renames its constructors and destructor, a template its specializations, a virtual function its overrides

Supported

Rename a macro

Renaming a macro edits its #define in each branch of the #if it is defined in, the #ifndef guarding a default, and every use, written as another macro's argument or in another macro's body; a use pasted together with ## is left alone and named in a message

Supported

Rename a template's dependent name

In a template, a call depending on a template parameter is renamed where the indexed instantiations resolve it to the renamed method; one another instantiation resolves to another method of the same name stops the rename, and one no instantiation resolves is left alone and named in a message

Supported

Objective-C names

Renaming an Objective-C class, protocol, category or instance variable changes every place that writes it

Refused Renames ​

A symbol that cannot be renamed, or a new name that does not fit, is refused with the reason.

Supported

Names a rename refuses

Pressing rename on an operator, a symbol or a macro of the system headers, a macro the compile command defines, a name its instantiations resolve to several symbols or the parenthesis of a constructor call says why it cannot be renamed; off any name, nothing happens

Supported

New names refused

A new name that is no identifier, a keyword, taken in the same scope or a macro is refused with the reason; overloading a function or taking a reserved name is done with a warning, and a member may take the name of a sibling class's member

Supported

New macro names refused

A macro has no scope: a new name some symbol, macro or #ifdef of the project already spells is refused, as is defined; a reserved name is done with a warning

Supported

Objective-C methods and properties

Renaming an Objective-C method or property is refused, with the reason

A method's selector names every method its messages may reach, and a property its accessors and the instance variable it synthesizes; an instance variable a property synthesizes has no declaration to rename.