[PATCH] D51291: [clangd] *Prototype* Support multiple #include headers in one symbol.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 27 02:37:42 PDT 2018


ioeric created this revision.
ioeric added a reviewer: sammccall.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.

Currently, a symbol can have only one #include header attached, which
might not work well if the symbol can be imported via different #includes depending
on where it's used. This patch stores multiple #include headers (with # references)
for each symbol, so that CodeCompletion can suggest one candidate for each
distinct #include for the same symbol and rank them according to proximity and
popularity of #include headers. In order to preserve the order of overall ranking
(i.e. ranking score without #include signals) and group candidates for the same symbol
close by, we only increment the ranking score by a small amount based on the relevance
and quality of #includes.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51291

Files:
  clangd/CodeComplete.cpp
  clangd/Quality.cpp
  clangd/Quality.h
  clangd/index/Index.cpp
  clangd/index/Index.h
  clangd/index/Merge.cpp
  clangd/index/SymbolCollector.cpp
  clangd/index/SymbolYAML.cpp
  unittests/clangd/CodeCompleteTests.cpp
  unittests/clangd/FileIndexTests.cpp
  unittests/clangd/IndexTests.cpp
  unittests/clangd/QualityTests.cpp
  unittests/clangd/SymbolCollectorTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51291.162640.patch
Type: text/x-patch
Size: 21349 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180827/151ed167/attachment-0001.bin>


More information about the cfe-commits mailing list