Extract Parameter in ActionScript
This feature is supported in the Ultimate edition only.
This section discusses the Extract Parameter refactoring in ActionScript.
Example
Extracting parameter in ActionScript
To extract a parameter in ActionScript
- In the editor, place the cursor within the expression to be replaced by a parameter.
- Do one of the following:
- If more than one expression is detected for the current cursor position, the Expressions list appears. If this is the case, select the required expression. To do that, click the expression. Alternatively, use the Up and Down arrow keys to navigate to the expression of interest, and then press Enter to select it.
- In the Extract Parameter dialog:
- Usually, IntelliJ IDEA sets a proper parameter type itself. If necessary, you can select another appropriate type from the Type list.
- Specify the parameter name in the Name field.
- The Value field, initially, contains the expression that you have selected. Normally, you don't need to change this.
If the new parameter is going to be an optional parameter, the specified value will be used as the default parameter value in the function definition.
If the new parameter is introduced as a required parameter, the specified value will be added to the function calls.
For information about required and optional parameters, see the discussion of function parameters inFlex/ActionScript documentation.
- If you want the new parameter to be an optional parameter, select the Optional parameter check box.
- If more than one occurrence of the expression is found within the function body, you can choose to replace only the selected occurrence or all the found occurrences with the references to the new parameter. Use the Replace all occurrences check box to specify your intention.
- Click OK.
See Also
Last modified: 18 July 2017