From 82fd4009c2aa7430047d1cf32ca0df8d5435ba32 Mon Sep 17 00:00:00 2001 From: Xi Ge Date: Sat, 26 Sep 2015 00:58:46 +0000 Subject: [PATCH] Revert "[CodeComplete] Make sure the lookup API can find closure parameters. rdar://17968255" for breaking build bot. Swift SVN r32255 --- lib/AST/LookupVisibleDecls.cpp | 5 ----- test/IDE/complete_in_closures.swift | 11 ----------- 2 files changed, 16 deletions(-) diff --git a/lib/AST/LookupVisibleDecls.cpp b/lib/AST/LookupVisibleDecls.cpp index 443eb9fbc3bff..593a1809890a5 100644 --- a/lib/AST/LookupVisibleDecls.cpp +++ b/lib/AST/LookupVisibleDecls.cpp @@ -740,11 +740,6 @@ void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer, if (Loc.isValid()) { auto CE = cast(ACE); namelookup::FindLocalVal(SM, Loc, Consumer).visit(CE->getBody()); - for (auto Pattern : CE->getParamPatterns()) { - if (auto VD = Pattern->getSingleVar()) { - Consumer.foundDecl(VD, Reason); - } - } } } else if (auto ED = dyn_cast(DC)) { ExtendedType = ED->getExtendedType(); diff --git a/test/IDE/complete_in_closures.swift b/test/IDE/complete_in_closures.swift index 2c23f7d7ebbfe..ccf33bafcdaef 100644 --- a/test/IDE/complete_in_closures.swift +++ b/test/IDE/complete_in_closures.swift @@ -49,7 +49,6 @@ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_INHERITANCE_IN_CLOSURE_2 | FileCheck %s -check-prefix=WITH_GLOBAL_DECLS // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLASS_INHERITANCE_IN_CLOSURE_2 | FileCheck %s -check-prefix=WITH_GLOBAL_DECLS // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARGUMENT_TYPE_IN_CLOSURE_2 | FileCheck %s -check-prefix=WITH_GLOBAL_DECLS -// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_PARAM_1 | FileCheck %s -check-prefix=CLOSURE_PARAM_1 // ERROR_COMMON: found code completion token // ERROR_COMMON-NOT: Begin completions @@ -310,13 +309,3 @@ struct LazyVar3 { func test(x: #^ARGUMENT_TYPE_IN_CLOSURE_2^# }() } - -func closureTaker(theFunc:(theValue:Int) -> ()) {} - -func testClosureParam() { - closureTaker { (theValue) -> () in - #^CLOSURE_PARAM_1^# - } -} -// CLOSURE_PARAM_1: Begin completions -// CLOSURE_PARAM_1-DAG: Decl[LocalVar]/CurrNominal: theValue[#(Int)#]{{; name=.+$}}