From 4e9b812af402da7b0177b03b02fe95a2341f2e0b Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Mon, 12 Mar 2018 14:49:09 +0000 Subject: [clangd] Collect the number of files referencing a symbol in the static index. Summary: This is an important ranking signal. It's off for the dynamic index for now. Correspondingly, tell the index infrastructure only to report declarations for the dynamic index. Reviewers: ioeric, hokein Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D44315 --- clang-tools-extra/unittests/clangd/IndexTests.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang-tools-extra/unittests/clangd/IndexTests.cpp') diff --git a/clang-tools-extra/unittests/clangd/IndexTests.cpp b/clang-tools-extra/unittests/clangd/IndexTests.cpp index 20eb4527d9f..5e5ddbfb86e 100644 --- a/clang-tools-extra/unittests/clangd/IndexTests.cpp +++ b/clang-tools-extra/unittests/clangd/IndexTests.cpp @@ -225,6 +225,8 @@ TEST(MergeTest, Merge) { L.Name = R.Name = "Foo"; // same in both L.CanonicalDeclaration.FileURI = "file:///left.h"; // differs R.CanonicalDeclaration.FileURI = "file:///right.h"; + L.References = 1; + R.References = 2; L.CompletionPlainInsertText = "f00"; // present in left only R.CompletionSnippetInsertText = "f0{$1:0}"; // present in right only Symbol::Details DetL, DetR; @@ -238,6 +240,7 @@ TEST(MergeTest, Merge) { Symbol M = mergeSymbol(L, R, &Scratch); EXPECT_EQ(M.Name, "Foo"); EXPECT_EQ(M.CanonicalDeclaration.FileURI, "file:///left.h"); + EXPECT_EQ(M.References, 3u); EXPECT_EQ(M.CompletionPlainInsertText, "f00"); EXPECT_EQ(M.CompletionSnippetInsertText, "f0{$1:0}"); ASSERT_TRUE(M.Detail); -- cgit v1.2.3