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)
147
147
// CHECK-NEXT: }, y: Int)
148
148
149
149
braced3 ( {
150
- #if true
151
150
< #T##( ) - > Int#>
152
- #endif
153
151
} )
154
- // CHECK: braced3({
155
- // CHECK-NEXT: #if true
156
- // CHECK-NEXT: {
152
+ // CHECK: braced3 {
157
153
// CHECK-NEXT: <#code#>
158
- // CHECK-NEXT: }
159
- // CHECK-NEXT: #endif
160
- // CHECK-NEXT: })
154
+ // CHECK-NEXT: }
161
155
162
156
func return Trailing( ) - > Int {
163
157
return withtrail ( < #T##( ) - > ( ) #> )
@@ -260,17 +254,6 @@ func activeWithTrailing() {
260
254
// CHECK: forEach {
261
255
// CHECK-NEXT: <#code#>
262
256
}
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
274
257
275
258
expandClosureWithInternalParameterNames {
276
259
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 {
1608
1608
if (auto *ICD = dyn_cast<IfConfigDecl>(D)) {
1609
1609
// The base walker assumes the content of active IfConfigDecl clauses
1610
1610
// 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.
1613
1612
for (auto Clause: ICD->getClauses ()) {
1613
+ if (!Clause.isActive )
1614
+ continue ;
1615
+
1614
1616
for (auto Elem: Clause.Elements ) {
1615
1617
Elem.walk (*this );
1616
1618
}
@@ -1798,20 +1800,6 @@ class PlaceholderExpansionScanner {
1798
1800
return Action::Continue (S);
1799
1801
}
1800
1802
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
-
1815
1803
ArgumentList *findEnclosingCallArg (SourceFile &SF, SourceLoc SL) {
1816
1804
EnclosingCallAndArg = {nullptr , nullptr };
1817
1805
OuterExpr = nullptr ;
You can’t perform that action at this time.
0 commit comments