From bb2cf63b324846ee74fc785d0f49b8b29e105297 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Fri, 12 Jan 2018 14:51:47 +0000 Subject: [CodeComplete] Add an option to omit results from the preamble. Summary: Enumerating the contents of a namespace or global scope will omit any decls that aren't already loaded, instead of deserializing them from the PCH. This allows a fast hybrid code completion where symbols from headers are provided by an external index. (Sema already exposes the information needed to do a reasonabl job of filtering them). Clangd plans to implement this hybrid. This option is just a hint - callers still need to postfilter results if they want to *avoid* completing decls outside the main file. Reviewers: bkramer, ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41989 llvm-svn: 322371 --- clang/lib/Frontend/ASTUnit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Frontend/ASTUnit.cpp') diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 1160df15a92..74abbf3b725 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -2068,6 +2068,7 @@ void ASTUnit::CodeComplete( CodeCompleteOpts.IncludeCodePatterns = IncludeCodePatterns; CodeCompleteOpts.IncludeGlobals = CachedCompletionResults.empty(); CodeCompleteOpts.IncludeBriefComments = IncludeBriefComments; + CodeCompleteOpts.LoadExternal = Consumer.loadExternal(); assert(IncludeBriefComments == this->IncludeBriefCommentsInCodeCompletion); -- cgit v1.2.3