[CodeCompletion] When code completing import decls, we only show the module names that are not yet imported in previous import decls.

Swift SVN r30964
This commit is contained in:
Xi Ge
2015-08-03 22:54:58 +00:00
parent 3a73be8b40
commit d7e07b1d4d
2 changed files with 16 additions and 5 deletions

View File

@@ -1030,7 +1030,11 @@ public:
RHS->getTopLevelModuleName()) < 0;
});
for (auto *M : Modules) {
if (M->isAvailable() && !M->getTopLevelModuleName().startswith("_")) {
if (M->isAvailable() &&
!M->getTopLevelModuleName().startswith("_") &&
// Name hidden implies not imported yet, exactly what code completion
// wants.
M->NameVisibility == clang::Module::NameVisibilityKind::Hidden) {
CodeCompletionResultBuilder Builder(Sink,
CodeCompletionResult::ResultKind::
Keyword,