[PATCH] D58341: [clangd] Index UsingDecls

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 18 08:11:49 PST 2019


hokein added a comment.

In D58341#1401212 <https://reviews.llvm.org/D58341#1401212>, @ilya-biryukov wrote:

> For context: @hokein mentioned problems in the clangd's code completion if we would index these symbols.
>  This patch in itself does not hurt much, users of the indexing API can decide how to deal with `UsingDecl` on their own, clangd is just one of the clients.
>
> >   I wonder how does merge work with Sema results? See the case below, IIUC our indexer has one symbol for this using decl, but the code completion result from Sema contains two symbols. The symbol ids of these 3 symbols are different, so we will end up with 3 completion results.
>
> That's true, but we're not sure how much this would hurt in practice. Currently we don't show any results from dynamic index for `std::strcmp`, which is arguably worse than showing an extra completion item for the using.


std::strcmp is a fair case here. Sema seems not returning using-decls as part of code completion results, it this an intended behavior? Is it possible for us to extend Sema to support it?

If we decide to provide using-decl results from index, I think we should make sure the code completion information (e.g. signature) is correct.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58341/new/

https://reviews.llvm.org/D58341





More information about the cfe-commits mailing list