I am finding that certain kinds of code cleanups and refactorings are made VERY difficult by the difficulty of adding a unit to the uses-clauses of a large project.
I want to add a unit to the interface-uses-clause of all delphi .pas units in a single project, and that means manually doing that in over 500 places. Every time I refactor a giant unit and split it from one unit into two, I can probably search and replace using something like "notepad++" to change "MyOldUnit," to "MyOldUnit,MyNewUnit," but sometimes, that's just not safe to do. It also misses the cases where "MyOldUnit" is the last thing in the uses clause ("uses MyOldUnit;").
Anyways, search and replacing in files is dangerous business. If no such tool exists, I am contemplating writing one, using the Castalia delphi parser. I have checked GExperts, Castalia, ModelMakerCodeExplorer and none of them have a way to batch-insert units into all uses clauses in a project. I'm hoping a tool to do this exists.
Secondly, in many cases, I'm moving a function from one unit where it doesn't belong to another, but this means I need to add that unit to 30% of the project's units, but not the other 70% where it's already added. That means a parser approach is required, not a regex approach.