Remove Unused Parameter
- 2 minutes to read
Purpose
Removes the method parameter, which is never referenced in the method body code.
NOTE
Remove Unused Parameter is a cascading Refactoring. That means that the Refactoring affects all method calls and method declarations in interfaces, base and descendant classes.
Availability
Available in the following cases:
- When the cursor is on a method parameter, assuming this parameter was never used.
- When the cursor is on a method name, assuming this method has one or more parameters that were never used.
Usage
Place the caret on an unused method parameter.
NOTE
The blinking cursor shows the caret's position at which the Refactoring is available.
- Use the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions Menu.
- Select Remove Unused Parameter: <parameter name> from the menu.
After execution, the Refactoring removes the unused parameter from the method signature.
See Also