diff options
| author | Ilya Biryukov <ibiryukov@google.com> | 2018-06-04 14:50:59 +0000 |
|---|---|---|
| committer | Ilya Biryukov <ibiryukov@google.com> | 2018-06-04 14:50:59 +0000 |
| commit | f029646fa38efe81885287499acdc3338639a15a (patch) | |
| tree | 109ad8c3e32972127a6a18c67268e5bcc4639b9e /clang-tools-extra/clangd/Quality.h | |
| parent | 59198ed0403f6cf2042d8252fc3e0071b125f5d2 (diff) | |
| download | bcm5719-llvm-f029646fa38efe81885287499acdc3338639a15a.tar.gz bcm5719-llvm-f029646fa38efe81885287499acdc3338639a15a.zip | |
[clangd] Boost scores for decls from current file in completion
Summary: This should, arguably, give better ranking.
Reviewers: ioeric, sammccall
Reviewed By: sammccall
Subscribers: mgorny, klimek, MaskRay, jkorous, mgrang, cfe-commits
Differential Revision: https://reviews.llvm.org/D46943
llvm-svn: 333906
Diffstat (limited to 'clang-tools-extra/clangd/Quality.h')
| -rw-r--r-- | clang-tools-extra/clangd/Quality.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/Quality.h b/clang-tools-extra/clangd/Quality.h index a67af4cd7b7..a6b2ff65939 100644 --- a/clang-tools-extra/clangd/Quality.h +++ b/clang-tools-extra/clangd/Quality.h @@ -64,6 +64,9 @@ struct SymbolRelevanceSignals { // 0-1 fuzzy-match score for unqualified name. Must be explicitly assigned. float NameMatch = 1; bool Forbidden = false; // Unavailable (e.g const) or inaccessible (private). + /// Proximity between the best declaration and the query location. [0-1] score + /// where 1 is closest + float ProximityScore = 0; void merge(const CodeCompletionResult &SemaResult); |

