Is it possible to invoke refactoring from the Open Tools API?

141 views Asked by At

The Delphi IDE has a plugin system, the Open Tools API. The IDE also has a number of refactorings available, such as a rename refactoring to rename a field, method, etc - an identifier.

Is it possible to invoke this, or any, refactorings from the OTAPI? If not, is there a hacky way to do it?

My research shows no mentions of refactorings in ToolsAPI.pas, but I don't want to give up with "No." It doesn't mean there isn't a way to do it - it just means I don't know what it is :)

1

There are 1 answers

2
David Heffernan On

There is no support at all from OTA. Therefore your only hope is to hunt down the menu items or actions, invoke their OnClick or OnExecute handlers, poke values into the dialogs that are shown, and then programmatically press the dialog OK buttons.