[PATCH] D38985: [refactor] Add support for editor commands that connect IDEs/editors to the refactoring actions

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 08:30:33 PDT 2017

ioeric added inline comments.

Comment at: include/clang/Tooling/Refactoring/RefactoringActionRule.h:60
+  /// associated with this rule.
+  virtual Optional<std::pair<StringRef, StringRef>> getEditorCommandInfo() {
+    return None;
I think `getEditorCommandInfo` might be a wrong name here.

IMO, all end rules (i.e. editor-facing rules) should have name information. It might make sense to introduce a structure that holds all metadata about a rule as well as an interface that returns such a structure. With that, we also don't need to update the API when more rule information is added in the future. 

I also think the interface should be pure virtual, and all end rules should implement this interface since they should have names or metadata of some sort. 



More information about the cfe-commits mailing list