This patch adds an editor client that can do things like:
- find a list of available refactoring editor commands in a particular range.
- perform a particular refactoring editor command in a particular range.
This editor client is used in clangd's support for refactoring commands (See dependent revision).
(I've ran out of time to add a unit test before devmeeting, so for now this is tested in clangd, but I'll add a unit test when I update the patch)
I think it's worth thinking about how this would work for refactoring actions that touch multiple TUs/ASTs, e.g. renaming symbol references in all user files or adding function definition (in cpp file) from a function declaration (in header file). With the current interfaces, clang-refactor would only be able to work on a single AST, but I think it should be able to get more ASTs from clangd if needed.
The clangd folks (including me) are happy to provide an interface that serves ASTs; we just need to make sure clang-refactor handles multi-TU refactoring. WDYT?