Skip to content

Commit 995083c

Browse files
committed
[CodeCompletion] Skip conjuction elements that are unrelated to the code completion token
1 parent 5d97795 commit 995083c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Sema/BuilderTransform.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,9 @@ class ResultBuilderTransform
10791079
// to rank code completion items that match the type expected by
10801080
// buildBlock higher.
10811081
buildBlockArguments.push_back(expr);
1082+
} else if (ctx.CompletionCallback && expr->getSourceRange().isValid() && !ctx.SourceMgr.rangeContainsIDEInspectionTarget(expr->getSourceRange())) {
1083+
auto *resultVar = buildPlaceholderVar(expr->getStartLoc(), newBody);
1084+
buildBlockArguments.push_back(builder.buildVarRef(resultVar, expr->getStartLoc()));
10821085
} else {
10831086
auto *capture = captureExpr(expr, newBody);
10841087
// A reference to the synthesized variable is passed as an argument

0 commit comments

Comments
 (0)