[PATCH] D49012: [clangd] Uprank delcarations when "using q::name" is present in the main file

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 6 02:13:08 PDT 2018


omtcyfz created this revision.
omtcyfz added reviewers: ioeric, sammccall, ilya-biryukov.
omtcyfz added a project: clang-tools-extra.
Herald added subscribers: jkorous, MaskRay.

Having `using qualified::name;` for some symbol is an important signal for clangd code completion as the user is more likely to use such symbol. This patch helps to uprank the relevant symbols by saving UsingShadowDecl in the new field of CodeCompletionResult and checking whether the corresponding UsingShadowDecl is located in the main file later in ClangD code completion routine. While the relative importance of such signal is a subject to change in the future, this patch simply bumps DeclProximity score to the value of 1.0 which should be enough for now.

The patch was tested using

$ ninja check-clang check-clang-tools

No unexpected failures were noticed after running the relevant testsets.


https://reviews.llvm.org/D49012

Files:
  clang-tools-extra/clangd/Quality.cpp
  clang-tools-extra/unittests/clangd/QualityTests.cpp
  clang-tools-extra/unittests/clangd/TestTU.cpp
  clang/include/clang/Sema/CodeCompleteConsumer.h
  clang/lib/Sema/SemaCodeComplete.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49012.154375.patch
Type: text/x-patch
Size: 8575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180706/adcf6fd8/attachment.bin>


More information about the cfe-commits mailing list