aboutsummaryrefslogtreecommitdiff
path: root/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
commitc5b2e58840748145d1706c1d1481369d1863fabf (patch)
treef970f0dfb900028f9910896fb7cc9371d3186bf5 /lib/Parse/Parser.cpp
parente434ec71fccfe078906403affd641f709702d598 (diff)
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r--lib/Parse/Parser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 5afb0fdf3c..9ec9f9e8bb 100644
--- a/lib/Parse/Parser.cpp
+++ b/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();