Skip to content

Refactorings

Mathieu Guindon edited this page Jun 27, 2018 · 2 revisions

Some of the current Refactoring tools available are:

Extract Method
this refactoring is currently undergoing a rewrite, and is disabled in release builds.

Rename
Select an identifier - be it a variable, a constant, a procedure, an enum, a UDT member, a line label, anything with a name, including a control on a UserForm or a class or standard module, enter a new name for it, and Rubberduck automatically updates all references.

Introduce Parameter
Select a local variable to promote to a parameter. Call sites for the containing procedure will be updated with a TODO argument, which must then be specified for all call sites.

Introduce Field
Select a local variable to promote to module scope.

Encapsulate Field
Select a module variable (aka "field") to make Private and expose a Property Get and Property Let/Set accessors for.

Move Closer to Usage
Moves a field that's only used in 1 procedure, into that procedure. Or moves a local variable immediately above its first use.

Extract Interface
Pick what class members to extract into an interface; the feature creates a new class modules with stubs for the selected members, and makes the original class implement the extracted interface.

Implement Interface
Creates stubs for all members of an unimplemented interface, so you don't need to create them manually by selecting them one by one in the code pane dropdown.

Clone this wiki locally