.. _Change Method Signature:

Change Method Signature
=======================

The **change method signature** refactoring allows you to add, reorder or remove the arguments of a method. All updates to existing method calls will be automatically performed.

**Place the cursor** on the desired method, right-click and go to **Refactor** > **Change Method Signature** or simply press **Shift+Alt+C**.

.. figure:: ../../images/vlogdt-right-click-change_method_signature.png

In the **Change Method Signature** dialog you can modify the method's name and arguments.

.. figure:: ../../images/vlogdt-dialog-change_method_signature.png


Method name changes are equivalent with :ref:`Rename Refactoring`.

The list of arguments can be manipulated by using the buttons on the right side of the table.

**Add:** Add a new argument at the end of the list. You will be prompted to provide:
 - the argument type
 - the argument name
 - the actual argument to be used in existing function calls

.. figure:: ../../images/vlogdt-dialog-add-change_method_signature.png


**Remove:** Remove the selected argument. The selected argument will not be part of the list anymore and will be erased from function calls as well.

**Up/Down:** Change the position of the selected argument.

.. note:: 

 The dialog status area presents validation information, such as duplicate parameters, invalid identifier names and duplicate methods.

Click *OK* to perform the refactoring, or *Preview* to see the changes that are about to be performed in the source code.
In the *Preview* page you can select the changes that should be performed.
After you click *Finish* the changes are performed, and the project is rebuilt.

.. figure:: ../../images/vlogdt-dialog-preview-change_method_signature.png

.. note:: 

 This functionality works only for ANSI style methods.

.. figure:: ../../images/vlogdt-dialog-non-ansi-change_method_signature.png

.. note:: 

 In specific preprocessing scenarios - for example when a method declaration or a method call lies within a macro expansion - the refactoring cannot be automatically carried out. A **FIXME** comment will be inserted in the relevant code location and will show up in the Tasks View. See :ref:`Track Tasks using TODO Markers`.







