[IDE] Set solution-specific variable types as interface types

Setting the interface type of a variable, just to reset it to a null type is actually really gross. But quite a few methods further down in the generation of code completion results (such as USR generation) need to get a variable’s type and passing them along in a separate map would be really invasive. So this seems like the least bad solution to me.
This commit is contained in:
Alex Hoppen
2023-03-07 17:47:31 -08:00
parent 0543c280e3
commit 614679f73d
6 changed files with 78 additions and 0 deletions

View File

@@ -105,6 +105,8 @@ void ExprTypeCheckCompletionCallback::deliverResults(
Lookup.shouldCheckForDuplicates(Results.size() > 1);
for (auto &Result : Results) {
WithSolutionSpecificVarTypesRAII VarTypes(Result.SolutionSpecificVarTypes);
Lookup.setExpectedTypes(ExpectedTypes,
Result.IsImplicitSingleExpressionReturn);
Lookup.setCanCurrDeclContextHandleAsync(Result.IsInAsyncContext);