mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "[CodeCompletion] Add the initial support for code completing import declaration."
This reverts r30957 because it broke the following tests on Jenkins:
SourceKit :: CodeComplete/complete_open.swift
SourceKit :: CodeComplete/complete_test.swift
<rdar://problem/22120345> swift-incremental-RA #8289 failed to build
Swift SVN r30961
This commit is contained in:
@@ -667,7 +667,6 @@ class CodeCompletionCallbacksImpl : public CodeCompletionCallbacks {
|
||||
|
||||
enum class CompletionKind {
|
||||
None,
|
||||
Import,
|
||||
DotExpr,
|
||||
PostfixExprBeginning,
|
||||
PostfixExpr,
|
||||
@@ -834,7 +833,6 @@ public:
|
||||
SmallVectorImpl<StringRef> &Keywords) override;
|
||||
|
||||
void completePoundAvailablePlatform() override;
|
||||
void completeImportDecl() override;
|
||||
|
||||
void addKeywords(CodeCompletionResultSink &Sink);
|
||||
|
||||
@@ -1020,27 +1018,6 @@ public:
|
||||
ExpressionSpecificDecls.insert(D);
|
||||
}
|
||||
|
||||
void addImportModuleNames() {
|
||||
// FIXME: Add user-defined swift modules
|
||||
SmallVector<clang::Module*, 20> Modules;
|
||||
Ctx.getVisibleTopLevelClangeModules(Modules);
|
||||
std::sort(Modules.begin(), Modules.end(),
|
||||
[](clang::Module* LHS , clang::Module* RHS) {
|
||||
return LHS->getTopLevelModuleName().compare_lower(
|
||||
RHS->getTopLevelModuleName()) < 0;
|
||||
});
|
||||
for (auto *M : Modules) {
|
||||
if (M->isAvailable() && !M->getTopLevelModuleName().startswith("_")) {
|
||||
CodeCompletionResultBuilder Builder(Sink,
|
||||
CodeCompletionResult::ResultKind::
|
||||
Keyword,
|
||||
SemanticContextKind::None);
|
||||
Builder.addTextChunk(M->getTopLevelModuleName());
|
||||
Builder.addTypeAnnotation("Module");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SemanticContextKind getSemanticContext(const Decl *D,
|
||||
DeclVisibilityKind Reason) {
|
||||
if (ForcedSemanticContext)
|
||||
@@ -2479,11 +2456,6 @@ void CodeCompletionCallbacksImpl::completeCaseStmtDotPrefix() {
|
||||
CurDeclContext = P.CurDeclContext;
|
||||
}
|
||||
|
||||
void CodeCompletionCallbacksImpl::completeImportDecl() {
|
||||
Kind = CompletionKind::Import;
|
||||
CurDeclContext = P.CurDeclContext;
|
||||
}
|
||||
|
||||
void CodeCompletionCallbacksImpl::completeNominalMemberBeginning(
|
||||
SmallVectorImpl<StringRef> &Keywords) {
|
||||
assert(!InEnumElementRawValue);
|
||||
@@ -2572,7 +2544,6 @@ void CodeCompletionCallbacksImpl::addKeywords(CodeCompletionResultSink &Sink) {
|
||||
case CompletionKind::AttributeDeclParen:
|
||||
case CompletionKind::AttributeBegin:
|
||||
case CompletionKind::PoundAvailablePlatform:
|
||||
case CompletionKind::Import:
|
||||
break;
|
||||
|
||||
case CompletionKind::PostfixExprBeginning:
|
||||
@@ -2790,10 +2761,6 @@ void CodeCompletionCallbacksImpl::doneParsing() {
|
||||
Lookup.getPoundAvailablePlatformCompletions();
|
||||
break;
|
||||
}
|
||||
case CompletionKind::Import: {
|
||||
Lookup.addImportModuleNames();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Lookup.RequestedCachedResults) {
|
||||
|
||||
Reference in New Issue
Block a user