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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 14:00:02 PDT 2017


sammccall added a comment.

Hi Alex! I'm working on clangd, but am pretty new to the project, so forgive some naive questions.

I'm a bit unclear at a high level what the new abstractions in this patch add, in terms of wiring refactorings up to clangd and other tools.
My understanding is: we have a hierarchy of refactorings consisting of actions (roughly: user intent?) and rules (roughly: implementations).

Clangd needs to be able to:

- enumerate the actions and their associated rules: possible via `createRefactoringActions()`
- find names for these (machine readable and human readable): possible at the `Action` level, not `Rule` yet
- determine whether rules can be applied and what configuration is needed: possible via the `Rule` API
- invoke rules: possible via the `Rule` API

So AFAICT, clangd could be hooked up to the existing Refactor API, without `EditorCommand` or `EditorClient`. What's the gain?


Repository:
  rL LLVM

https://reviews.llvm.org/D38985





More information about the cfe-commits mailing list