Aqua lets you use the Safe Delete refactoring to remove files and symbols from the source code safely. Before Aqua deletes a file or a symbol, it searches for usages and if they are found, Aqua lets you check them to make necessary adjustments.
Select an item you want to delete.
Selectfrom the main or context menu or press Alt+Delete.
In the dialog that opens, select necessary options and click OK.
If Aqua encountered potential problems, it displays the Usages Detected dialog. Proceed with the appropriate action.
Safe delete a parameter
Safe delete a parameter for a call hierarchy (here performed on the parameter
If a parameter is passed only through a call hierarchy, the Safe Delete action will delete the parameter through the whole hierarchy. Aqua displays the appropriate dialog where you can select the caller methods in which the parameter should be deleted.
Safe delete a method
Safe delete a method in a call hierarchy (here performed on the
foo(int i) method).
Aqua analyzes the corresponding call hierarchy and displays the appropriate dialog, suggesting you delete all unused methods in that call hierarchy.
Safe delete the unused class field
Safe delete the unused class field (here performed on
When you remove an unused class field that is injected via constructor, Aqua removes the associated constructor parameter as well. Aqua opens the appropriate dialog where you can check and confirm your code deletion.