[PATCH] D39055: [refactor] Add an editor client that is used in clangd

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 08:56:30 PDT 2017


ioeric added inline comments.


================
Comment at: include/clang/Tooling/Refactoring/EditorClient.h:46
+  /// error otherwise.
+  Expected<AtomicChanges> performRefactoring(ASTContext &Context,
+                                             StringRef CommandName,
----------------
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?


Repository:
  rL LLVM

https://reviews.llvm.org/D39055





More information about the cfe-commits mailing list