File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -5620,16 +5620,20 @@ namespace {
56205620 .fixItInsert (coercion->getStartLoc (), " consume " );
56215621 }
56225622
5623- // Type-check any local decls encountered.
5624- for (auto *D : LocalDeclsToTypeCheck)
5625- TypeChecker::typeCheckDecl (D);
5626-
5627- // Expand any macros encountered.
5628- // FIXME: Expansion should be lazy.
5629- auto &eval = cs.getASTContext ().evaluator ;
5630- for (auto *E : MacrosToExpand) {
5631- (void )evaluateOrDefault (eval, ExpandMacroExpansionExprRequest{E},
5632- std::nullopt );
5623+ // If we're doing code completion, avoid doing any further type-checking,
5624+ // that should instead be handled by TypeCheckASTNodeAtLocRequest.
5625+ if (!ctx.CompletionCallback ) {
5626+ // Type-check any local decls encountered.
5627+ for (auto *D : LocalDeclsToTypeCheck)
5628+ TypeChecker::typeCheckDecl (D);
5629+
5630+ // Expand any macros encountered.
5631+ // FIXME: Expansion should be lazy.
5632+ auto &eval = cs.getASTContext ().evaluator ;
5633+ for (auto *E : MacrosToExpand) {
5634+ (void )evaluateOrDefault (eval, ExpandMacroExpansionExprRequest{E},
5635+ std::nullopt );
5636+ }
56335637 }
56345638 }
56355639
You can’t perform that action at this time.
0 commit comments