[PATCH] D116326: [CodeCompletion] Signature help for aggregate initialization.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 27 19:37:08 PST 2021


sammccall created this revision.
sammccall added reviewers: kadircet, usaxena95.
Herald added a subscriber: arphaman.
sammccall requested review of this revision.
Herald added subscribers: cfe-commits, ilya-biryukov.
Herald added projects: clang, clang-tools-extra.

The "parameter list" is the list of fields which should be initialized.
We introduce a new OverloadCandidate kind for this.
It starts to become harder for CC consumers to handle all the cases for
params, so I added some extra APIs on OverloadCandidate to abstract them.

Includes some basic support for designated initializers.
The same aggregate signature is shown, the current arg jumps after the
one you just initialized. This follows C99 semantics for mixed
designated/positional initializers (which clang supports in C++ as an extension)
and is also a useful prompt for C++ as C++ designated initializers must be
in order.

Related bugs:

- https://github.com/clangd/clangd/issues/965
- https://github.com/clangd/clangd/issues/306


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116326

Files:
  clang-tools-extra/clangd/CodeComplete.cpp
  clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
  clang/include/clang/Sema/CodeCompleteConsumer.h
  clang/lib/Sema/CodeCompleteConsumer.cpp
  clang/lib/Sema/SemaCodeComplete.cpp
  clang/test/CodeCompletion/ctor-signature.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116326.396363.patch
Type: text/x-patch
Size: 26133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211228/f896279c/attachment-0001.bin>


More information about the cfe-commits mailing list