[CodeCompletion] Store ignored arguments as Expr * instead of ConstraintLocators

This avoids the construction of `ConstraintLocator`s.
This commit is contained in:
Alex Hoppen
2022-03-18 08:30:03 +01:00
parent a8cec01c6f
commit 82fc059018
4 changed files with 36 additions and 23 deletions

View File

@@ -12470,9 +12470,14 @@ bool ConstraintSystem::recordFix(ConstraintFix *fix, unsigned impact) {
log << ")\n";
}
if (isArgumentIgnoredForCodeCompletion(fix->getLocator())) {
// The argument was ignored. Don't record any fixes for it.
return false;
if (hasArgumentsIgnoredForCodeCompletion()) {
// Avoid simplifying the locator if the constraint system didn't ignore any
// arguments.
auto argExpr = simplifyLocatorToAnchor(fix->getLocator());
if (isArgumentIgnoredForCodeCompletion(getAsExpr<Expr>(argExpr))) {
// The argument was ignored. Don't record any fixes for it.
return false;
}
}
// Record the fix.