diff options
author | Sam McCall <sam.mccall@gmail.com> | 2018-06-05 16:30:25 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2018-06-05 16:30:25 +0000 |
commit | d9b54f00256b9e1c0f1cd64dcb55e7063dc39389 (patch) | |
tree | e0a20b34a4329c908715ef61f0b0834ed4b2ebfb /clang-tools-extra/clangd/CodeComplete.cpp | |
parent | f2c14af3897601f8b33d22cc187fa95de7b31cdb (diff) | |
download | bcm5719-llvm-d9b54f00256b9e1c0f1cd64dcb55e7063dc39389.tar.gz bcm5719-llvm-d9b54f00256b9e1c0f1cd64dcb55e7063dc39389.zip |
[clangd] Boost code completion results that are narrowly scoped (local, members)
Summary:
This signal is considered a relevance rather than a quality signal because it's
dependent on the query (the fact that it's completion, and implicitly the query
context).
This is part of the effort to reduce reliance on Sema priority, so we can have
consistent ranking between Index and Sema results.
Reviewers: ioeric
Subscribers: klimek, ilya-biryukov, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D47762
llvm-svn: 334026
Diffstat (limited to 'clang-tools-extra/clangd/CodeComplete.cpp')
-rw-r--r-- | clang-tools-extra/clangd/CodeComplete.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index 7de69e344f7..6fb1d9a186c 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -1007,12 +1007,15 @@ private: SymbolQualitySignals Quality; SymbolRelevanceSignals Relevance; + Relevance.Query = SymbolRelevanceSignals::CodeComplete; if (auto FuzzyScore = Filter->match(C.Name)) Relevance.NameMatch = *FuzzyScore; else return; - if (IndexResult) + if (IndexResult) { Quality.merge(*IndexResult); + Relevance.merge(*IndexResult); + } if (SemaResult) { Quality.merge(*SemaResult); Relevance.merge(*SemaResult); |