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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to