]> granicus.if.org Git - clang/commit
[CodeComplete] Add completions for filenames in #include directives.
authorSam McCall <sam.mccall@gmail.com>
Tue, 18 Sep 2018 08:40:41 +0000 (08:40 +0000)
committerSam McCall <sam.mccall@gmail.com>
Tue, 18 Sep 2018 08:40:41 +0000 (08:40 +0000)
commitae8dcccdd1f0be33b4c6b26e00382a2585c9b6b4
tree37fd462c6138bae1df1ceb729fbc4113ccec6cba
parent0fb55e03c75d4e807dc67af9f9dfba9ff45fefa7
[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
15 files changed:
include/clang-c/Index.h
include/clang/Lex/CodeCompletionHandler.h
include/clang/Lex/Lexer.h
include/clang/Lex/Preprocessor.h
include/clang/Parse/Parser.h
include/clang/Sema/CodeCompleteConsumer.h
include/clang/Sema/Sema.h
lib/Frontend/ASTUnit.cpp
lib/Lex/Lexer.cpp
lib/Lex/Preprocessor.cpp
lib/Parse/Parser.cpp
lib/Sema/CodeCompleteConsumer.cpp
lib/Sema/SemaCodeComplete.cpp
test/CodeCompletion/included-files.cpp [new file with mode: 0644]
tools/libclang/CIndexCodeCompletion.cpp