File tree Expand file tree Collapse file tree 2 files changed +6
-35
lines changed
test/SourceKit/CodeExpand
tools/SourceKit/lib/SwiftLang Expand file tree Collapse file tree 2 files changed +6
-35
lines changed Original file line number Diff line number Diff line change @@ -147,17 +147,11 @@ braced2(x: {<#T##() -> Void#>}, y: Int)
147147// CHECK-NEXT: }, y: Int)
148148
149149braced3 ( {
150- #if true
151150 < #T##( ) - > Int#>
152- #endif
153151} )
154- // CHECK: braced3({
155- // CHECK-NEXT: #if true
156- // CHECK-NEXT: {
152+ // CHECK: braced3 {
157153// CHECK-NEXT: <#code#>
158- // CHECK-NEXT: }
159- // CHECK-NEXT: #endif
160- // CHECK-NEXT: })
154+ // CHECK-NEXT: }
161155
162156func return Trailing( ) - > Int {
163157 return withtrail ( < #T##( ) - > ( ) #> )
@@ -260,17 +254,6 @@ func activeWithTrailing() {
260254 // CHECK: forEach {
261255 // CHECK-NEXT: <#code#>
262256}
263- #if false
264- func inactive( ) {
265- foo ( < #T##value: Foo##Foo#> )
266- // CHECK: foo(Foo)
267- }
268- func inactiveWithTrailing( ) {
269- forEach ( < #T##( ) - > ( ) #> )
270- // CHECK: forEach {
271- // CHECK-NEXT: <#code#>
272- }
273- #endif
274257
275258expandClosureWithInternalParameterNames {
276259 withtrail ( < #T##callback: ( Int, Int) - > Bool##( _ a: Int, _ b: Int) - > Bool#> )
Original file line number Diff line number Diff line change @@ -1608,9 +1608,11 @@ class PlaceholderExpansionScanner {
16081608 if (auto *ICD = dyn_cast<IfConfigDecl>(D)) {
16091609 // The base walker assumes the content of active IfConfigDecl clauses
16101610 // has been injected into the parent context and will be walked there.
1611- // This doesn't hold for pre-typechecked ASTs and we need to find
1612- // placeholders in inactive clauses anyway, so walk them here.
1611+ // This doesn't hold for pre-typechecked ASTs, so walk them here.
16131612 for (auto Clause: ICD->getClauses ()) {
1613+ if (!Clause.isActive )
1614+ continue ;
1615+
16141616 for (auto Elem: Clause.Elements ) {
16151617 Elem.walk (*this );
16161618 }
@@ -1798,20 +1800,6 @@ class PlaceholderExpansionScanner {
17981800 return Action::Continue (S);
17991801 }
18001802
1801- PreWalkAction walkToDeclPre (Decl *D) override {
1802- if (auto *ICD = dyn_cast<IfConfigDecl>(D)) {
1803- for (auto Clause : ICD->getClauses ()) {
1804- // Active clase elements are visited normally.
1805- if (Clause.isActive )
1806- continue ;
1807- for (auto Member : Clause.Elements )
1808- Member.walk (*this );
1809- }
1810- return Action::SkipNode ();
1811- }
1812- return Action::Continue ();
1813- }
1814-
18151803 ArgumentList *findEnclosingCallArg (SourceFile &SF, SourceLoc SL) {
18161804 EnclosingCallAndArg = {nullptr , nullptr };
18171805 OuterExpr = nullptr ;
You can’t perform that action at this time.
0 commit comments