Skip to content

Latest commit

 

History

History
182 lines (108 loc) · 7.97 KB

refactoring_tools.md

File metadata and controls

182 lines (108 loc) · 7.97 KB

Refactoring Tools

Available Refactorings

Named Parameters

  • Adds the formal parameter name of each actual parameter in the subprogram call.

Source

Demo Source

named_parameters

Add Parameter

  • Adds a new parameter to a subprogram.
  • All subprogram specs are updated.
  • Only parameters with correct syntax are accepted.
  • The new parameter type is infered when only the name is provided.
  • The new parameter location is infered from the cursor position.

Source

Demo Source

add_parameter

Remove Parameter

  • Removes a parameter of a subprogram.
  • All subprogram specs are updated.
  • Actual parameter is removed from the subprogram calls.

Source

Demo Source

remove parameter

Move Parameter

  • Moves a parameter backward and forward within a subprogram spec.
  • All subprogram specs are updated.
  • Actual parameter are moved in the subprogram calls when needed.

Source

Demo Source

move_parameter

Change Parameter Mode

  • Changes the parameter mode within a subprogram spec.
  • All subprogram specs are updated.

Source

Demo Source

change_parameter_mode

Change Parameter Type

  • Changes the parameter subtype indication within a subprogram spec.
  • Only subtype indications with correct syntax are accepted.
  • All subprogram specs are updated.

Source

Demo Source

change_parameter_type

Change Parameter Default Value

  • Changes the parameter default value expression within a subprogram spec.
  • Only default value expressions with correct syntax are accepted.
  • All subprogram specs are updated.

Source

Demo Source

change_parameter_default_value

Extract Subprogram

  • Extracts statements to a new subprogram.
  • The new subprogram is created in the nearest declarative part.
  • Local declarations of for loop and exception handlers are passed to the extracted subprogram as new parameters.
  • Extract function is available is the last statment is either an assignment or a return statment.

Source

Demo Source

extract_subprogram

Pull Up Declaration

  • Moves a declaration and its dependent declarations to their parent declarative part.
  • When pulling up a subprogram, object declaration are not pulled up. Instead, they're added as formal parameters to the subprogram specification and as actual parameters to the subprogram calls.

Source

Demo Source

pull_up_declaration

Suppress Separate

  • Moves a separate subunit to it's stub in the parent package.
  • Use clauses in the separate subunit are moved to the subprogram's declarative part to avoid namespace collisions.
  • .bak is added to the separate subunit source filename.

Source

Demo Source

suppress_separate

Introduce Parameter

  • Introduces a formal parameter based on an object declaration or expression inside a subprogram.
  • All references of the object declaration or expression are replaced by the introduced parameter.
  • The user must mannually fix the calls to the subprogram that was refactored by addings the corresponding actual parameter.

Source

Demo Source

introduce parameter

Replace Type

  • Replaces a type in the intire project by another type provided by the user.

Source

Demo Source

replace type

Auto Import

  • For an unresolved name, suggests all packages that can be imported and prefix to be added so that that the name gets resolved.

Source

Demo Source

auto import

Sort Dependencies

  • Sorts all with and use clauses and their associated pragmas.

Source

Demo Source

replace type