Skip to content

Commit 1e723dd

Browse files
committed
[CodeCompletion] Don't increase the score for holes at the code completion token
1 parent 0c41310 commit 1e723dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,6 +2297,12 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
22972297
if (TypeVar->getImpl().getGenericParameter())
22982298
return false;
22992299

2300+
// Don't penalize solutions if we couldn't determine the type of the code
2301+
// completion token. We still want to examine the surrounding types in
2302+
// that case.
2303+
if (TypeVar->getImpl().isCodeCompletionToken())
2304+
return false;
2305+
23002306
// Don't penalize solutions with holes due to missing arguments after the
23012307
// code completion position.
23022308
auto argLoc = srcLocator->findLast<LocatorPathElt::SynthesizedArgument>();

0 commit comments

Comments
 (0)