Make Top-Level Function
In this section:
Overview
This refactoring moves local functions or methods to the top level and converts their variables to input parameters and return values. So doing, the access to the attributes and return values is converted, and the usages are updated.
Moving a local function or a method to the top level
To move a function or a method to a top level, follow these steps:
- Place the caret at the local function or method name.
- On the main menu, or on the context menu of the editor, choose
.
The preview shows in the Find tool window. - If satisfied with the preview results, confirm move by clicking Do Refactor
Example
Last modified: 23 November 2016