[CodeCompletion] Make sure callback is always called from performOperation

We had some situations left that neither returned an error, nor called the callback with results in `performOperation`. Return an error in these and adjust the tests to correctly match the error.
This commit is contained in:
Alex Hoppen
2021-10-07 19:04:56 +02:00
parent 2fcb24e716
commit b6e03e3d98
8 changed files with 89 additions and 36 deletions

View File

@@ -81,6 +81,12 @@ static void swiftConformingMethodListImpl(
ide::makeConformingMethodListCallbacksFactory(ExpectedTypeNames,
Consumer));
if (!Result->DidFindCodeCompletionToken) {
Callback(ResultType::success(
{/*Results=*/nullptr, Result->DidReuseAST}));
return;
}
performCodeCompletionSecondPass(*Result->CI.getCodeCompletionFile(),
*callbacksFactory);
if (!Consumer.HandleResultWasCalled) {