[clangd-dev] RFC: expected types in clangd completions

Alex L via clangd-dev clangd-dev at lists.llvm.org
Wed Aug 8 16:38:54 PDT 2018


Thanks for putting this together!

I have one question:

In the example where an 'std::make_unique<A>' completion was added based on
function argument type, how would Clang know that `std::unique_ptr` is
constructed using `std::make_unique`? Would that be hardcoded into Clang,
or would there be some way to annotate the type in the header (e.g. using
an attribute) so that Clang can deduce this (e.g. for supporting
`llvm::make_unique`, etc.).

Thanks,
Alex

On Wed, 8 Aug 2018 at 02:58, Ilya Biryukov via clangd-dev <
clangd-dev at lists.llvm.org> wrote:

> Hi clangd-dev,
>
> I have just posted a design doc about adding the expected types to the C++
> completions:
>
> https://docs.google.com/document/d/1_BSeTIr2aLA6wKKCRCajSI0AdnjhvgK4BXXJQX-Dsro/edit#
>
> It serves two purposes:
> - List possible improvements to code completion that can be gained by
> using more semantic information available in Clang.
> - Discuss the design of type-based ranking in presence of the index, i.e.
> when some completions are not from Sema.
>
> The first half of the document attempts to enumerate interesting cases
> where completions can be improved by using type information. It would be
> great to get ideas from anyone interested in improvements to ClangD
> completions in general,  the 'Anticipated Improvements' is there to collect
> a raw list of nice-to-have cases, feel free to contribue!
>
> The second half is targeted at a narrower audience, specifically anyone
> who's interested in support of type-based ranking with index enabled in
> ClangD. If you're interested, please take a look.
>
> Feedback and suggestions are very welcome!
>
> --
> Regards,
> Ilya Biryukov
> _______________________________________________
> clangd-dev mailing list
> clangd-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20180808/3b97f23a/attachment.html>


More information about the clangd-dev mailing list