Skip to content

Commit 1813202

Browse files
committed
Revert "[code-completion] Disable diagnostics in @functionBuilder bodies"
This reverts commit c6eade1.
1 parent f263914 commit 1813202

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

include/swift/Basic/SourceManager.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,6 @@ class SourceManager {
103103
rangeContainsTokenLoc(Enclosing, Inner.End);
104104
}
105105

106-
/// Returns true if range \p R contains the code-completion location, if any.
107-
bool rangeContainsCodeCompletionLoc(SourceRange R) const {
108-
return CodeCompletionBufferID
109-
? rangeContainsTokenLoc(R, getCodeCompletionLoc())
110-
: false;
111-
}
112-
113106
/// Returns the buffer ID for the specified *valid* location.
114107
///
115108
/// Because a valid source location always corresponds to a source buffer,

lib/Sema/BuilderTransform.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,6 @@ bool TypeChecker::typeCheckFunctionBuilderFuncBody(FuncDecl *FD,
496496
options |= TypeCheckExprFlags::ConvertTypeIsOpaqueReturnType;
497497
}
498498

499-
// If we are performing code-completion inside the functions body, supress
500-
// diagnostics to workaround typechecking performance problems.
501-
if (Context.SourceMgr.rangeContainsCodeCompletionLoc(
502-
FD->getBody()->getSourceRange()))
503-
options |= TypeCheckExprFlags::SuppressDiagnostics;
504-
505499
// Type-check the single result expression.
506500
Type returnExprType = typeCheckExpression(returnExpr, FD,
507501
TypeLoc::withoutLoc(returnType),
@@ -580,12 +574,6 @@ ConstraintSystem::TypeMatchResult ConstraintSystem::applyFunctionBuilder(
580574
assert(!builderType->hasTypeParameter());
581575
}
582576

583-
// If we are performing code-completion inside the closure body, supress
584-
// diagnostics to workaround typechecking performance problems.
585-
if (getASTContext().SourceMgr.rangeContainsCodeCompletionLoc(
586-
closure->getSourceRange()))
587-
Options |= ConstraintSystemFlags::SuppressDiagnostics;
588-
589577
BuilderClosureVisitor visitor(getASTContext(), this,
590578
/*wantExpr=*/true, builderType);
591579
Expr *singleExpr = visitor.visit(closure->getBody());

0 commit comments

Comments
 (0)