Remove Unused Type
Removes types that are never executed or referenced.
You can use this refactoring to ensure the type you want to delete is not referenced in your code.
Currently, this refactoring cannot be applied to public types.
Available when the cursor is in a type declaration. This type is never used in code.
How to Use
- Place the caret in an unused type declaration.
The blinking cursor shows the caret’s position where Refactoring is available.
- Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
- Select Remove Unused Type from the menu.
After execution, the Refactoring removes the unused type.