summaryrefslogtreecommitdiff
path: root/tools/libclang
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
commitae8dcccdd1f0be33b4c6b26e00382a2585c9b6b4 (patch)
tree37fd462c6138bae1df1ceb729fbc4113ccec6cba /tools/libclang
parent0fb55e03c75d4e807dc67af9f9dfba9ff45fefa7 (diff)
downloadclang-ae8dcccdd1f0be33b4c6b26e00382a2585c9b6b4.tar.gz
[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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang')
-rw-r--r--tools/libclang/CIndexCodeCompletion.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp
index 766745ddea..4e4dcdb58c 100644
--- a/tools/libclang/CIndexCodeCompletion.cpp
+++ b/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;