This is a quick proof-of-concept demo for postfix completion.
demo (ignore the wrong highlightings in VSCode):
The big question: Where should we implement? in clangd, or in Sema?
Paths
| Differential D80986
[clangd] Prototype for postfix completion. Needs ReviewPublic Authored by hokein on Jun 2 2020, 1:42 AM. This revision needs review, but there are no reviewers specified.
Details
Diff Detail
Event TimelineComment Actions Neat!
Advantages of Sema:
Advantages of clangd:
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...
Revision Contents
Diff 267818 clang-tools-extra/clangd/CodeComplete.cpp
clang/include/clang/Sema/CodeCompleteConsumer.h
clang/lib/Sema/SemaCodeComplete.cpp
|