Skip to content

Commit 8bd9fde

Browse files
rintaroNathan Hawes
authored andcommitted
Revert "[code-completion] Disable diagnostics in @functionBuilder bodies"
This reverts commit c6eade1.
1 parent f11cc97 commit 8bd9fde

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
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 & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -566,12 +566,6 @@ ConstraintSystem::TypeMatchResult ConstraintSystem::applyFunctionBuilder(
566566
assert(!builderType->hasTypeParameter());
567567
}
568568

569-
// If we are performing code-completion inside the closure body, supress
570-
// diagnostics to workaround typechecking performance problems.
571-
if (getASTContext().SourceMgr.rangeContainsCodeCompletionLoc(
572-
closure->getSourceRange()))
573-
Options |= ConstraintSystemFlags::SuppressDiagnostics;
574-
575569
BuilderClosureVisitor visitor(getASTContext(), this,
576570
/*wantExpr=*/true, builderType);
577571
Expr *singleExpr = visitor.visit(closure->getBody());

0 commit comments

Comments
 (0)