summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndexCodeCompletion.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-09-18 08:40:41 +0000
committerSam McCall <sam.mccall@gmail.com>2018-09-18 08:40:41 +0000
commit3d8051abb8ead54c2eb67a7a45193d59daf6d847 (patch)
tree670bb7e08ba884179cd9cc461aa4f86caa603145 /clang/tools/libclang/CIndexCodeCompletion.cpp
parent5fefad793c10c2805671d40592ce7bcedc72cdf8 (diff)
downloadbcm5719-llvm-3d8051abb8ead54c2eb67a7a45193d59daf6d847.tar.gz
bcm5719-llvm-3d8051abb8ead54c2eb67a7a45193d59daf6d847.zip
[CodeComplete] Add completions for filenames in #include directives.
Summary: The dir component ("somedir" in #include <somedir/fo...>) is considered fixed. We append "foo" to each directory on the include path, and then list its files. Completions are of the forms: #include <somedir/fo^ foo.h> fox/ The filter is set to the filename part ("fo"), so fuzzy matching can be applied to the filename only. No fancy scoring/priorities are set, and no information is added to CodeCompleteResult to make smart scoring possible. Could be in future. Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52076 llvm-svn: 342449
Diffstat (limited to 'clang/tools/libclang/CIndexCodeCompletion.cpp')
-rw-r--r--clang/tools/libclang/CIndexCodeCompletion.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndexCodeCompletion.cpp b/clang/tools/libclang/CIndexCodeCompletion.cpp
index 766745ddea1..4e4dcdb58c5 100644
--- a/clang/tools/libclang/CIndexCodeCompletion.cpp
+++ b/clang/tools/libclang/CIndexCodeCompletion.cpp
@@ -499,6 +499,10 @@ static unsigned long long getContextsForContextKind(
contexts = CXCompletionContext_NaturalLanguage;
break;
}
+ case CodeCompletionContext::CCC_IncludedFile: {
+ contexts = CXCompletionContext_IncludedFile;
+ break;
+ }
case CodeCompletionContext::CCC_SelectorName: {
contexts = CXCompletionContext_ObjCSelectorName;
break;
OpenPOWER on IntegriCloud