CLion 2020.3 Help

Extract Function

Refactor | Extract | Method

In the C++ context, the title of the dialog is Extract Function. For more information, see Extract Function Refactoring.
Item Description
Name In this field, specify the name of the function or method to be generated on the basis of the selected source code.
Declaration place In the drop down list, select a place to declare a new function (above or below).

Note: This option is available for global functions only.

Return type In this field, specify the return type of the new function.
Signature preview In this read-only field, view the declaration of the new function.

Extract Function Parameters Pane

Item Description
Type Specify the type of the added parameter.
Name Specify the name of the added parameter.
List of parameters Contains the full parameters list of created function.


Item Shortcut Description
Icons general add Alt+Insert Click this button to add a new parameter to the list.
Icons general remove Alt+Delete Click this button to remove the selected parameter from the list.
Icons actions previous occurence or Icons actions next occurence  Alt+Up or Alt+Down Use these buttons to move the selected parameter up and down in the list.

The order of parameters in the list defines the order in which parameters appear in the function.

Last modified: 19 August 2020