Skip to main content

Dialog: Options: Refactoring

Symbol: _cds_icon_option_refactoring.png

Function: The dialog is used to define the operations in the project for which the automatic refactoring is suggested. The refactoring functionality helps you with your improvement endeavors.

Call: Tools → Options command, Refactoring category

Suggest Refactoring for the Following Operations

Auto-declare

When you call AutoDeclare (Shift+F2) to change the name of a variable in a declaration, the selected Apply changes by means of refactoring option is displayed. Then the Refactoring dialog opens and you can change the variable throughout the entire project.

  • On adding or removing variables, or on changing the scope

    _cds_icon_checked.png: You delete the names in the Declare Variable dialog and click OK to close the dialog. Then the Refactoring dialog opens to remove the variable throughout the entire project.

  • On renaming variables

    _cds_icon_checked.png: You specify the names in the Declare Variable dialog and click OK to close the dialog. Then the Refactoring dialog opens to rename the variable throughout the entire project.

    See: "Refactoring" chapter, "Changing a variable declaration and applying refactoring automatically"

Unit conversion editor

On renaming of unit conversions

  • _cds_icon_checked.png: When you change the name of a conversion in the unit conversion editor, you are prompted whether or not CODESYS should perform "Automatic Refactoring" when renaming.

Mapping editor

On renaming variables

  • _cds_icon_checked.png: When you change a variable name in the device editor (I/O Mapping tab), you are prompted whether or not CODESYS should perform "Automatic Refactoring" when renaming.

Navigator

On renaming objects

  • _cds_icon_checked.png: When you change the name of an object in the device tree or in the POU view, you are prompted whether or not CODESYS should perform "Automatic Refactoring" when renaming.

Tabular declaration editor

On renaming variables

  • _cds_icon_checked.png: When you change the name of a variable in the tabular declaration editor, you are prompted whether or not CODESYS should perform "Automatic Refactoring" when renaming.

UML Class Diagram

Options for the support of refactoring (meaning IEC code adaptation throughout the entire project) for changes made in the class diagram editor

  • On adding or removing variables

    _cds_icon_checked.png: Refactoring is supported when you add or remove variables in the VAR_INPUT, VAR_OUTPUT, and VAR_INOUT sections in the class diagram.

  • On renaming a POU

    _cds_icon_checked.png: Refactoring is supported when you rename a POU in the class diagram.

  • On renaming variables or properties

    _cds_icon_checked.png: Refactoring is supported when you rename a variable or property in the class diagram.

Note: If the Skip Refactoring Preview option is selected in the UML options, then refactoring is performed at all relevant locations in the project without prior display in the Refactoring dialog, depending on the case. For more information, see: "Dialog 'Options' – 'UML'" in the help for CODESYS UML

For more information, see: Refactoring