[PATCH] D80986: [clangd] Prototype for postfix completion.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 2 03:52:09 PDT 2020


sammccall added a comment.

Neat!

> The big question: Where should we implement? in clangd, or in Sema?

Advantages of Sema:

- better access to AST/context so more flexible
- available to tools other than clangd

Advantages of clangd:

- fewer layer of abstraction to traverse
- access to the index, config etc
- more comfortable making calls about how much to assume about stdlib etc
- maybe a bit easier to understand/test (depends on what you're used to)

We could get access to the index or other things from clangd by adding a hook to provide these "extended" member completions, and having clangd implement it... Not sure if that's best or worst of both worlds.

One question with Sema is how to make it produce the right text edit. Can we model it as a RK_Pattern completion with a typo fix to delete the `foo.` before the `if`?

This choice would be clearer if we had a set of examples we wanted to implement. If it's just if/for, then Sema seems like the right call...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80986/new/

https://reviews.llvm.org/D80986





More information about the cfe-commits mailing list