diff options
Diffstat (limited to 'clang-tools-extra/clangd')
| -rw-r--r-- | clang-tools-extra/clangd/CodeComplete.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index ee709021f9c..dc5a85027f9 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -294,6 +294,13 @@ public: std::priority_queue<CompletionCandidate> Candidates; for (unsigned I = 0; I < NumResults; ++I) { auto &Result = Results[I]; + // We drop hidden items, as they cannot be found by the lookup after + // inserting the corresponding completion item and only produce noise and + // duplicates in the completion list. However, there is one exception. If + // Result has a Qualifier which is non-informative, we can refer to an + // item by adding that qualifier, so we don't filter out this item. + if (Result.Hidden && (!Result.Qualifier || Result.QualifierIsInformative)) + continue; if (!ClangdOpts.IncludeIneligibleResults && (Result.Availability == CXAvailability_NotAvailable || Result.Availability == CXAvailability_NotAccessible)) |

