summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-29 18:15:03 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-29 18:15:03 +0000
commit07f4357b446e959f81063bb14b705ea375b35ac4 (patch)
treedf680b6e2b37529673a04a69a7c0389aa609ff2f /clang/lib/Parse/Parser.cpp
parent279a6c3747b10c33f8f425cf4a24e64db015d3e9 (diff)
downloadbcm5719-llvm-07f4357b446e959f81063bb14b705ea375b35ac4.tar.gz
bcm5719-llvm-07f4357b446e959f81063bb14b705ea375b35ac4.zip
Implement code completion support for module import declarations, e.g.,
@import <complete with module names here> or @import std.<complete with submodule names here> Addresses <rdar://problem/10710117>. llvm-svn: 149199
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 5afb0fdf3ce..9ec9f9e8bbe 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -1595,6 +1595,13 @@ Parser::DeclGroupPtrTy Parser::ParseModuleImport(SourceLocation AtLoc) {
// Parse the module path.
do {
if (!Tok.is(tok::identifier)) {
+ if (Tok.is(tok::code_completion)) {
+ Actions.CodeCompleteModuleImport(ImportLoc, Path);
+ ConsumeCodeCompletionToken();
+ SkipUntil(tok::semi);
+ return DeclGroupPtrTy();
+ }
+
Diag(Tok, diag::err_module_expected_ident);
SkipUntil(tok::semi);
return DeclGroupPtrTy();
OpenPOWER on IntegriCloud