]> granicus.if.org Git - clang/commit
[CodeComplete] Add an option to omit results from the preamble.
authorSam McCall <sam.mccall@gmail.com>
Fri, 12 Jan 2018 14:51:47 +0000 (14:51 +0000)
committerSam McCall <sam.mccall@gmail.com>
Fri, 12 Jan 2018 14:51:47 +0000 (14:51 +0000)
commit3ee4cc4acfa675c8cace6b05f2b41ed45a6a1033
treeeafc3fc139c8fdbb56ec595c61ed608af8af505b
parent780143bbd516aa39d754e5cab50955321b71fba0
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322371 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang-c/Index.h
include/clang/Sema/CodeCompleteConsumer.h
include/clang/Sema/CodeCompleteOptions.h
include/clang/Sema/Sema.h
lib/Frontend/ASTUnit.cpp
lib/Sema/SemaCodeComplete.cpp
lib/Sema/SemaLookup.cpp
test/Index/complete-pch-skip.cpp [new file with mode: 0644]
test/Index/complete-pch-skip.h [new file with mode: 0644]
tools/c-index-test/c-index-test.c
tools/libclang/CIndexCodeCompletion.cpp