# Change signature

> **TL;DR**
> `Refactor | Change signature`
>
>
>
> `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `⌘ F6` (Xcode), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Ctrl+F6` (ReSharper), `⌘ F6` (ReSharper (macOS)), `Ctrl+F6` (QtCreator), `⌘ F6` (QtCreator (macOS)), `Ctrl+F6` (NetBeans), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS))
>
>
>
> Shortcut: `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `⌘ F6` (Xcode), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Ctrl+F6` (ReSharper), `⌘ F6` (ReSharper (macOS)), `Ctrl+F6` (QtCreator), `⌘ F6` (QtCreator (macOS)), `Ctrl+F6` (NetBeans), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS))
>
>
>
> Refactoring settings: `Settings | Editor | General`
>
>
>
> refactoring is available

The Change Signature refactoring combines several different modifications that can be applied to a function signature. You can use this refactoring to:

* change the function name and return type

* add, remove, and reorder parameters

When changing a function signature, CLion searches for all usages of the function and updates all the calls, implementations, and override replacements of the function that can be safely modified to reflect the change.

Procedure: Add parameters

1. Click the `return` value that is highlighted in red color.

2. Press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `⌥ ⏎` (Xcode), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Alt+Enter` (ReSharper), `⌥ ⏎` (ReSharper (macOS)), `Alt+Enter` (QtCreator), `⌥ ⏎` (QtCreator (macOS)), `Alt+Enter` (NetBeans), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) and select Create parameter '<parameter_name>'.

3. In the Change Signature dialog, adjust parameter settings or accept suggested settings.

4. Click Refactor.

Procedure: Change a function signature

1. Place the caret at the function you want to refactor.

2. Press `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `⌘ F6` (Xcode), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Ctrl+F6` (ReSharper), `⌘ F6` (ReSharper (macOS)), `Ctrl+F6` (QtCreator), `⌘ F6` (QtCreator (macOS)), `Ctrl+F6` (NetBeans), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS)) or select `Refactor | Change Signature` from the main menu or the context menu.

3. In the Change Signature dialog, make the necessary changes to the function signature.

* Change the function name in the Name field.

* Change the function return type in the Return type field.

* Manage the function parameters using the table and the ![Add](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg)/![Remove](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.remove.svg)/![Move up](https://resources.jetbrains.com/help/img/idea/2026.2/app.general.arrowUp.svg)/![Move down](https://resources.jetbrains.com/help/img/idea/2026.2/app.general.arrowDown.svg) buttons. When adding a parameter, specify the new parameter's properties in the corresponding row: Type, Name, and Default value. The Default value field sets the type value to be used as an argument to the usages. If you leave this field empty, CLion will use the default type value (for example, `0` for numerical and `nullptr` for pointers). ![Change signature dialog](https://resources.jetbrains.com/help/img/idea/2026.2/cl_change_signature_default.png) > **Note:** > [Completion](auto-completing-code.html) is available in the Type and Default value fields.

* You can also make a function `const`, `constexpr`, or `noexcept` using the corresponding checkboxes.

## Examples

C/C++:

| Before | After |
| --- | --- |
|     ```CPLUSPLUS //Initial function signature int exFunction2(int a, int b) {     int x = a+b;     return x; };  int main() {     int a = 0, b = 1;     int x = exFunction2(a, b);     return 0; } ```    |     ```CPLUSPLUS //Name changed, the third parameter introduced int exFunction3(int a, int b, int c) {     int x = a+b;     return x; };  int main() {     int a = 0, b = 1;     int x = exFunction3(a, b, 0); //default value '0' added     return 0; } ```    |

Python:

| Before | After |
| --- | --- |
|     ```PYTHON # This function will be renamed def fibonacci( n ): a, b = 0, 1 while b < n: print( b ) a, b = b, a+b  n = int(input("n = ")) fibonacci( n ) ```                             |     ```PYTHON # Function with the new name def fibonacci_numbers( n ): a, b = 0, 1 while b < n: print( b ) a, b = b, a+b  n = int(input("n = ")) fibonacci_numbers( n ) ```    |

JavaScript:

| Before | After |
| --- | --- |
|     ```JAVASCRIPT //This function will be renamed //and a default parameter will be added function result() { }  function show_result() {     alert('Result: ' + result()); }  ```                             |     ```JAVASCRIPT //Function with a new name and default parameter function generate_result(input = 100) { }  function show_result() {     alert('Result: ' + generate_result()); } ```    |

## See also

### External Links

[JetBrains CLion
Blog](http://blog.jetbrains.com/clion/2014/12/refactorings-in-clion-be-safe-and-quick/)

