Skip to content

Commit 732acad

Browse files
committed
[Parser] Reset ASTScopes before performing the IDEInspection second pass.
IDE inspection can delay parsing of particular declarations, so expanding ASTScopes during the first pass will miss those declarations. Clear any expanded scopes to force re-expansion during the second pass. (cherry picked from commit 51e1a39)
1 parent 41b3f35 commit 732acad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Parse/Parser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ void Parser::performIDEInspectionSecondPassImpl(
154154
// discriminators.
155155
Context.evaluator.clearCachedOutput(LocalDiscriminatorsRequest{DC});
156156

157+
// Clear any ASTScopes that were expanded.
158+
SF.clearScope();
159+
157160
switch (info.Kind) {
158161
case IDEInspectionDelayedDeclKind::TopLevelCodeDecl: {
159162
// Re-enter the top-level code decl context.

0 commit comments

Comments
 (0)