[all-commits] [llvm/llvm-project] 229c95: [CodeCompletion] Signature help for aggregate init...

Sam McCall via All-commits all-commits at lists.llvm.org
Tue Jan 4 07:00:37 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 229c95ab661d89d29a64bff014229b7c6d3ee8a1
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-01-04 (Tue, 04 Jan 2022)

  Changed paths:
    M clang-tools-extra/clangd/CodeComplete.cpp
    M clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
    M clang/include/clang/Sema/CodeCompleteConsumer.h
    M clang/lib/Sema/CodeCompleteConsumer.cpp
    M clang/lib/Sema/SemaCodeComplete.cpp
    M clang/test/CodeCompletion/ctor-signature.cpp
    A tl

  Log Message:
  [CodeCompletion] Signature help for aggregate initialization.

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

Differential Revision: https://reviews.llvm.org/D116326

More information about the All-commits mailing list