Index: clang-tools-extra/clangd/index/dex/Iterator.h =================================================================== --- clang-tools-extra/clangd/index/dex/Iterator.h +++ clang-tools-extra/clangd/index/dex/Iterator.h @@ -93,9 +93,8 @@ /// /// Where Type is the iterator type representation: "&" for And, "|" for Or, /// ChildN is N-th iterator child. Raw iterators over PostingList are - /// represented as "[ID1, ID2, ..., {IDN}, ... END]" where IDN is N-th - /// PostingList entry and the element which is pointed to by the PostingList - /// iterator is enclosed in {} braces. + /// represented as "[... ID ...]" where ID is the element under iterator + /// cursor. friend llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Iterator &Iterator) { return Iterator.dump(OS); Index: clang-tools-extra/clangd/index/dex/PostingList.cpp =================================================================== --- clang-tools-extra/clangd/index/dex/PostingList.cpp +++ clang-tools-extra/clangd/index/dex/PostingList.cpp @@ -61,10 +61,14 @@ private: llvm::raw_ostream &dump(llvm::raw_ostream &OS) const override { OS << '['; + if (Index != std::begin(Documents)) + OS << "... "; if (Index != std::end(Documents)) OS << *Index; else OS << "END"; + if (Index != std::end(Documents) && Index != std::end(Documents) - 1) + OS << " ..."; OS << ']'; return OS; } Index: clang-tools-extra/unittests/clangd/DexTests.cpp =================================================================== --- clang-tools-extra/unittests/clangd/DexTests.cpp +++ clang-tools-extra/unittests/clangd/DexTests.cpp @@ -262,13 +262,15 @@ const PostingList L4({0, 1, 5}); const PostingList L5({}); - EXPECT_EQ(llvm::to_string(*(L0.iterator())), "[4]"); + EXPECT_EQ(llvm::to_string(*(L0.iterator())), "[4 ...]"); auto Nested = createAnd(createAnd(L1.iterator(), L2.iterator()), createOr(L3.iterator(), L4.iterator(), L5.iterator())); - EXPECT_EQ(llvm::to_string(*Nested), "(& (| [5] [1] [END]) (& [1] [1]))"); + EXPECT_EQ( + llvm::to_string(*Nested), + "(& (| [... 5] [... 1 ...] [END]) (& [1 ...] [1 ...]))"); } TEST(DexIterators, Limit) {