summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-01-12 14:51:47 +0000
committerSam McCall <sam.mccall@gmail.com>2018-01-12 14:51:47 +0000
commitbb2cf63b324846ee74fc785d0f49b8b29e105297 (patch)
tree2dae45ec75b165bb4da32e729c86ae2b2841b4b6 /clang/tools/c-index-test/c-index-test.c
parentf4374f087f4440f2b25cf2b69b089c5add35b73c (diff)
downloadbcm5719-llvm-bb2cf63b324846ee74fc785d0f49b8b29e105297.tar.gz
bcm5719-llvm-bb2cf63b324846ee74fc785d0f49b8b29e105297.zip
[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
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r--clang/tools/c-index-test/c-index-test.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index c5e345ef6af..2094be339c8 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -2326,6 +2326,8 @@ int perform_code_completion(int argc, const char **argv, int timing_only) {
completionOptions |= CXCodeComplete_IncludeCodePatterns;
if (getenv("CINDEXTEST_COMPLETION_BRIEF_COMMENTS"))
completionOptions |= CXCodeComplete_IncludeBriefComments;
+ if (getenv("CINDEXTEST_COMPLETION_SKIP_PREAMBLE"))
+ completionOptions |= CXCodeComplete_SkipPreamble;
if (timing_only)
input += strlen("-code-completion-timing=");
OpenPOWER on IntegriCloud