private function getCompletionsFromAliasedNamespace(
        string $prefix,
        string $alias,
        string $aliasFqn,
        bool $requireCanBeInstantiated
    ): \Generator {
        $prefixFirstPart = nameGetFirstPart($prefix);
        // Matched alias.
        $resolvedPrefix = nameConcat($aliasFqn, nameWithoutFirstPart($prefix));
        $completionItems = $this->getCompletionsForFqnPrefix(
            $resolvedPrefix,
            $requireCanBeInstantiated,
            false
        );
        // Convert FQNs in the CompletionItems so they are expressed in terms of the alias.
        foreach ($completionItems as $fqn => $completionItem) {
            /** @var string $fqn with the leading parts determined by the alias removed. Has the leading backslash. */
            $nameWithoutAliasedPart = substr($fqn, strlen($aliasFqn));
            $completionItem->insertText = $alias . $nameWithoutAliasedPart;
            yield $fqn => $completionItem;
        }
    }